結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-14 08:45:53 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 52 ms / 2,000 ms |
| + 632µs | |
| コード長 | 299 bytes |
| 記録 | |
| コンパイル時間 | 57 ms |
| コンパイル使用メモリ | 80,884 KB |
| 実行使用メモリ | 80,960 KB |
| 最終ジャッジ日時 | 2026-07-18 07:17:31 |
| 合計ジャッジ時間 | 3,628 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
#!/usr/bin/python
# -*- coding: utf-8 -*-
N,sum = map(int, raw_input().split())
arrays = map(int, raw_input().split())
arrays.sort()
ans = 0
for i in arrays:
if sum >= i:
ans += 1
if sum - i <= 0:
print ans
exit()
sum -= i
else:
print ans