結果

問題 No.1594 Three Classes
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2021-07-09 21:29:16
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 260 ms
使用メモリ 81,476 KB
最終ジャッジ日時 2022-12-17 01:34:52
合計ジャッジ時間 5,207 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 204 ms
81,224 KB
testcase_01 AC 83 ms
75,784 KB
testcase_02 AC 82 ms
75,716 KB
testcase_03 AC 202 ms
81,264 KB
testcase_04 AC 200 ms
81,476 KB
testcase_05 AC 197 ms
81,360 KB
testcase_06 AC 206 ms
81,428 KB
testcase_07 AC 201 ms
81,340 KB
testcase_08 AC 199 ms
80,928 KB
testcase_09 AC 199 ms
80,936 KB
testcase_10 AC 198 ms
81,040 KB
testcase_11 AC 198 ms
81,224 KB
testcase_12 AC 198 ms
81,284 KB
testcase_13 AC 99 ms
80,796 KB
testcase_14 AC 211 ms
81,360 KB
testcase_15 AC 206 ms
81,372 KB
testcase_16 AC 138 ms
81,012 KB
testcase_17 AC 200 ms
81,392 KB
testcase_18 AC 89 ms
80,764 KB
testcase_19 AC 95 ms
80,824 KB
testcase_20 AC 106 ms
80,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
e=list(map(int,input().split()))
ans="No"
for bit in range(3**n):
    a=0
    b=0
    c=0

    for i in range(n):
        if bit%3==0:a+=e[i]
        elif bit%3==1:b+=e[i]
        else:c+=e[i]
        bit//=3
    if a==b==c:ans="Yes"

print(ans)

0