結果
| 問題 |
No.1109 調の判定
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-10 21:28:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 706 bytes |
| コンパイル時間 | 660 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 52,224 KB |
| 最終ジャッジ日時 | 2024-10-11 07:49:46 |
| 合計ジャッジ時間 | 3,195 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
# a,b,c,d = map(int,input().split())
# if a < b and c > d:
# print("YES")
# else:print("NO")
# n,h = map(int,input().split())
# a = list(map(int,input().split()))
# for i in range(n):
# a[i] += h
# print(*a)
n = int(input())
t = list(map(int,input().split()))
comb = []
for i in range(12):
u = []
u.append(i)
u.append((i+2)%12)
u.append((i+4)%12)
u.append((i+5)%12)
u.append((i+7)%12)
u.append((i+9)%12)
u.append((i+11)%12)
comb.append(u)
ans = []
for i in range(12):
tar = comb[i]
flag = True
for j in t:
if j not in tar:
flag = False
if flag:
ans.append(i)
if len(ans) == 1:
print(ans[0])
else:
print(-1)