結果

問題 No.1109 調の判定
ユーザー 37zigen
提出日時 2020-07-10 23:11:52
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-11 18:15:06
合計ジャッジ時間 2,912 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(D):
    return [D%12,(D+2)%12,(D+4)%12,(D+5)%12,(D+7)%12,(D+9)%12,(D+11)%12]

N=int(input())
T=[int(t) for t in input().split()]
cnt=0

s=set()
for i in range(12):
    if sum(t in f(i) for t in T)==len(T):
        cnt+=1
        s.add(i)
if len(s)==1:
    print(s.pop())
else:
    print(-1)
0