結果

問題 No.710 チーム戦
ユーザー pluto77pluto77
提出日時 2018-08-17 09:34:40
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 190 ms / 3,000 ms
コード長 299 bytes
コンパイル時間 1,656 ms
コンパイル使用メモリ 76,672 KB
実行使用メモリ 80,384 KB
最終ジャッジ日時 2024-04-16 19:04:29
合計ジャッジ時間 7,028 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
78,976 KB
testcase_01 AC 101 ms
79,360 KB
testcase_02 AC 164 ms
79,616 KB
testcase_03 AC 165 ms
79,488 KB
testcase_04 AC 168 ms
79,488 KB
testcase_05 AC 161 ms
80,000 KB
testcase_06 AC 165 ms
79,616 KB
testcase_07 AC 170 ms
79,360 KB
testcase_08 AC 165 ms
79,616 KB
testcase_09 AC 166 ms
79,360 KB
testcase_10 AC 159 ms
79,872 KB
testcase_11 AC 164 ms
79,872 KB
testcase_12 AC 170 ms
79,872 KB
testcase_13 AC 170 ms
79,872 KB
testcase_14 AC 170 ms
79,616 KB
testcase_15 AC 167 ms
79,616 KB
testcase_16 AC 167 ms
79,616 KB
testcase_17 AC 157 ms
79,360 KB
testcase_18 AC 167 ms
79,488 KB
testcase_19 AC 171 ms
80,128 KB
testcase_20 AC 166 ms
79,616 KB
testcase_21 AC 157 ms
79,616 KB
testcase_22 AC 143 ms
79,872 KB
testcase_23 AC 108 ms
80,384 KB
testcase_24 AC 190 ms
79,488 KB
testcase_25 AC 95 ms
79,360 KB
testcase_26 AC 96 ms
79,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki710

n=int(raw_input())
dp=[float('inf') for i in xrange(100010)]
dp[0]=0
s=0
for i in xrange(n):
 a,b=map(int,raw_input().split())
 for j in xrange(s+1):
  dp[j]+=b
 s+=a
 for j in xrange(s,a-1,-1):
  dp[j]=min(dp[j],dp[j-a]-b)
res=s
for i in xrange(s+1):
 res=min(res,max(i,dp[i]))
print res
0