結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 502 ms
45,736 KB
testcase_01 AC 523 ms
45,984 KB
testcase_02 AC 515 ms
45,728 KB
testcase_03 AC 512 ms
45,852 KB
testcase_04 AC 525 ms
45,728 KB
testcase_05 AC 514 ms
45,484 KB
testcase_06 AC 519 ms
45,476 KB
testcase_07 AC 514 ms
45,480 KB
testcase_08 AC 519 ms
45,224 KB
testcase_09 AC 521 ms
45,612 KB
testcase_10 AC 516 ms
45,992 KB
testcase_11 AC 524 ms
45,856 KB
testcase_12 AC 521 ms
45,732 KB
testcase_13 AC 526 ms
45,848 KB
testcase_14 AC 518 ms
45,988 KB
testcase_15 AC 520 ms
45,604 KB
testcase_16 AC 508 ms
45,344 KB
testcase_17 AC 514 ms
45,728 KB
testcase_18 AC 510 ms
45,348 KB
testcase_19 AC 518 ms
45,736 KB
testcase_20 AC 512 ms
45,740 KB
testcase_21 AC 515 ms
45,732 KB
testcase_22 AC 508 ms
45,856 KB
testcase_23 AC 523 ms
45,344 KB
testcase_24 AC 523 ms
45,340 KB
testcase_25 AC 512 ms
45,344 KB
testcase_26 AC 507 ms
45,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

N=int(readline())
inf=1<<30
dp=np.full(10**5,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)])))
print(ans)
0