主页 讨论版 问题 名次 状态 统计
12月将举办首届西电ACM新生赛,敬请期待~~~~
问题 G: Gold of Orz Pandas

问题 G: Gold of Orz Pandas

时间限制: 1 Sec  内存限制: 128 MB
提交: 63  解决: 26
[提交][状态][讨论版]

题目描述

Orz Panda is addicted to one RPG game. To make his character stronger, he have to fulfil tasks to get EXP for higher level.At first he accepted all the tasks.But after he read rules carefully, he realized that what he has done was stupid.
Rule:
Every task costs 1 time interval.
Every task has a dead line.If you can't finish it on time ,you have to pay the same amount of gold as the EXP given by this task.

Orz Panda wants to know the minimum amount of gold he has to pay.

输入

The first line has one integer n, tell you how many tasks Orz Panda has accepted.
The second line has n integers ti separated by blank, represent for the ith task's dead line.
The third line has n integers ei separated by blank, represent for the
EXP given by the ith task.
(1 <= n, ti, ei <= 1000)

输出

One integer for the minimum amount of gold Orz Panda has to pay.

样例输入

4
3 1 2 3
10 20 30 40

样例输出

10

提示

[提交][状态][讨论版]