結果

問題 No.1109 調の判定
ユーザー 双六双六
提出日時 2020-09-07 01:32:17
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 71,432 KB
最終ジャッジ日時 2023-08-19 14:37:07
合計ジャッジ時間 5,932 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,348 KB
testcase_01 AC 87 ms
71,144 KB
testcase_02 AC 87 ms
71,372 KB
testcase_03 AC 92 ms
71,140 KB
testcase_04 AC 88 ms
71,328 KB
testcase_05 AC 88 ms
71,332 KB
testcase_06 AC 86 ms
71,316 KB
testcase_07 AC 88 ms
70,932 KB
testcase_08 AC 87 ms
71,320 KB
testcase_09 AC 87 ms
71,204 KB
testcase_10 AC 87 ms
71,328 KB
testcase_11 AC 86 ms
71,376 KB
testcase_12 AC 87 ms
71,084 KB
testcase_13 AC 87 ms
71,380 KB
testcase_14 AC 88 ms
71,324 KB
testcase_15 AC 86 ms
71,432 KB
testcase_16 AC 88 ms
71,324 KB
testcase_17 AC 88 ms
71,324 KB
testcase_18 AC 87 ms
71,200 KB
testcase_19 AC 88 ms
71,172 KB
testcase_20 AC 88 ms
71,196 KB
testcase_21 AC 88 ms
70,932 KB
testcase_22 AC 90 ms
70,928 KB
testcase_23 AC 90 ms
71,328 KB
testcase_24 AC 88 ms
71,332 KB
testcase_25 AC 89 ms
71,332 KB
testcase_26 AC 91 ms
71,244 KB
testcase_27 AC 89 ms
71,284 KB
testcase_28 AC 87 ms
71,172 KB
testcase_29 AC 88 ms
71,128 KB
testcase_30 AC 89 ms
71,148 KB
testcase_31 AC 87 ms
71,192 KB
testcase_32 AC 86 ms
71,220 KB
testcase_33 AC 87 ms
71,336 KB
testcase_34 AC 86 ms
71,384 KB
testcase_35 AC 88 ms
71,424 KB
testcase_36 AC 87 ms
71,124 KB
testcase_37 AC 88 ms
71,324 KB
testcase_38 AC 88 ms
71,324 KB
testcase_39 AC 88 ms
71,384 KB
testcase_40 AC 88 ms
71,376 KB
testcase_41 AC 86 ms
71,408 KB
testcase_42 AC 85 ms
71,196 KB
testcase_43 AC 87 ms
71,324 KB
testcase_44 AC 88 ms
71,328 KB
testcase_45 AC 87 ms
71,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	T = getlist()
	L = [0, 2, 4, 5, 7, 9, 11]
	D = -1
	for d in range(12):
		jud = 1
		for i in T:
			if not ((d + i) % 12 in L):
				jud = 0
				break

		if jud == 1:
			# print(d)
			if D == -1:
				D = (12 - d) % 12
			else:
				print(-1)
				return

	if D == -1:
		print(-1)
	else:
		print(D)

if __name__ == '__main__':
	main()
0