結果

問題 No.1594 Three Classes
ユーザー gr1msl3ygr1msl3y
提出日時 2021-11-27 17:28:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 865 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 77,292 KB
最終ジャッジ日時 2023-08-10 07:08:32
合計ジャッジ時間 3,457 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
77,024 KB
testcase_01 AC 71 ms
71,408 KB
testcase_02 AC 68 ms
71,292 KB
testcase_03 AC 78 ms
76,488 KB
testcase_04 AC 131 ms
77,292 KB
testcase_05 AC 131 ms
76,848 KB
testcase_06 AC 75 ms
76,516 KB
testcase_07 AC 75 ms
76,776 KB
testcase_08 AC 135 ms
76,952 KB
testcase_09 AC 136 ms
77,104 KB
testcase_10 AC 131 ms
76,848 KB
testcase_11 AC 132 ms
76,656 KB
testcase_12 AC 133 ms
77,212 KB
testcase_13 AC 69 ms
71,080 KB
testcase_14 AC 83 ms
76,828 KB
testcase_15 AC 83 ms
77,176 KB
testcase_16 AC 77 ms
76,696 KB
testcase_17 AC 76 ms
76,536 KB
testcase_18 AC 67 ms
71,304 KB
testcase_19 AC 75 ms
76,576 KB
testcase_20 AC 75 ms
76,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
N = int(input())
E = list(map(int, input().split()))

for t in product(range(3), repeat=N):
    P = [0]*3
    for i in range(N):
        P[t[i]] += E[i]
    if P[0] == P[1] == P[2]:
        print('Yes')
        break
else:
    print('No')
0