結果

問題 No.1109 調の判定
ユーザー keijakkeijak
提出日時 2020-07-10 21:27:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 549 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,584 KB
最終ジャッジ日時 2024-04-19 15:38:12
合計ジャッジ時間 24,195 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 462 ms
44,216 KB
testcase_01 AC 464 ms
44,460 KB
testcase_02 AC 460 ms
44,464 KB
testcase_03 AC 459 ms
44,432 KB
testcase_04 AC 459 ms
43,952 KB
testcase_05 AC 454 ms
44,204 KB
testcase_06 AC 474 ms
43,944 KB
testcase_07 AC 472 ms
44,080 KB
testcase_08 AC 467 ms
43,820 KB
testcase_09 AC 459 ms
44,336 KB
testcase_10 AC 464 ms
44,200 KB
testcase_11 AC 466 ms
44,340 KB
testcase_12 AC 471 ms
44,460 KB
testcase_13 AC 465 ms
44,332 KB
testcase_14 AC 467 ms
44,584 KB
testcase_15 AC 465 ms
43,944 KB
testcase_16 AC 467 ms
44,328 KB
testcase_17 AC 460 ms
44,340 KB
testcase_18 AC 475 ms
44,328 KB
testcase_19 AC 463 ms
44,076 KB
testcase_20 AC 456 ms
43,824 KB
testcase_21 AC 466 ms
44,332 KB
testcase_22 AC 469 ms
44,084 KB
testcase_23 AC 457 ms
44,336 KB
testcase_24 AC 508 ms
44,212 KB
testcase_25 AC 549 ms
44,332 KB
testcase_26 AC 530 ms
43,816 KB
testcase_27 AC 465 ms
43,824 KB
testcase_28 AC 468 ms
44,212 KB
testcase_29 AC 460 ms
44,200 KB
testcase_30 AC 459 ms
44,080 KB
testcase_31 AC 461 ms
44,332 KB
testcase_32 AC 460 ms
44,348 KB
testcase_33 AC 458 ms
43,948 KB
testcase_34 AC 458 ms
43,944 KB
testcase_35 AC 464 ms
44,208 KB
testcase_36 AC 458 ms
44,072 KB
testcase_37 AC 461 ms
44,072 KB
testcase_38 AC 456 ms
44,332 KB
testcase_39 AC 457 ms
44,332 KB
testcase_40 AC 466 ms
44,332 KB
testcase_41 AC 455 ms
43,952 KB
testcase_42 AC 449 ms
44,336 KB
testcase_43 AC 453 ms
44,332 KB
testcase_44 AC 458 ms
44,328 KB
testcase_45 AC 451 ms
44,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import numpy as np

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N = ini()
T = set(inl())
M = 12


def solve():
    ans = set()
    for d in range(12):
        s = {(d + i) % 12 for i in [0, 2, 4, 5, 7, 9, 11]}
        if T.issubset(s):
            ans.add(d)
    if len(ans) == 1:
        return list(ans)[0]
    return -1


print(solve())
0