結果

問題 No.1594 Three Classes
ユーザー Taichi FujiiTaichi Fujii
提出日時 2021-07-09 22:48:17
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 274 ms
使用メモリ 81,412 KB
最終ジャッジ日時 2022-12-17 02:07:26
合計ジャッジ時間 4,973 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 145 ms
81,268 KB
testcase_01 AC 81 ms
75,848 KB
testcase_02 AC 79 ms
75,756 KB
testcase_03 AC 89 ms
80,984 KB
testcase_04 AC 140 ms
81,236 KB
testcase_05 AC 140 ms
81,352 KB
testcase_06 AC 84 ms
80,996 KB
testcase_07 AC 86 ms
80,788 KB
testcase_08 AC 141 ms
81,168 KB
testcase_09 AC 139 ms
81,124 KB
testcase_10 AC 143 ms
81,272 KB
testcase_11 AC 141 ms
81,280 KB
testcase_12 AC 140 ms
81,188 KB
testcase_13 AC 80 ms
75,892 KB
testcase_14 AC 94 ms
81,004 KB
testcase_15 AC 92 ms
81,412 KB
testcase_16 AC 88 ms
80,788 KB
testcase_17 AC 88 ms
81,016 KB
testcase_18 AC 79 ms
75,780 KB
testcase_19 AC 87 ms
80,984 KB
testcase_20 AC 86 ms
80,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# author:  Taichicchi
# created: 09.07.2021 22:44:22

import sys
from itertools import product

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

for p in product(range(3), repeat=N):
    P = [0] * 3
    for i in range(N):
        P[p[i]] += E[i]

    if P[0] == P[1] == P[2]:
        print("Yes")
        exit()

print("No")
0