結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
29,968 KB
testcase_01 AC 124 ms
29,868 KB
testcase_02 AC 127 ms
30,344 KB
testcase_03 AC 130 ms
30,320 KB
testcase_04 AC 126 ms
30,416 KB
testcase_05 AC 125 ms
30,316 KB
testcase_06 AC 126 ms
30,408 KB
testcase_07 AC 125 ms
30,324 KB
testcase_08 AC 129 ms
30,472 KB
testcase_09 AC 129 ms
30,500 KB
testcase_10 AC 127 ms
30,316 KB
testcase_11 AC 124 ms
30,400 KB
testcase_12 AC 125 ms
30,448 KB
testcase_13 AC 126 ms
30,260 KB
testcase_14 AC 126 ms
30,336 KB
testcase_15 AC 127 ms
30,304 KB
testcase_16 AC 131 ms
30,468 KB
testcase_17 AC 125 ms
30,332 KB
testcase_18 AC 127 ms
30,252 KB
testcase_19 AC 127 ms
30,448 KB
testcase_20 AC 126 ms
30,440 KB
testcase_21 AC 127 ms
30,444 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 128 ms
29,808 KB
testcase_26 AC 124 ms
29,872 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(A[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