結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
lunaticcry
|
| 提出日時 | 2016-01-27 21:03:45 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 19 ms / 5,000 ms |
| コード長 | 324 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 7,076 KB |
| 実行使用メモリ | 7,296 KB |
| 最終ジャッジ日時 | 2024-11-18 08:06:38 |
| 合計ジャッジ時間 | 1,634 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
# -*- coding: utf-8 -*-
__author__ = 'yuuki'
#No.5 数字のブロック
i = 0
C = 0
L = int(input())
N = int(input())
W = map(int,raw_input().split())
W.sort()
for i in xrange(len(W)):
C += W[i]
if C == L:
print i + 1
break
elif C > L:
print i
break
if C < L:
print len(W)
lunaticcry