結果

問題 No.5 数字のブロック
ユーザー dekomori_sanaedekomori_sanae
提出日時 2021-03-13 14:58:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 550 ms / 5,000 ms
コード長 288 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,704 KB
最終ジャッジ日時 2024-04-23 06:38:39
合計ジャッジ時間 20,050 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 537 ms
44,188 KB
testcase_01 AC 533 ms
44,440 KB
testcase_02 AC 537 ms
44,448 KB
testcase_03 AC 537 ms
44,696 KB
testcase_04 AC 542 ms
44,572 KB
testcase_05 AC 538 ms
44,188 KB
testcase_06 AC 536 ms
44,444 KB
testcase_07 AC 544 ms
44,184 KB
testcase_08 AC 536 ms
44,700 KB
testcase_09 AC 549 ms
44,432 KB
testcase_10 AC 540 ms
44,448 KB
testcase_11 AC 536 ms
44,448 KB
testcase_12 AC 540 ms
44,184 KB
testcase_13 AC 539 ms
44,436 KB
testcase_14 AC 539 ms
44,316 KB
testcase_15 AC 550 ms
44,436 KB
testcase_16 AC 541 ms
44,564 KB
testcase_17 AC 541 ms
44,312 KB
testcase_18 AC 538 ms
44,440 KB
testcase_19 AC 541 ms
44,572 KB
testcase_20 AC 535 ms
44,436 KB
testcase_21 AC 533 ms
44,440 KB
testcase_22 AC 537 ms
44,316 KB
testcase_23 AC 536 ms
44,416 KB
testcase_24 AC 531 ms
44,704 KB
testcase_25 AC 544 ms
44,540 KB
testcase_26 AC 540 ms
44,448 KB
testcase_27 AC 546 ms
44,440 KB
testcase_28 AC 539 ms
44,180 KB
testcase_29 AC 533 ms
44,188 KB
testcase_30 AC 541 ms
44,312 KB
testcase_31 AC 535 ms
44,436 KB
testcase_32 AC 543 ms
44,572 KB
testcase_33 AC 544 ms
44,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

L = int(readline())
N = int(readline())
W = np.array(read().split(), np.int64)

W.sort()

Wcum = np.cumsum(W)

answer = (Wcum <= L).sum()
print(answer)
0