結果
| 問題 |
No.10 +か×か
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-30 01:09:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 352 bytes |
| コンパイル時間 | 199 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 82,944 KB |
| 最終ジャッジ日時 | 2024-09-21 00:46:00 |
| 合計ジャッジ時間 | 6,814 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 1 TLE * 1 -- * 7 |
ソースコード
N = int(input())
total = int(input())
A = list(map(int,input().split()))
stack = [(N-1,total,"")]
while stack:
i,v,s = stack.pop()
if i == 0:
if v == A[i]:
print(s)
break
continue
if v % A[i] == 0:
stack.append((i-1,v//A[i],"*"+s))
if A[i] <= v:
stack.append((i-1,v-A[i],"+"+s))