結果

問題 No.1109 調の判定
ユーザー Maboy
提出日時 2021-09-29 08:41:27
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-16 06:24:32
合計ジャッジ時間 2,355 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
t = list(map(int,input().split()))
s = [1,0,1,0,1,1,0,1,0,1,0,1]
l = [0] * 12
v = []
for i in t:
    l[i] = 1

for i in range(12):
    u = [x*y for (x,y) in zip(l,s)]
    if u == l:
        v.append(i)
    s.insert(0,s.pop(-1))    

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