結果

問題 No.1594 Three Classes
ユーザー nehan_der_thalnehan_der_thal
提出日時 2021-07-09 21:57:10
言語 PyPy3
(7.9.16)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 290 ms
実行使用メモリ 81,292 KB
最終ジャッジ日時 2022-12-17 01:59:49
合計ジャッジ時間 3,920 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
81,292 KB
testcase_01 AC 87 ms
75,764 KB
testcase_02 AC 86 ms
75,716 KB
testcase_03 AC 94 ms
80,948 KB
testcase_04 AC 142 ms
81,216 KB
testcase_05 AC 140 ms
81,128 KB
testcase_06 AC 97 ms
80,892 KB
testcase_07 AC 97 ms
80,656 KB
testcase_08 AC 140 ms
81,264 KB
testcase_09 AC 138 ms
80,876 KB
testcase_10 AC 137 ms
80,972 KB
testcase_11 AC 139 ms
81,096 KB
testcase_12 AC 140 ms
80,932 KB
testcase_13 AC 90 ms
75,840 KB
testcase_14 AC 107 ms
81,272 KB
testcase_15 AC 101 ms
80,852 KB
testcase_16 AC 97 ms
80,704 KB
testcase_17 AC 98 ms
80,708 KB
testcase_18 AC 88 ms
75,456 KB
testcase_19 AC 96 ms
80,624 KB
testcase_20 AC 92 ms
80,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, = map(int, input().split())
E = list(map(int, input().split()))
for s in range(3**N):
    A = [0]*3
    for i in range(N):
        s, m = divmod(s, 3)
        A[m] += E[i]
    if A[0] == A[1] and A[1] == A[2]:
        print("Yes")
        import sys
        sys.exit()
print("No")

0