結果

問題 No.1594 Three Classes
ユーザー ronpooronpoo
提出日時 2023-09-25 16:49:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 77,208 KB
最終ジャッジ日時 2023-09-25 16:49:42
合計ジャッジ時間 4,131 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
77,188 KB
testcase_01 AC 75 ms
71,340 KB
testcase_02 AC 84 ms
71,360 KB
testcase_03 AC 82 ms
76,720 KB
testcase_04 AC 138 ms
77,196 KB
testcase_05 AC 136 ms
77,104 KB
testcase_06 AC 80 ms
76,668 KB
testcase_07 AC 79 ms
76,852 KB
testcase_08 AC 137 ms
77,064 KB
testcase_09 AC 137 ms
76,944 KB
testcase_10 AC 138 ms
77,176 KB
testcase_11 AC 148 ms
77,188 KB
testcase_12 AC 135 ms
77,208 KB
testcase_13 AC 73 ms
71,504 KB
testcase_14 AC 88 ms
76,968 KB
testcase_15 AC 86 ms
76,964 KB
testcase_16 AC 83 ms
76,696 KB
testcase_17 AC 83 ms
76,856 KB
testcase_18 AC 72 ms
71,376 KB
testcase_19 AC 81 ms
76,840 KB
testcase_20 AC 81 ms
76,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

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

for comb in product(range(3),repeat=N):
    a = [0] * 3
    for x in range(N):
        a[comb[x]] += E[x]
    if a[0] == a[1] == a[2]:
        print('Yes')
        exit()
print('No')
0