結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
HIROPON87069639
|
| 提出日時 | 2016-02-27 16:58:24 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 5,000 ms |
| コード長 | 200 bytes |
| コンパイル時間 | 58 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 7,296 KB |
| 最終ジャッジ日時 | 2024-11-18 08:17:30 |
| 合計ジャッジ時間 | 1,441 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
# -*- coding: utf-8 -*-
L = input()
N = input()
W = map(int, raw_input().split())
W.sort()
tot = 0
cnt = 0
while tot < L and cnt < N:
tot += W[cnt]
cnt += 1
if L < tot:
cnt -= 1
print cnt
HIROPON87069639