結果

問題 No.5 数字のブロック
ユーザー machoniumpmachoniump
提出日時 2021-03-24 14:22:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 975 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 11,568 KB
最終ジャッジ日時 2023-08-17 22:07:13
合計ジャッジ時間 2,727 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,396 KB
testcase_01 AC 34 ms
10,400 KB
testcase_02 AC 34 ms
10,416 KB
testcase_03 AC 38 ms
11,164 KB
testcase_04 AC 35 ms
10,812 KB
testcase_05 AC 37 ms
11,232 KB
testcase_06 AC 36 ms
10,916 KB
testcase_07 AC 35 ms
10,760 KB
testcase_08 AC 36 ms
11,088 KB
testcase_09 AC 34 ms
10,640 KB
testcase_10 AC 38 ms
11,324 KB
testcase_11 AC 35 ms
10,868 KB
testcase_12 AC 37 ms
11,088 KB
testcase_13 AC 38 ms
11,188 KB
testcase_14 AC 33 ms
10,356 KB
testcase_15 AC 33 ms
10,324 KB
testcase_16 AC 38 ms
11,312 KB
testcase_17 AC 39 ms
11,532 KB
testcase_18 AC 38 ms
11,348 KB
testcase_19 AC 40 ms
11,568 KB
testcase_20 AC 33 ms
10,396 KB
testcase_21 AC 33 ms
10,304 KB
testcase_22 AC 33 ms
10,272 KB
testcase_23 AC 33 ms
10,444 KB
testcase_24 AC 33 ms
10,396 KB
testcase_25 AC 33 ms
10,392 KB
testcase_26 AC 33 ms
10,312 KB
testcase_27 AC 33 ms
10,348 KB
testcase_28 AC 33 ms
10,276 KB
testcase_29 AC 37 ms
10,744 KB
testcase_30 AC 35 ms
10,592 KB
testcase_31 AC 34 ms
10,312 KB
testcase_32 AC 34 ms
10,416 KB
testcase_33 AC 33 ms
10,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, defaultdict
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
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
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()))
box=II()
N=II()
A=LI()
A=sorted(A)
cnt=0
for i in range(N):
    if box>=A[i]:
        box-=A[i]
        cnt+=1
print(cnt)
0