結果

問題 No.1594 Three Classes
ユーザー ShirotsumeShirotsume
提出日時 2021-07-09 21:57:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 77,036 KB
最終ジャッジ日時 2023-08-10 06:51:13
合計ジャッジ時間 3,979 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 178 ms
76,908 KB
testcase_01 AC 66 ms
71,408 KB
testcase_02 AC 68 ms
71,144 KB
testcase_03 AC 78 ms
76,328 KB
testcase_04 AC 178 ms
76,960 KB
testcase_05 AC 181 ms
77,036 KB
testcase_06 AC 80 ms
76,028 KB
testcase_07 AC 82 ms
76,328 KB
testcase_08 AC 182 ms
77,020 KB
testcase_09 AC 182 ms
76,620 KB
testcase_10 AC 175 ms
76,852 KB
testcase_11 AC 189 ms
76,748 KB
testcase_12 AC 184 ms
76,808 KB
testcase_13 AC 69 ms
71,140 KB
testcase_14 AC 99 ms
76,028 KB
testcase_15 AC 87 ms
76,028 KB
testcase_16 AC 82 ms
76,256 KB
testcase_17 AC 83 ms
76,204 KB
testcase_18 AC 70 ms
71,144 KB
testcase_19 AC 81 ms
76,320 KB
testcase_20 AC 79 ms
76,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

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

for i in range(3 ** n):
    a = 0
    b = 0
    c = 0
    for j in range(n):
        if i % 3 == 0:
            a += e[j]
        if i % 3 == 1:
            b += e[j]
        if i % 3 == 2:
            c += e[j]
        i //= 3
    if a == b == c:
        print("Yes")
        exit()

print("No")
0