結果
| 問題 | No.10 +か×か |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-16 01:08:33 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 65 ms |
| コンパイル使用メモリ | 80,560 KB |
| 実行使用メモリ | 1,337,744 KB |
| 最終ジャッジ日時 | 2026-07-17 12:57:08 |
| 合計ジャッジ時間 | 8,705 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 MLE * 2 -- * 8 |
ソースコード
N = int(raw_input())
T = int(raw_input())
a = map(int, raw_input().split())
dp = set([(a[0],"")])
for ai in a[1:]:
ndp = set([])
for s, e in dp:
if s+ai <= T: ndp.add((s+ai, e+"0"))
if s*ai <= T: ndp.add((s*ai, e+"1"))
dp = ndp
ans = "1"*100
for s, e in dp:
if s == T:
ans = min(ans, e)
print ans.replace("1","*").replace("0","+")