結果
問題 |
No.5 数字のブロック
|
ユーザー |
|
提出日時 | 2022-06-06 13:01:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 334 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 18,208 KB |
最終ジャッジ日時 | 2024-09-21 04:36:25 |
合計ジャッジ時間 | 6,785 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 RE * 1 TLE * 1 -- * 30 |
ソースコード
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)