結果

問題 No.1109 調の判定
ユーザー lam6er
提出日時 2025-03-20 18:42:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 53,720 KB
最終ジャッジ日時 2025-03-20 18:43:05
合計ジャッジ時間 3,448 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
t_list = list(map(int, input().split()))

candidates = []
for D in range(12):
    scale = {(D + x) % 12 for x in [0, 2, 4, 5, 7, 9, 11]}
    valid = True
    for t in t_list:
        if t not in scale:
            valid = False
            break
    if valid:
        candidates.append(D)

if len(candidates) == 1:
    print(candidates[0])
else:
    print(-1)
0