結果
| 問題 | No.10 +か×か |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2020-09-03 08:40:44 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 369 ms |
| コンパイル使用メモリ | 85,700 KB |
| 実行使用メモリ | 53,052 KB |
| 最終ジャッジ日時 | 2026-05-16 19:13:56 |
| 合計ジャッジ時間 | 7,216 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 1 TLE * 1 -- * 9 |
ソースコード
from itertools import product
n = int(input())
tot = int(input())
a = list(map(int, input().split()))
for p in product(range(2), repeat=n-1):
cur = a[0]
for i in range(n - 1):
if p[i]:
cur += a[i + 1]
else:
cur *= a[i + 1]
if cur == tot:
print(''.join('+' if op else '*' for op in p))
break
Kude