結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-03-02 10:21:00 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 2,000 ms |
| + 625µs | |
| コード長 | 668 bytes |
| 記録 | |
| コンパイル時間 | 69 ms |
| コンパイル使用メモリ | 80,512 KB |
| 実行使用メモリ | 81,024 KB |
| 最終ジャッジ日時 | 2026-07-17 11:28:31 |
| 合計ジャッジ時間 | 4,064 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()