#P5771. [JSOI2016] 反质数序列
[JSOI2016] 反质数序列
Description
For a sequence of length , if for any , is not a prime number, then JYY considers the sequence to be an “anti-prime sequence”.
JYY has a sequence of length . He wants to choose a subsequence with as many elements as possible such that this subsequence is an anti-prime sequence.
Input Format
The first line contains a positive integer .
The next line contains positive integers, describing in order.
Output Format
Output one integer in a single line, representing the length of the longest anti-prime subsequence. The input guarantees that an anti-prime subsequence exists.
6
1 2 2 3 4 10
4
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号