結果

問題 No.1594 Three Classes
ユーザー trineutrontrineutron
提出日時 2021-07-09 21:30:36
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 1,600 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 578 ms
コンパイル使用メモリ 10,532 KB
実行使用メモリ 8,248 KB
最終ジャッジ日時 2023-08-10 06:40:53
合計ジャッジ時間 15,744 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,600 ms
8,028 KB
testcase_01 AC 15 ms
8,208 KB
testcase_02 AC 15 ms
8,128 KB
testcase_03 AC 82 ms
8,216 KB
testcase_04 AC 1,413 ms
8,240 KB
testcase_05 AC 1,420 ms
8,052 KB
testcase_06 AC 17 ms
8,088 KB
testcase_07 AC 46 ms
8,080 KB
testcase_08 AC 1,451 ms
8,080 KB
testcase_09 AC 1,580 ms
8,192 KB
testcase_10 AC 1,409 ms
8,212 KB
testcase_11 AC 1,600 ms
8,056 KB
testcase_12 AC 1,460 ms
8,220 KB
testcase_13 AC 16 ms
8,124 KB
testcase_14 AC 229 ms
8,080 KB
testcase_15 AC 186 ms
8,156 KB
testcase_16 AC 100 ms
8,120 KB
testcase_17 AC 68 ms
8,248 KB
testcase_18 AC 16 ms
8,084 KB
testcase_19 AC 19 ms
8,192 KB
testcase_20 AC 26 ms
8,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

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

for g in product(range(3), repeat=n):
    p = [0] * 3
    for i in range(n):
        p[g[i]] += e[i]
    if p[0] == p[1] and p[1] == p[2]:
        print('Yes')
        exit()
print('No')
0