結果
| 問題 |
No.1594 Three Classes
|
| コンテスト | |
| ユーザー |
Rute
|
| 提出日時 | 2021-07-09 21:24:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 576 bytes |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 24,520 KB |
| 最終ジャッジ日時 | 2024-07-01 15:01:42 |
| 合計ジャッジ時間 | 6,466 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 17 |
ソースコード
N = int(input())
E = list(map(int,input().split()))
#3bit全探索
def base10int(value, base):
if (int(value / base)):
return base10int(int(value / base), base) + str(value % base)
return str(value % base)
f = 0
for i in range(3 ** N):
now = base10int(i,3).zfill(N)
A = 0
B = 0
C = 0
for j in range(N):
if now[j] == "0":
A += E[j]
elif now[j] == "1":
B += E[j]
else:
C += E[j]
if A == B and B == C and A == C:
f += 1
if f > 0:
print("Yes")
else:
print("No")
Rute