結果

問題 No.1109 調の判定
ユーザー Coki628Coki628
提出日時 2020-11-24 00:14:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 937 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,736 KB
実行使用メモリ 71,592 KB
最終ジャッジ日時 2023-10-01 00:37:14
合計ジャッジ時間 6,154 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,432 KB
testcase_01 AC 70 ms
71,580 KB
testcase_02 AC 70 ms
71,420 KB
testcase_03 AC 71 ms
71,584 KB
testcase_04 AC 73 ms
71,324 KB
testcase_05 AC 69 ms
71,516 KB
testcase_06 AC 69 ms
71,228 KB
testcase_07 AC 72 ms
71,524 KB
testcase_08 AC 69 ms
71,432 KB
testcase_09 AC 70 ms
71,564 KB
testcase_10 AC 70 ms
71,584 KB
testcase_11 AC 69 ms
71,420 KB
testcase_12 AC 69 ms
71,544 KB
testcase_13 AC 71 ms
71,328 KB
testcase_14 AC 72 ms
71,580 KB
testcase_15 AC 72 ms
71,440 KB
testcase_16 AC 70 ms
71,576 KB
testcase_17 AC 71 ms
71,508 KB
testcase_18 AC 77 ms
71,456 KB
testcase_19 AC 68 ms
71,568 KB
testcase_20 AC 70 ms
71,456 KB
testcase_21 AC 71 ms
71,232 KB
testcase_22 AC 71 ms
71,300 KB
testcase_23 AC 71 ms
71,308 KB
testcase_24 AC 68 ms
71,412 KB
testcase_25 AC 69 ms
71,312 KB
testcase_26 AC 71 ms
71,356 KB
testcase_27 AC 70 ms
71,416 KB
testcase_28 AC 67 ms
71,484 KB
testcase_29 AC 70 ms
71,448 KB
testcase_30 AC 69 ms
71,456 KB
testcase_31 AC 74 ms
71,592 KB
testcase_32 AC 68 ms
71,580 KB
testcase_33 AC 72 ms
71,568 KB
testcase_34 AC 71 ms
71,416 KB
testcase_35 AC 69 ms
71,580 KB
testcase_36 AC 71 ms
71,128 KB
testcase_37 AC 70 ms
71,476 KB
testcase_38 AC 71 ms
71,452 KB
testcase_39 AC 70 ms
71,132 KB
testcase_40 AC 73 ms
71,400 KB
testcase_41 AC 72 ms
71,540 KB
testcase_42 AC 69 ms
71,436 KB
testcase_43 AC 70 ms
71,400 KB
testcase_44 AC 70 ms
71,524 KB
testcase_45 AC 70 ms
71,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for k in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for k in range(c)] for k in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10**9)
INF = 10**19
MOD = 10**9 + 7
EPS = 10**-10

N = INT()
A = LIST()

D = set([0, 2, 4, 5, 7, 9, 11])
mod = 12
ans = []
for k in range(12):
    ok = 1
    for a in A:
        if (a-k)%mod not in D:
            ok = 0
            break
    if ok:
        ans.append(k)

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