結果
問題 | No.5 数字のブロック |
ユーザー |
|
提出日時 | 2017-03-04 13:55:33 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 16 ms / 5,000 ms |
コード長 | 182 bytes |
コンパイル時間 | 59 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 7,040 KB |
最終ジャッジ日時 | 2024-11-18 10:55:27 |
合計ジャッジ時間 | 1,289 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
ソースコード
L=int(raw_input()) N=int(raw_input()) W=map(int,raw_input().split()) Wsort=sorted(W) Wsum=0 for i in xrange(N): Wsum+=Wsort[i] if Wsum>L: print i break if L>=sum(W): print N