結果
問題 | No.10 +か×か |
ユーザー | dango |
提出日時 | 2023-06-19 21:55:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,237 ms / 5,000 ms |
コード長 | 303 bytes |
コンパイル時間 | 1,333 ms |
コンパイル使用メモリ | 86,864 KB |
実行使用メモリ | 292,072 KB |
最終ジャッジ日時 | 2023-09-09 17:05:08 |
合計ジャッジ時間 | 5,182 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 71 ms
71,244 KB |
testcase_01 | AC | 71 ms
71,244 KB |
testcase_02 | AC | 72 ms
71,336 KB |
testcase_03 | AC | 1,237 ms
292,072 KB |
testcase_04 | AC | 154 ms
76,296 KB |
testcase_05 | AC | 72 ms
71,248 KB |
testcase_06 | AC | 1,194 ms
291,092 KB |
testcase_07 | AC | 351 ms
179,152 KB |
testcase_08 | AC | 121 ms
88,572 KB |
testcase_09 | AC | 101 ms
84,248 KB |
testcase_10 | AC | 72 ms
71,192 KB |
testcase_11 | AC | 71 ms
71,164 KB |
ソースコード
N = int(input()) T = int(input()) A = list(map(int, input().split())) D = {A[0]: ""} for i in range(1, N): E = {} for K, V in D.items(): for L, W in[(K + A[i], V + "+"), (K * A[i], V + "*")]: if L <= T and(L not in E or E[L] < W): E[L] = W D = E print([-1, D[T]][T in D])