M. 收集数字
收集数字
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.
题目背景
翻译自 CSES-2216 题。
题目描述
给你一个数组,其中包含 之间的每个数字。你的任务是按递增顺序收集从 到 的数字。
在每一轮中,你从左到右遍历数组,收集尽可能多的数字。
求要收集多少轮?
输入格式
第一行输入一个整数 ,代表数组大小。
第二行输入 个整数 ,分别代表数组中的数字。
输出格式
输出一个整数,表示轮数。
样例
5
4 2 1 5 3
3
说明/提示
;
CSES练习二 排序贪心STL
- Status
- Done
- Problem
- 35
- Open Since
- 2025-5-1 0:00
- Deadline
- 2025-5-31 23:59
- Extension
- 24 hour(s)