結果
| 問題 | No.617 Nafmo、買い出しに行く |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-19 17:32:12 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
RE
不安定
|
| 実行時間 | - |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 329 ms |
| コンパイル使用メモリ | 21,340 KB |
| 実行使用メモリ | 36,468 KB |
| 最終ジャッジ日時 | 2026-09-03 22:49:38 |
| 合計ジャッジ時間 | 10,691 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 RE * 4 |
ソースコード
import itertools as it
n, mx = map(int, input().split())
seq = []
for i in range(n):
inp = int(input())
seq.append(inp)
sm = set()
for i in range(n):
for j in it.combinations(seq,i+1):
ans = sum(list(j))
sm.add(ans)
if mx in sm:
print(mx)
else:
ls = [i for i in sm if i < mx]
print(max(ls))