結果

問題 No.1594 Three Classes
ユーザー OhnoHirokiOhnoHiroki
提出日時 2024-02-27 22:10:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 678 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,516 KB
最終ジャッジ日時 2024-02-27 22:10:58
合計ジャッジ時間 4,111 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
75,432 KB
testcase_01 AC 37 ms
53,588 KB
testcase_02 AC 35 ms
53,588 KB
testcase_03 AC 165 ms
75,496 KB
testcase_04 AC 158 ms
75,304 KB
testcase_05 AC 157 ms
75,304 KB
testcase_06 AC 159 ms
75,516 KB
testcase_07 AC 157 ms
75,496 KB
testcase_08 AC 157 ms
75,304 KB
testcase_09 AC 157 ms
75,304 KB
testcase_10 AC 157 ms
75,304 KB
testcase_11 AC 156 ms
75,432 KB
testcase_12 AC 156 ms
75,304 KB
testcase_13 AC 44 ms
62,236 KB
testcase_14 AC 157 ms
75,488 KB
testcase_15 AC 160 ms
75,492 KB
testcase_16 AC 86 ms
72,544 KB
testcase_17 AC 157 ms
75,488 KB
testcase_18 AC 40 ms
60,016 KB
testcase_19 AC 45 ms
62,232 KB
testcase_20 AC 57 ms
66,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
E = list(map(int, input().split()))

ans = "No"
for i in range(3**N):
    pa,pb,pc = 0,0,0
    for j in range(N):
        if i%3 == 0:
            pa += E[j]
        elif i%3 == 1:
            pb += E[j]
        else:
            pc += E[j]
        i //= 3
    if pa == pb == pc:
        ans = "Yes"
print(ans)
0