結果
問題 | No.10 +か×か |
ユーザー | titia |
提出日時 | 2021-11-02 01:48:26 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 851 bytes |
コンパイル時間 | 736 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 847,936 KB |
最終ジャッジ日時 | 2024-04-19 04:37:38 |
合計ジャッジ時間 | 4,733 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 43 ms
52,204 KB |
testcase_01 | AC | 42 ms
52,468 KB |
testcase_02 | AC | 40 ms
53,688 KB |
testcase_03 | MLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
ソースコード
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()