「一本通 2.1 练习 8」收集雪花
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.
Description
Different snowflakes often have different shapes. A student in the north wants to collect snowflakes as gifts for friends in the south. There are moments in total, and the shape of the snowflake falling at each moment is given, represented by distinct integers. During the collection process, the students do not want duplicate snowflakes. You can start collecting at any moment and stop at moment . All snowflakes falling between moments and will be collected. They wish to collect as many snowflakes as possible.
Input Format
The first line contains a positive integer ;
The second line contains non-negative integers representing the shapes of the snowflakes at each of the moments.
Output Format
The maximum number of snowflakes that can be collected.
Sample 1
5
1 2 3 2 1
3
Data Range and Hint
For 97 points of the data, . (This is the original data.)
As per user request, an additional 3 points of data are included: .
20251117 D班作业(6)
- Status
- Done
- Problem
- 4
- Open Since
- 2025-11-17 0:00
- Deadline
- 2025-11-25 23:59
- Extension
- 24 hour(s)