結果

問題 No.10 +か×か
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-11-28 08:52:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 732 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,516 KB
実行使用メモリ 253,688 KB
最終ジャッジ日時 2024-04-15 10:44:13
合計ジャッジ時間 5,575 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
from collections import *
from functools import *
from itertools import *
from heapq import *
import sys,math

input = sys.stdin.readline

N = int(input())
T = int(input())
A = list(map(int,input().split()))

val = [False]*(100005)
X = defaultdict(lambda:'')
M = 10**5+5
val[A[0]]=True
for i in range(N-1):
    called = [False]*(10**5+5)
    a = A[i+1]
    for j in range(M-1-a,-1,-1):
        if val[j]:
            val[j+a]=True
            called[j+a]=True
            X[j+a] = X[j]+'+'
    
    for j in range(M-1,-1,-1):
        if called[j]:
            continue
        if j*a>=M:
            continue
        val[j*a]=True
        X[j*a] = X[j]+'*'
print(X[T])
0