結果
| 問題 |
No.10 +か×か
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-30 01:06:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 352 bytes |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 82,600 KB |
| 実行使用メモリ | 84,856 KB |
| 最終ジャッジ日時 | 2024-09-21 00:45:53 |
| 合計ジャッジ時間 | 6,973 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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+"+"))