結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-06 13:01:57 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 334 bytes |
| 記録 | |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 21,764 KB |
| 最終ジャッジ日時 | 2026-04-09 11:55:10 |
| 合計ジャッジ時間 | 16,731 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 RE * 1 TLE * 2 -- * 28 |
ソースコード
L = int(input())
N = int(input())
W = list(map(int,input().split()))
for i in range(N):
for j in range(N):
if W[j] >= W[i]:
tmp = W[j]
W[j] = W[i]
W[i] = tmp
sum_wide = 0
ans = 0
while True:
if sum_wide + W[ans] > L:
break
sum_wide += W[ans]
ans += 1
print(ans)