結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-03-02 10:21:00 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 131 ms / 2,000 ms |
| コード長 | 668 bytes |
| 記録 | |
| コンパイル時間 | 145 ms |
| コンパイル使用メモリ | 77,396 KB |
| 最終ジャッジ日時 | 2025-12-03 14:24:01 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import itertools
import math
from collections import Counter, defaultdict
class Main(object):
def __init__(self):
pass
def solve(self):
'''
insert your code
'''
n, m = map(int, raw_input().split())
c = map(int, raw_input().split())
c.sort()
tmp = m
ans = 0
for i in range(len(c)):
if tmp >= c[i]:
ans += 1
tmp -= c[i]
else:
break
print ans
return None
if __name__ == '__main__':
m = Main()
m.solve()