結果

問題 No.1594 Three Classes
ユーザー rin204rin204
提出日時 2021-07-09 21:51:57
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 299 ms
使用メモリ 81,512 KB
最終ジャッジ日時 2022-12-17 02:00:11
合計ジャッジ時間 4,476 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 199 ms
81,476 KB
testcase_01 AC 91 ms
75,672 KB
testcase_02 AC 90 ms
75,524 KB
testcase_03 AC 102 ms
80,964 KB
testcase_04 AC 200 ms
81,336 KB
testcase_05 AC 196 ms
81,512 KB
testcase_06 AC 94 ms
81,076 KB
testcase_07 AC 99 ms
80,884 KB
testcase_08 AC 199 ms
81,396 KB
testcase_09 AC 195 ms
81,424 KB
testcase_10 AC 203 ms
81,488 KB
testcase_11 AC 196 ms
81,392 KB
testcase_12 AC 200 ms
81,340 KB
testcase_13 AC 89 ms
75,516 KB
testcase_14 AC 109 ms
81,408 KB
testcase_15 AC 106 ms
81,120 KB
testcase_16 AC 99 ms
80,844 KB
testcase_17 AC 97 ms
80,876 KB
testcase_18 AC 90 ms
75,840 KB
testcase_19 AC 97 ms
80,884 KB
testcase_20 AC 96 ms
80,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n = int(input())
elst = list(map(int, input().split()))

for lst in itertools.product(range(3), repeat = n):
    tot = [0] * 3
    for e, l in zip(elst, lst):
        tot[l] += e
    if tot[0] == tot[1] == tot[2]:
        print("Yes")
        exit()
print("No")
0