結果

問題 No.1594 Three Classes
ユーザー OhnoHirokiOhnoHiroki
提出日時 2024-02-27 22:10:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 327 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2024-02-27 22:11:14
合計ジャッジ時間 39,790 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 29 ms
9,984 KB
testcase_02 AC 29 ms
9,984 KB
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 AC 31 ms
9,984 KB
testcase_14 TLE -
testcase_15 TLE -
testcase_16 AC 760 ms
9,984 KB
testcase_17 TLE -
testcase_18 AC 30 ms
9,984 KB
testcase_19 AC 36 ms
9,984 KB
testcase_20 AC 98 ms
9,984 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