結果

問題 No.1109 調の判定
ユーザー dangodango
提出日時 2023-06-24 18:43:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 86,508 KB
実行使用メモリ 71,200 KB
最終ジャッジ日時 2023-09-14 14:20:13
合計ジャッジ時間 6,813 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,972 KB
testcase_01 AC 67 ms
71,200 KB
testcase_02 AC 69 ms
70,976 KB
testcase_03 AC 69 ms
70,948 KB
testcase_04 AC 71 ms
71,128 KB
testcase_05 AC 71 ms
70,956 KB
testcase_06 AC 71 ms
71,036 KB
testcase_07 AC 69 ms
71,168 KB
testcase_08 AC 68 ms
71,012 KB
testcase_09 AC 71 ms
70,920 KB
testcase_10 AC 70 ms
71,068 KB
testcase_11 AC 70 ms
70,956 KB
testcase_12 AC 69 ms
71,096 KB
testcase_13 AC 67 ms
71,092 KB
testcase_14 AC 68 ms
70,880 KB
testcase_15 AC 68 ms
70,952 KB
testcase_16 AC 71 ms
71,104 KB
testcase_17 AC 70 ms
71,116 KB
testcase_18 AC 70 ms
71,100 KB
testcase_19 AC 69 ms
71,056 KB
testcase_20 AC 70 ms
70,956 KB
testcase_21 AC 71 ms
71,064 KB
testcase_22 AC 70 ms
71,116 KB
testcase_23 AC 69 ms
71,120 KB
testcase_24 AC 68 ms
70,976 KB
testcase_25 AC 69 ms
71,036 KB
testcase_26 AC 68 ms
71,116 KB
testcase_27 AC 69 ms
70,944 KB
testcase_28 AC 69 ms
70,804 KB
testcase_29 AC 70 ms
70,992 KB
testcase_30 AC 71 ms
71,044 KB
testcase_31 AC 71 ms
71,168 KB
testcase_32 AC 70 ms
71,092 KB
testcase_33 AC 70 ms
70,996 KB
testcase_34 AC 70 ms
71,092 KB
testcase_35 AC 70 ms
71,000 KB
testcase_36 AC 69 ms
71,192 KB
testcase_37 AC 70 ms
70,948 KB
testcase_38 AC 72 ms
71,124 KB
testcase_39 AC 69 ms
71,092 KB
testcase_40 AC 68 ms
70,988 KB
testcase_41 AC 68 ms
71,092 KB
testcase_42 AC 69 ms
71,040 KB
testcase_43 AC 69 ms
71,032 KB
testcase_44 AC 70 ms
71,036 KB
testcase_45 AC 70 ms
70,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = list(map(int, input().split()))
t = 0
for i in range(n):
    t |= 1 << x[i]
def loop(i, acc):
    def check(o):
        return (t & (1 << ((i + o) % 12))) == 0
    if i == 12:
        return acc
    if check(1) and check(3) and check(6) and check(8) and check(10):
        acc.append(i)
    return loop(i + 1, acc)
res = loop(0, [])
if len(res) == 1:
    print(res[0])
else:
    print(-1)
0