結果

問題 No.1109 調の判定
ユーザー lemon
提出日時 2021-05-10 00:34:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 554 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-19 04:52:34
合計ジャッジ時間 2,459 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
nsa = lambda: list(stdin.readline().split())
mod = 10 * 7 + 7

n = ni()
T = na()

D = (0, 2, 4, 5, 7, 9, 11)
Ans = []


for i in range(12):
    flag = True
    Di = set(map(lambda x: (x + i) % 12, D))
    for t in T:
        if not(t in Di):
            flag = False
            break
    if flag:
        Ans.append(i)

if len(Ans) == 1:
    print(Ans[0])

else:
    print(-1)
0