Canadian Computing Competition: 2005 Stage 2, Day 2, Problem 1
Given a sequence of positive integers of length
For example, given the sequence:
3 5 6 3 8
There are two primed subsequences of length
Input Specification
Input consists of a series of test cases. The first line consists of an
integer
Each test case consists of one line. The line begins with the integer
You should note that in test cases worth
Output Specification
For each sequence, print Shortest primed subsequence is length x:
,
where This sequence is anti-primed.
.
Sample Input
3
5 3 5 6 3 8
5 6 4 5 4 12
21 15 17 16 32 28 22 26 30 34 29 31 20 24 18 33 35 25 27 23 19 21
Sample Output
Shortest primed subsequence is length 2: 5 6
Shortest primed subsequence is length 3: 4 5 4
This sequence is anti-primed.
Comments
What does "80% of the test cases" mean in this context? Is it that in each test, there are at most 4 sequences with length more than 1000, or is it that 40/50 points are achievable for solutions that work for
.
The latter. A solution that can consistently solve
is expected to score 40/50 points.
The statement has been updated to clarify this.
Since the original data were weak, an additional test case was added, and all submissions were rejudged.