結果
| 問題 |
No.5 数字のブロック
|
| コンテスト | |
| ユーザー |
lunaticcry
|
| 提出日時 | 2016-01-27 20:55:00 |
| 言語 | Python2 (2.7.18) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 294 bytes |
| コンパイル時間 | 147 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 7,168 KB |
| 最終ジャッジ日時 | 2024-09-21 17:40:36 |
| 合計ジャッジ時間 | 1,396 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 RE * 7 |
ソースコード
# -*- 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()
while(1):
C += W[i]
if C == L:
print i + 1
break
elif C > L:
print i
break
i += 1
lunaticcry