Type: RemoteJudge 1000ms 125MiB

[POI2012] HUR-Warehouse Store

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

现在有 nn 天。第 ii 天上午会进货 AiA_i 件商品,中午的时候会有顾客需要购买 BiB_i 件商品,可以选择满足顾客的要求,或是无视掉他。

如果要满足顾客的需求,就必须要有足够的库存。问最多能够满足多少个顾客的需求。

输入格式

第一行包含一个整数 nn,表示有 nn 天。

第二行有 nn 个整数 aia_i,表示第 ii 天上午进货 aa 件商品。

第三行包含 nn 个整数 bib_i,表示在第 ii 天中午有顾客来买 bb 件商品。

输出格式

第一行一个整数,表示最多能满足几天中顾客的需求。

第二行输出满足这么哪些天顾客的需求。

6
2 2 1 2 1 0
1 2 2 3 4 4
3
1 2 4

提示

对于 100%100\% 的数据,1n2.5×1051\leqslant n\leqslant 2.5\times 10^50ai,bi1090\leqslant a_i,b_i \leqslant 10^9

20240119反悔贪心选讲

Not Attended
Status
Done
Rule
IOI
Problem
14
Start at
2024-1-19 8:00
End at
2024-1-23 8:00
Duration
96 hour(s)
Host
Partic.
21