結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2020-05-03 21:22:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 238 bytes |
コンパイル時間 | 740 ms |
コンパイル使用メモリ | 82,332 KB |
実行使用メモリ | 62,092 KB |
最終ジャッジ日時 | 2024-06-23 01:20:37 |
合計ジャッジ時間 | 2,665 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 34 |
ソースコード
import sys input = sys.stdin.buffer.readline L = int(input()) N = int(input()) Ws = sorted(list(map(int, input().split()))) print(Ws) s = 0 cnt = 0 while s < L and cnt < N: s += Ws[cnt] cnt += 1 print(cnt if s == L else cnt - 1)