結果

問題 No.1594 Three Classes
ユーザー neterukunneterukun
提出日時 2021-07-09 21:29:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 76,864 KB
最終ジャッジ日時 2023-08-10 06:39:01
合計ジャッジ時間 3,313 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
76,764 KB
testcase_01 AC 68 ms
71,672 KB
testcase_02 AC 69 ms
71,304 KB
testcase_03 AC 76 ms
76,308 KB
testcase_04 AC 127 ms
76,572 KB
testcase_05 AC 127 ms
76,740 KB
testcase_06 AC 75 ms
76,356 KB
testcase_07 AC 74 ms
76,360 KB
testcase_08 AC 131 ms
76,772 KB
testcase_09 AC 129 ms
76,864 KB
testcase_10 AC 129 ms
76,776 KB
testcase_11 AC 129 ms
76,856 KB
testcase_12 AC 128 ms
76,596 KB
testcase_13 AC 68 ms
71,172 KB
testcase_14 AC 81 ms
76,828 KB
testcase_15 AC 82 ms
76,776 KB
testcase_16 AC 80 ms
76,328 KB
testcase_17 AC 77 ms
76,556 KB
testcase_18 AC 69 ms
71,640 KB
testcase_19 AC 74 ms
76,360 KB
testcase_20 AC 74 ms
76,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools


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


for ptn in itertools.product((0, 1, 2), repeat=n):
    res = [0] * 3
    for i, j in enumerate(ptn):
        res[j] += e[i]
    if res[0] == res[1] and res[1] == res[2]:
        print("Yes")
        exit()
print("No")
0