結果

問題 No.1109 調の判定
ユーザー roaris
提出日時 2020-07-10 21:28:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 54,016 KB
最終ジャッジ日時 2024-10-11 07:47:54
合計ジャッジ時間 3,591 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N = int(input())
T = list(map(int, input().split()))
t = set(T)
ans = []

for d in range(12):
    s = set()
    
    for i in [0, 2, 4, 5, 7, 9, 11]:
        s.add((d+i)%12)
    
    if s>=t:
        ans.append(d)

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