結果

問題 No.1594 Three Classes
ユーザー roarisroaris
提出日時 2021-07-19 08:15:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,156 KB
実行使用メモリ 76,068 KB
最終ジャッジ日時 2024-04-28 00:41:21
合計ジャッジ時間 2,937 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
75,800 KB
testcase_01 AC 34 ms
52,828 KB
testcase_02 AC 33 ms
53,440 KB
testcase_03 AC 46 ms
61,896 KB
testcase_04 AC 144 ms
75,616 KB
testcase_05 AC 145 ms
75,648 KB
testcase_06 AC 45 ms
63,004 KB
testcase_07 AC 48 ms
63,364 KB
testcase_08 AC 145 ms
75,720 KB
testcase_09 AC 144 ms
75,668 KB
testcase_10 AC 141 ms
76,068 KB
testcase_11 AC 141 ms
75,972 KB
testcase_12 AC 145 ms
75,468 KB
testcase_13 AC 34 ms
52,808 KB
testcase_14 AC 61 ms
66,756 KB
testcase_15 AC 55 ms
65,204 KB
testcase_16 AC 48 ms
63,212 KB
testcase_17 AC 46 ms
63,200 KB
testcase_18 AC 33 ms
52,024 KB
testcase_19 AC 42 ms
61,884 KB
testcase_20 AC 43 ms
62,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for S in range(3**N):
    t = S
    a, b, c = 0, 0, 0
    
    for i in range(N):
        if t%3==0:
            a += E[i]
        elif t%3==1:
            b += E[i]
        else:
            c += E[i]
            
        t //= 3
    
    if a==b==c:
        exit(print('Yes'))

print('No')
0