結果
| 問題 | No.10 +か×か |
| コンテスト | |
| ユーザー |
miztom
|
| 提出日時 | 2024-03-12 16:09:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 2,221 ms / 5,000 ms |
| コード長 | 307 bytes |
| 記録 | |
| コンパイル時間 | 189 ms |
| コンパイル使用メモリ | 82,324 KB |
| 実行使用メモリ | 330,968 KB |
| 最終ジャッジ日時 | 2025-12-06 15:03:44 |
| 合計ジャッジ時間 | 6,822 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
from collections import*
n=int(input())
t=int(input())
a=map(int,input().split())
d=defaultdict(lambda:" "*n)
d[next(a)]=""
for i in a:
e=defaultdict(lambda:" "*n)
for j in d:
if(p:=j+i)<=t:e[p]=max(e[p],d[j]+"+")
if(p:=j*i)<=t:e[p]=max(e[p],d[j]+"*")
del d;d=e;del e
print(d[t])
miztom