結果

問題 No.1594 Three Classes
ユーザー tktk_snsntktk_snsn
提出日時 2021-07-09 21:28:04
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 1,715 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 614 ms
使用メモリ 7,756 KB
最終ジャッジ日時 2022-12-17 01:33:34
合計ジャッジ時間 17,762 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1,674 ms
7,552 KB
testcase_01 AC 16 ms
7,548 KB
testcase_02 AC 16 ms
7,740 KB
testcase_03 AC 88 ms
7,676 KB
testcase_04 AC 1,647 ms
7,704 KB
testcase_05 AC 1,702 ms
7,708 KB
testcase_06 AC 17 ms
7,656 KB
testcase_07 AC 52 ms
7,552 KB
testcase_08 AC 1,651 ms
7,756 KB
testcase_09 AC 1,614 ms
7,544 KB
testcase_10 AC 1,653 ms
7,704 KB
testcase_11 AC 1,715 ms
7,664 KB
testcase_12 AC 1,619 ms
7,652 KB
testcase_13 AC 16 ms
7,756 KB
testcase_14 AC 232 ms
7,528 KB
testcase_15 AC 218 ms
7,684 KB
testcase_16 AC 104 ms
7,616 KB
testcase_17 AC 78 ms
7,704 KB
testcase_18 AC 16 ms
7,636 KB
testcase_19 AC 21 ms
7,524 KB
testcase_20 AC 27 ms
7,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for pair in product(range(3), repeat=N):
    sum = [0, 0, 0]
    for i, p in enumerate(pair):
        sum[p] += A[i]
    if sum[0] == sum[1] == sum[2]:
        print("Yes")
        exit()
print("No")
0