Skip to content

Commit

Permalink
CF2036A Quintomania
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicfred committed Nov 25, 2024
1 parent a7fc9a3 commit c856a3e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions codeforces/cf2036a_quintomania.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Vicfred
# https://codeforces.com/contest/2036/problem/A
# implementation
t = int(input())
for melody in range(t):
n = int(input())
a = list(map(int, input().split()))
valid = True
for idx in range(n - 1):
diff = abs(a[idx] - a[idx + 1])
if diff != 5 and diff != 7:
valid = False
if valid:
print("Yes")
else:
print("No")

0 comments on commit c856a3e

Please sign in to comment.