結果
問題 |
No.10 +か×か
|
ユーザー |
|
提出日時 | 2022-11-28 09:08:33 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 932 bytes |
コンパイル時間 | 256 ms |
コンパイル使用メモリ | 82,184 KB |
実行使用メモリ | 223,612 KB |
最終ジャッジ日時 | 2024-10-05 05:40:01 |
合計ジャッジ時間 | 12,369 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 4 TLE * 1 |
ソースコード
# 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())) X = defaultdict(int) M = 10**5+5 called = [0]*M called[A[0]]=1 for i in range(N-1): target = [] for j in range(M): if called[j]==i+1: target.append((X[j],j)) target.sort() n = len(target) a = A[i+1] for x,j in target: if j+a<M: if called[j+a]==i+2: continue called[j+a]=i+2 X[j+a] = x if j*a<M: if called[j*a]==i+2: continue called[j*a]=i+2 X[j*a] = x + (1<<N-2-i) def f(x): if x=='0': return '+' else: return '*' print(''.join(map(f,list(bin(X[T])[2:].zfill(N-1)))))