序列问题
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.
【题目描述】
给一个长度为n的序列A,你可以删去原序列的一些数,或者一个数都不删除,将剩下的数按照原来的顺序组成新的长度为m的序列B。
你想知道,对于所有合法的序列B, 的最大值是多少。
其中 的意思是,若 Bi=i,则
的值为1,否则为0。
【输入格式】
从文件 sequence.in 中读入数据。
第一行包含一个正整数 n,表示序列A的长度。
第二行包含n个正整数,第i个正整数表示序列A的第i个数Ai。
【输出格式】
输出到文件 sequence.out 中。
输出一行一个数,表示答案。
【样例输入1】
5 1 1 2 5 4
【样例输出1】
3
【样例2】
见附加文件中的 sample/sequence/sequence2.in 和 sample/sequence/sequence2.ans。
【数据规模与约定】
提高组测试改题
- Status
- Done
- Rule
- IOI
- Problem
- 16
- Start at
- 2023-7-22 13:30
- End at
- 2023-7-26 17:30
- Duration
- 100 hour(s)
- Host
- Partic.
- 13