結果

問題 No.10 +か×か
ユーザー nishigakenishigake
提出日時 2022-05-30 01:06:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 352 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 81,632 KB
最終ジャッジ日時 2023-10-21 00:16:04
合計ジャッジ時間 7,314 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,436 KB
testcase_01 AC 34 ms
53,436 KB
testcase_02 AC 37 ms
53,436 KB
testcase_03 WA -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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+"+"))

0