結果

問題 No.5 数字のブロック
ユーザー machoniumpmachoniump
提出日時 2021-03-01 18:13:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 963 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-04-14 03:46:00
合計ジャッジ時間 3,052 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
11,776 KB
testcase_01 AC 35 ms
11,520 KB
testcase_02 WA -
testcase_03 AC 38 ms
12,160 KB
testcase_04 AC 37 ms
12,032 KB
testcase_05 AC 40 ms
12,416 KB
testcase_06 AC 39 ms
12,032 KB
testcase_07 AC 39 ms
12,160 KB
testcase_08 AC 37 ms
12,032 KB
testcase_09 AC 37 ms
11,904 KB
testcase_10 AC 40 ms
12,544 KB
testcase_11 AC 37 ms
11,904 KB
testcase_12 AC 39 ms
12,160 KB
testcase_13 AC 40 ms
12,416 KB
testcase_14 AC 35 ms
11,520 KB
testcase_15 AC 35 ms
11,520 KB
testcase_16 AC 40 ms
12,416 KB
testcase_17 AC 40 ms
12,544 KB
testcase_18 AC 41 ms
12,416 KB
testcase_19 AC 40 ms
12,544 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 35 ms
11,520 KB
testcase_24 AC 35 ms
11,776 KB
testcase_25 AC 35 ms
11,648 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 38 ms
12,160 KB
testcase_30 AC 37 ms
11,776 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

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
from math import pi as PI
from decimal import Decimal
# sys.setrecursionlimit(10**6)
INF = 10**18
MOD = 10**9+7
# MOD = 998244353
yes="Yes"
no="No"
from math import ceil
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()))
l=II()
n=II()
w=sorted(LI())
cnt=0
for i in range(n):
    if l-w[i]>=0:
        l-=w[i]
        cnt+=1
    else:
        print(cnt)
        exit()
0