結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
koyopro
|
| 提出日時 | 2015-09-20 03:36:32 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 5,000 ms |
| コード長 | 257 bytes |
| コンパイル時間 | 348 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 7,168 KB |
| 最終ジャッジ日時 | 2024-11-18 07:35:41 |
| 合計ジャッジ時間 | 1,166 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
# -*- coding: utf-8 -*-
l, = map(int, raw_input().split())
n, = map(int, raw_input().split())
w = map(int, raw_input().split())
w = sorted(w)
s = 0
cnt = 0
for v in w:
if v + s <= l:
cnt += 1
s += v
else:
break
print cnt
koyopro