結果

問題 No.1109 調の判定
ユーザー xuanjixuanji
提出日時 2020-07-10 21:39:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 468 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 54,208 KB
最終ジャッジ日時 2024-04-19 16:19:18
合計ジャッジ時間 2,788 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,704 KB
testcase_01 AC 32 ms
53,208 KB
testcase_02 AC 31 ms
53,352 KB
testcase_03 AC 33 ms
54,208 KB
testcase_04 AC 32 ms
52,628 KB
testcase_05 AC 33 ms
52,548 KB
testcase_06 AC 33 ms
52,156 KB
testcase_07 AC 33 ms
53,628 KB
testcase_08 AC 32 ms
52,556 KB
testcase_09 AC 32 ms
52,216 KB
testcase_10 AC 33 ms
53,380 KB
testcase_11 AC 34 ms
52,932 KB
testcase_12 AC 31 ms
52,404 KB
testcase_13 AC 34 ms
52,000 KB
testcase_14 AC 33 ms
52,768 KB
testcase_15 AC 34 ms
54,096 KB
testcase_16 AC 33 ms
53,440 KB
testcase_17 AC 32 ms
53,432 KB
testcase_18 AC 33 ms
53,008 KB
testcase_19 AC 32 ms
52,648 KB
testcase_20 AC 32 ms
52,660 KB
testcase_21 AC 31 ms
52,612 KB
testcase_22 AC 31 ms
52,360 KB
testcase_23 AC 33 ms
54,164 KB
testcase_24 AC 33 ms
52,120 KB
testcase_25 AC 33 ms
53,444 KB
testcase_26 AC 33 ms
53,292 KB
testcase_27 AC 34 ms
53,184 KB
testcase_28 AC 33 ms
53,612 KB
testcase_29 AC 32 ms
52,820 KB
testcase_30 AC 33 ms
53,180 KB
testcase_31 AC 34 ms
52,824 KB
testcase_32 AC 33 ms
53,928 KB
testcase_33 AC 34 ms
52,620 KB
testcase_34 AC 33 ms
53,076 KB
testcase_35 AC 34 ms
52,708 KB
testcase_36 AC 32 ms
52,088 KB
testcase_37 AC 33 ms
53,464 KB
testcase_38 AC 33 ms
52,440 KB
testcase_39 AC 33 ms
53,812 KB
testcase_40 AC 33 ms
52,000 KB
testcase_41 AC 32 ms
53,496 KB
testcase_42 AC 33 ms
52,276 KB
testcase_43 AC 32 ms
52,156 KB
testcase_44 AC 33 ms
52,584 KB
testcase_45 AC 32 ms
52,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

MAJOR = set([0, 2, 4, 5, 7, 9, 11])

def subset(A, B):
    for a in A:
        if a not in B: return False
    return True

def ok(T, i):
    T = [((t - i % 12) + 12) % 12 for t in T]

    if subset(T, MAJOR):
        return True
    return False

def ans(T):
    candidates = [i for i in range(12) if ok(T, i)]
    if len(candidates) != 1: return -1
    return candidates[0]

input()
T = input().split(' ')
T = list(map(int, T))

print(ans(T))
0