結果

問題 No.1594 Three Classes
ユーザー tobusakanatobusakana
提出日時 2021-07-10 08:26:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 246 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 82,568 KB
実行使用メモリ 76,056 KB
最終ジャッジ日時 2024-04-28 00:36:01
合計ジャッジ時間 2,101 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
75,564 KB
testcase_01 AC 39 ms
52,628 KB
testcase_02 AC 37 ms
52,068 KB
testcase_03 AC 44 ms
60,664 KB
testcase_04 AC 86 ms
75,976 KB
testcase_05 AC 84 ms
75,636 KB
testcase_06 AC 41 ms
61,132 KB
testcase_07 AC 41 ms
62,708 KB
testcase_08 AC 90 ms
75,584 KB
testcase_09 AC 90 ms
75,692 KB
testcase_10 AC 90 ms
75,516 KB
testcase_11 AC 87 ms
75,612 KB
testcase_12 AC 83 ms
76,056 KB
testcase_13 AC 36 ms
52,568 KB
testcase_14 AC 51 ms
74,060 KB
testcase_15 AC 46 ms
68,456 KB
testcase_16 AC 43 ms
64,936 KB
testcase_17 AC 42 ms
62,904 KB
testcase_18 AC 36 ms
52,072 KB
testcase_19 AC 41 ms
60,960 KB
testcase_20 AC 40 ms
61,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import itertools
for i in range(3 ** N):
  pat = [0] * 3
  for j in range(N):
    pat[i % 3] += E[j]
    i //= 3
  if pat[0] == pat[1] == pat[2]:
    print("Yes")
    break
else:
  print("No")
0