結果

問題 No.1594 Three Classes
ユーザー TadaTada
提出日時 2021-07-09 21:35:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 587 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 76,160 KB
最終ジャッジ日時 2024-04-28 00:02:17
合計ジャッジ時間 6,986 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 584 ms
75,724 KB
testcase_01 AC 39 ms
51,712 KB
testcase_02 AC 38 ms
51,840 KB
testcase_03 AC 60 ms
62,848 KB
testcase_04 AC 582 ms
75,520 KB
testcase_05 AC 580 ms
75,520 KB
testcase_06 AC 63 ms
62,848 KB
testcase_07 AC 76 ms
63,616 KB
testcase_08 AC 587 ms
75,904 KB
testcase_09 AC 583 ms
75,616 KB
testcase_10 AC 581 ms
76,160 KB
testcase_11 AC 584 ms
75,788 KB
testcase_12 AC 583 ms
75,540 KB
testcase_13 AC 40 ms
51,968 KB
testcase_14 AC 160 ms
67,456 KB
testcase_15 AC 113 ms
65,408 KB
testcase_16 AC 80 ms
64,256 KB
testcase_17 AC 70 ms
63,528 KB
testcase_18 AC 39 ms
51,712 KB
testcase_19 AC 53 ms
63,104 KB
testcase_20 AC 57 ms
62,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


for i in range(3**N):
    s0=0
    s1=0
    s2=0
    for j in range(N):
        if i//3**j%3==0:
            s0+=E[j]
        if i//3**j%3==1:
            s1+=E[j]
        if i//3**j%3==2:
            s2+=E[j]
    #print(s0,s1,s2)
    if s0==s1==s2:
        print("Yes")
        exit()
print("No")
0