結果

問題 No.710 チーム戦
ユーザー pluto77pluto77
提出日時 2018-08-17 09:34:40
言語 PyPy2
(7.3.13)
結果
AC  
実行時間 158 ms / 3,000 ms
コード長 299 bytes
コンパイル時間 1,915 ms
コンパイル使用メモリ 77,388 KB
実行使用メモリ 81,264 KB
最終ジャッジ日時 2023-07-29 12:58:37
合計ジャッジ時間 7,019 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
80,084 KB
testcase_01 AC 82 ms
80,512 KB
testcase_02 AC 137 ms
80,492 KB
testcase_03 AC 135 ms
80,692 KB
testcase_04 AC 138 ms
80,512 KB
testcase_05 AC 130 ms
80,840 KB
testcase_06 AC 134 ms
80,652 KB
testcase_07 AC 139 ms
80,628 KB
testcase_08 AC 133 ms
80,608 KB
testcase_09 AC 145 ms
80,660 KB
testcase_10 AC 133 ms
80,500 KB
testcase_11 AC 136 ms
80,612 KB
testcase_12 AC 145 ms
80,456 KB
testcase_13 AC 140 ms
80,572 KB
testcase_14 AC 137 ms
80,776 KB
testcase_15 AC 134 ms
80,560 KB
testcase_16 AC 143 ms
80,904 KB
testcase_17 AC 129 ms
80,856 KB
testcase_18 AC 142 ms
80,640 KB
testcase_19 AC 141 ms
80,640 KB
testcase_20 AC 142 ms
80,644 KB
testcase_21 AC 131 ms
80,524 KB
testcase_22 AC 117 ms
80,652 KB
testcase_23 AC 83 ms
81,264 KB
testcase_24 AC 158 ms
80,704 KB
testcase_25 AC 76 ms
80,400 KB
testcase_26 AC 75 ms
80,160 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