結果

問題 No.710 チーム戦
ユーザー vwxyzvwxyz
提出日時 2022-04-08 10:23:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 483 ms / 3,000 ms
コード長 316 bytes
コンパイル時間 451 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 46,884 KB
最終ジャッジ日時 2024-05-06 01:53:12
合計ジャッジ時間 14,766 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 448 ms
46,500 KB
testcase_01 AC 454 ms
46,492 KB
testcase_02 AC 462 ms
46,752 KB
testcase_03 AC 462 ms
46,364 KB
testcase_04 AC 461 ms
46,368 KB
testcase_05 AC 467 ms
46,368 KB
testcase_06 AC 465 ms
46,364 KB
testcase_07 AC 465 ms
46,368 KB
testcase_08 AC 471 ms
46,884 KB
testcase_09 AC 468 ms
46,364 KB
testcase_10 AC 475 ms
46,636 KB
testcase_11 AC 463 ms
46,884 KB
testcase_12 AC 473 ms
46,496 KB
testcase_13 AC 463 ms
46,636 KB
testcase_14 AC 483 ms
46,372 KB
testcase_15 AC 457 ms
46,748 KB
testcase_16 AC 467 ms
46,504 KB
testcase_17 AC 461 ms
46,632 KB
testcase_18 AC 470 ms
46,500 KB
testcase_19 AC 460 ms
46,364 KB
testcase_20 AC 483 ms
46,496 KB
testcase_21 AC 464 ms
46,624 KB
testcase_22 AC 465 ms
46,496 KB
testcase_23 AC 471 ms
46,372 KB
testcase_24 AC 470 ms
46,504 KB
testcase_25 AC 449 ms
46,368 KB
testcase_26 AC 456 ms
46,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
import numpy as np

N=int(readline())
inf=1<<30
dp=np.full(10**5+1,inf,np.int32)
dp[0]=0
for _ in range(N):
    a,b=map(int,readline().split())
    np.minimum(dp[:-a],dp[a:]+b,out=dp[a:])
    dp[:a]+=b
ans=np.min(np.maximum(dp,np.array([i for i in range(10**5+1)])))
print(ans)
0