結果

問題 No.1594 Three Classes
ユーザー 👑 KazunKazun
提出日時 2021-07-09 21:25:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 967 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 77,288 KB
最終ジャッジ日時 2023-08-10 06:35:06
合計ジャッジ時間 4,011 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
76,936 KB
testcase_01 AC 70 ms
71,060 KB
testcase_02 AC 66 ms
71,300 KB
testcase_03 AC 132 ms
77,056 KB
testcase_04 AC 130 ms
76,880 KB
testcase_05 AC 130 ms
76,856 KB
testcase_06 AC 137 ms
77,012 KB
testcase_07 AC 134 ms
77,040 KB
testcase_08 AC 135 ms
77,068 KB
testcase_09 AC 130 ms
77,136 KB
testcase_10 AC 131 ms
76,976 KB
testcase_11 AC 132 ms
76,864 KB
testcase_12 AC 132 ms
76,936 KB
testcase_13 AC 73 ms
76,600 KB
testcase_14 AC 133 ms
77,288 KB
testcase_15 AC 134 ms
76,928 KB
testcase_16 AC 97 ms
77,084 KB
testcase_17 AC 133 ms
77,080 KB
testcase_18 AC 75 ms
76,384 KB
testcase_19 AC 77 ms
76,492 KB
testcase_20 AC 78 ms
76,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

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

X=0
for c in product((0,1,2),repeat=N):
    P=[0,0,0]

    for i in range(N):
        P[c[i]]+=E[i]

    if P[0]==P[1]==P[2]:
        X=1

print("Yes" if X else "No")
0