結果

問題 No.1594 Three Classes
ユーザー brthyyjpbrthyyjp
提出日時 2021-07-09 21:28:34
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 595 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 77,400 KB
最終ジャッジ日時 2023-08-10 06:38:01
合計ジャッジ時間 3,766 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
77,108 KB
testcase_01 AC 70 ms
71,468 KB
testcase_02 AC 70 ms
71,580 KB
testcase_03 AC 79 ms
76,384 KB
testcase_04 AC 134 ms
77,040 KB
testcase_05 AC 128 ms
77,076 KB
testcase_06 AC 72 ms
76,756 KB
testcase_07 AC 71 ms
76,776 KB
testcase_08 AC 123 ms
76,964 KB
testcase_09 AC 122 ms
77,032 KB
testcase_10 AC 124 ms
76,908 KB
testcase_11 AC 124 ms
77,184 KB
testcase_12 AC 125 ms
77,400 KB
testcase_13 AC 67 ms
71,516 KB
testcase_14 AC 79 ms
77,080 KB
testcase_15 AC 79 ms
76,952 KB
testcase_16 AC 75 ms
76,576 KB
testcase_17 AC 72 ms
76,680 KB
testcase_18 AC 66 ms
71,228 KB
testcase_19 AC 71 ms
76,728 KB
testcase_20 AC 73 ms
76,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import itertools
for p in itertools.product(range(3), repeat=n):
    X = [0]*3
    for i in range(n):
        X[p[i]] += E[i]
    if X[0] == X[1] and X[1] == X[2]:
        print('Yes')
        exit()
else:
    print('No')
0