結果

問題 No.5 数字のブロック
ユーザー ytftytft
提出日時 2022-11-02 14:31:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 202 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 76,224 KB
最終ジャッジ日時 2023-09-24 03:46:33
合計ジャッジ時間 4,904 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,356 KB
testcase_01 AC 78 ms
71,480 KB
testcase_02 AC 79 ms
71,804 KB
testcase_03 AC 81 ms
76,028 KB
testcase_04 AC 77 ms
75,804 KB
testcase_05 AC 77 ms
75,968 KB
testcase_06 AC 76 ms
75,808 KB
testcase_07 AC 86 ms
75,876 KB
testcase_08 AC 86 ms
75,880 KB
testcase_09 AC 78 ms
76,160 KB
testcase_10 AC 77 ms
76,040 KB
testcase_11 AC 74 ms
76,064 KB
testcase_12 AC 79 ms
76,028 KB
testcase_13 AC 78 ms
75,808 KB
testcase_14 AC 71 ms
71,876 KB
testcase_15 AC 74 ms
71,712 KB
testcase_16 AC 77 ms
75,836 KB
testcase_17 AC 77 ms
76,028 KB
testcase_18 AC 80 ms
76,024 KB
testcase_19 AC 77 ms
76,024 KB
testcase_20 AC 72 ms
71,592 KB
testcase_21 AC 74 ms
71,712 KB
testcase_22 AC 71 ms
71,936 KB
testcase_23 AC 73 ms
71,736 KB
testcase_24 AC 72 ms
71,612 KB
testcase_25 AC 72 ms
71,708 KB
testcase_26 AC 73 ms
71,772 KB
testcase_27 AC 74 ms
71,708 KB
testcase_28 AC 73 ms
71,608 KB
testcase_29 AC 79 ms
76,224 KB
testcase_30 AC 77 ms
76,008 KB
testcase_31 AC 76 ms
71,560 KB
testcase_32 AC 80 ms
71,508 KB
testcase_33 AC 74 ms
71,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,copy
input=lambda:sys.stdin.readline().rstrip()
W=int(input())
N=int(input())
A=sorted(list(map(int,input().split())))
for i in range(N):
	if A[i]>W:
		print(i)
		sys.exit()
	W-=A[i]
print(N)
0