結果
| 問題 | No.10 +か×か |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-27 14:48:25 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 559 bytes |
| 記録 | |
| コンパイル時間 | 1,179 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 1,311,836 KB |
| 最終ジャッジ日時 | 2026-03-23 19:21:21 |
| 合計ジャッジ時間 | 4,161 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 MLE * 2 -- * 8 |
ソースコード
def main():
""" main """
N = int(input())
TOTAL = int(input())
AS = list(map(int, input().split()))
# 演算子文字列, result
q = [('', AS[0])]
for optstr, total in q:
if len(optstr) == N-1 and total == TOTAL:
print(optstr)
break
elif len(optstr) == N-1:
continue
cur_a = AS[len(optstr)+1]
if total+cur_a <= TOTAL:
q.append((optstr + '+', total+cur_a))
if total*cur_a <= TOTAL:
q.append((optstr + '*', total*cur_a))
main()