D. [POI 2012] HUR-Warehouse Store

    Type: RemoteJudge 1000ms 125MiB

[POI 2012] 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

AI辅助编程测试

Not Claimed
Status
Done
Problem
6
Open Since
2026-4-2 14:15
Deadline
2026-4-2 17:15
Extension
24 hour(s)