結果

問題 No.5 数字のブロック
ユーザー ytoki28ytoki28
提出日時 2020-12-09 21:20:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 504 ms / 5,000 ms
コード長 223 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 11,736 KB
実行使用メモリ 42,412 KB
最終ジャッジ日時 2023-10-19 07:46:36
合計ジャッジ時間 20,301 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 495 ms
42,412 KB
testcase_01 AC 488 ms
42,412 KB
testcase_02 AC 493 ms
42,412 KB
testcase_03 AC 495 ms
42,412 KB
testcase_04 AC 494 ms
42,412 KB
testcase_05 AC 488 ms
42,412 KB
testcase_06 AC 492 ms
42,412 KB
testcase_07 AC 496 ms
42,412 KB
testcase_08 AC 504 ms
42,412 KB
testcase_09 AC 501 ms
42,412 KB
testcase_10 AC 495 ms
42,412 KB
testcase_11 AC 498 ms
42,412 KB
testcase_12 AC 489 ms
42,412 KB
testcase_13 AC 493 ms
42,412 KB
testcase_14 AC 499 ms
42,412 KB
testcase_15 AC 493 ms
42,412 KB
testcase_16 AC 499 ms
42,412 KB
testcase_17 AC 497 ms
42,412 KB
testcase_18 AC 486 ms
42,412 KB
testcase_19 AC 489 ms
42,412 KB
testcase_20 AC 482 ms
42,412 KB
testcase_21 AC 488 ms
42,412 KB
testcase_22 AC 493 ms
42,412 KB
testcase_23 AC 501 ms
42,412 KB
testcase_24 AC 489 ms
42,412 KB
testcase_25 AC 498 ms
42,412 KB
testcase_26 AC 502 ms
42,412 KB
testcase_27 AC 499 ms
42,412 KB
testcase_28 AC 501 ms
42,412 KB
testcase_29 AC 499 ms
42,412 KB
testcase_30 AC 497 ms
42,412 KB
testcase_31 AC 498 ms
42,412 KB
testcase_32 AC 495 ms
42,412 KB
testcase_33 AC 490 ms
42,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import numpy as np

readline = sys.stdin.readline

l = int(input())
n = int(input())
w = np.array(readline().split(), dtype=np.int64)
w.sort()
s = np.cumsum(w)
ans = np.searchsorted(s, l, side='right')
print(ans)
0