結果
| 問題 |
No.10 +か×か
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2021-11-02 01:48:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 851 bytes |
| コンパイル時間 | 321 ms |
| コンパイル使用メモリ | 82,312 KB |
| 実行使用メモリ | 848,264 KB |
| 最終ジャッジ日時 | 2024-10-10 21:14:09 |
| 合計ジャッジ時間 | 4,855 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 MLE * 1 -- * 8 |
ソースコード
N=int(input())
T=int(input())
A=list(map(int,input().split()))
last=N//2
ANS=[A[0]]
for i in range(1,last+1):
NANS=[]
for ans in ANS:
NANS.append(ans+A[i])
NANS.append(ans*A[i])
ANS=NANS
ANS2=[T]
for i in range(N-1,last,-1):
NANS2=[]
for ans in ANS2:
NANS2.append(ans-A[i])
if ans%A[i]==0:
NANS2.append(ans//A[i])
else:
NANS2.append(-1)
ANS2=NANS2
SET=set(ANS2)
for i in range(len(ANS)):
if ANS[i] in SET:
for j in range(len(ANS2)):
if ANS[i]==ANS2[j]:
S=bin(i)[2:].zfill(N//2)+bin(j)[2:].zfill(N-N//2-1)
for s in S:
if s=="0":
print("+",end="")
else:
print("*",end="")
exit()
titia