結果
| 問題 |
No.156 キャンディー・ボックス
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-02 15:25:27 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 495 ms / 2,000 ms |
| コード長 | 1,073 bytes |
| コンパイル時間 | 496 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 44,324 KB |
| 最終ジャッジ日時 | 2024-07-20 09:52:42 |
| 合計ジャッジ時間 | 19,376 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
import sys
from collections import deque, defaultdict,Counter
from copy import deepcopy
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement,accumulate
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians, ceil, floor, log, sqrt, ceil, floor, pi, hypot
from string import ascii_lowercase
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
import numpy as np
sys.setrecursionlimit(1000000)
INF = 10**18
MOD = 10**9+7
# MOD = 998244353
yes="Yes"
no="No"
from random import randint
def II():return int(input())
def SI():return str(input())
def MI():return map(int,input().split())
def MS():return map(str,input().split())
def LI():return list(map(int,input().split()))
def LS():return list(map(str,input().split()))
def SLI():return sorted(list(map(int,input().split())))
n,m=MI()
c=LI()
c.sort()
ans = 0
for i in c:
m -= i
if m>=0:
ans+=1
print(ans)