結果

問題 No.710 チーム戦
ユーザー togetogehattogetogehat
提出日時 2018-07-26 22:26:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 309 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 30,620 KB
最終ジャッジ日時 2023-09-13 18:50:01
合計ジャッジ時間 5,216 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
29,760 KB
testcase_01 AC 130 ms
29,828 KB
testcase_02 AC 134 ms
30,492 KB
testcase_03 AC 132 ms
30,448 KB
testcase_04 AC 133 ms
30,536 KB
testcase_05 AC 133 ms
30,412 KB
testcase_06 AC 133 ms
30,484 KB
testcase_07 AC 132 ms
30,564 KB
testcase_08 AC 132 ms
30,508 KB
testcase_09 AC 131 ms
30,440 KB
testcase_10 AC 131 ms
30,556 KB
testcase_11 AC 131 ms
30,516 KB
testcase_12 AC 131 ms
30,424 KB
testcase_13 AC 130 ms
30,532 KB
testcase_14 AC 131 ms
30,496 KB
testcase_15 AC 131 ms
30,560 KB
testcase_16 AC 130 ms
30,444 KB
testcase_17 AC 130 ms
30,372 KB
testcase_18 AC 130 ms
30,548 KB
testcase_19 AC 134 ms
30,620 KB
testcase_20 AC 133 ms
30,376 KB
testcase_21 AC 133 ms
30,480 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 133 ms
29,660 KB
testcase_26 AC 132 ms
29,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n = int(input())
A, B = map(np.array,
        zip(*(map(int, input().split()) for _ in range(n))))
m = max(B[A<B].sum(), B[B<A].sum())
dp = np.zeros(m+1, dtype='int32')
for a, b in zip(A, B):
    dp += b
    dp[a:] = np.minimum(dp[a:], dp[:-a]-b)
print(np.maximum(np.arange(m+1), dp).min())
0