結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-12 08:17:47 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 5,000 ms |
| + 236µs | |
| コード長 | 218 bytes |
| 記録 | |
| コンパイル時間 | 301 ms |
| コンパイル使用メモリ | 21,544 KB |
| 実行使用メモリ | 15,996 KB |
| 最終ジャッジ日時 | 2026-07-30 05:44:31 |
| 合計ジャッジ時間 | 5,342 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
total = 0
ans = 0
L = int(input())
N = input()
W = list(map(int, input().split()))
W.sort()
for i in W:
total += i
ans += 1
if L < total:
break
if total <= L:
print(ans)
else:
print(ans - 1)