結果
| 問題 | No.1594 Three Classes |
| コンテスト | |
| ユーザー |
koheijkt
|
| 提出日時 | 2026-05-03 22:20:40 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 106 ms / 2,000 ms |
| コード長 | 328 bytes |
| 記録 | |
| コンパイル時間 | 151 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 80,988 KB |
| 最終ジャッジ日時 | 2026-05-03 22:21:21 |
| 合計ジャッジ時間 | 3,977 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
from itertools import product
N = int(input())
E = list(map(int, input().split()))
sumE = sum(E)
if sumE%3 != 0:
exit(print('No'))
for pat in product([0, 1, 2], repeat=N):
total = [0]*3
for i in range(N):
total[pat[i]] += E[i]
if total[0] == total[1] == total[2]:
exit(print('Yes'))
print('No')
koheijkt