結果

問題 No.1594 Three Classes
ユーザー hirakuhiraku
提出日時 2021-07-10 09:09:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,506 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 86,628 KB
最終ジャッジ日時 2024-04-28 00:36:52
合計ジャッジ時間 15,647 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,480 ms
86,240 KB
testcase_01 AC 34 ms
52,096 KB
testcase_02 AC 32 ms
52,224 KB
testcase_03 AC 164 ms
77,056 KB
testcase_04 AC 1,479 ms
86,496 KB
testcase_05 AC 1,493 ms
86,628 KB
testcase_06 AC 63 ms
66,972 KB
testcase_07 AC 148 ms
76,800 KB
testcase_08 AC 1,456 ms
86,244 KB
testcase_09 AC 1,458 ms
86,240 KB
testcase_10 AC 1,430 ms
86,108 KB
testcase_11 AC 1,466 ms
86,500 KB
testcase_12 AC 1,506 ms
86,376 KB
testcase_13 AC 38 ms
52,096 KB
testcase_14 AC 272 ms
76,772 KB
testcase_15 AC 242 ms
77,032 KB
testcase_16 AC 172 ms
76,928 KB
testcase_17 AC 161 ms
76,740 KB
testcase_18 AC 35 ms
52,096 KB
testcase_19 AC 145 ms
77,144 KB
testcase_20 AC 135 ms
76,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

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

ptn = product(range(3), repeat=n)

for p in ptn:
  A = sum(E[i] for i, g in enumerate(p) if g == 0)
  B = sum(E[i] for i, g in enumerate(p) if g == 1)
  C = sum(E[i] for i, g in enumerate(p) if g == 2)
  if A == B == C:
    print("Yes")
    exit()
print("No")
0