結果

問題 No.1594 Three Classes
ユーザー minimumminimum
提出日時 2021-07-09 21:30:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 77,088 KB
最終ジャッジ日時 2023-08-10 06:39:56
合計ジャッジ時間 3,804 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 179 ms
76,816 KB
testcase_01 AC 66 ms
71,412 KB
testcase_02 AC 66 ms
71,376 KB
testcase_03 AC 78 ms
76,692 KB
testcase_04 AC 178 ms
77,088 KB
testcase_05 AC 178 ms
77,012 KB
testcase_06 AC 77 ms
76,552 KB
testcase_07 AC 77 ms
76,580 KB
testcase_08 AC 175 ms
76,736 KB
testcase_09 AC 172 ms
77,000 KB
testcase_10 AC 174 ms
77,088 KB
testcase_11 AC 178 ms
76,816 KB
testcase_12 AC 170 ms
76,996 KB
testcase_13 AC 69 ms
71,580 KB
testcase_14 AC 96 ms
76,784 KB
testcase_15 AC 83 ms
76,576 KB
testcase_16 AC 78 ms
76,752 KB
testcase_17 AC 77 ms
76,592 KB
testcase_18 AC 66 ms
71,252 KB
testcase_19 AC 78 ms
76,624 KB
testcase_20 AC 79 ms
76,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
e = list(map(int, input().split()))

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:
        print("Yes")
        exit()

print("No")
0