Almost Longest Increasing Subsequence

아직 제출이 없습니다시간 제한13초메모리 제한256 MB

문제

Suppose you are given a permutation aa of nn numbers from 11 to nn. In a usual task you would have to find its {\it longest increasing subsequence}: indices i_1i\_1, \ldots, i_ki\_k such that i_1<<i_ki\_1 < \ldots < i\_k and a_i_1<<a_i_ka\_{i\_1} < \ldots < a\_{i\_k}, where kk is maximum possible.

However, this time the task is different: the numbers are given online, so you must decide whether you take the number or not before you receive the next number. You also know that the input permutation is random, that is, selected uniformly at random from the set of all n!n! possible permutations. Under these requirements it is impossible to surely find the longest increasing subsequence, but you have to just do good enough. Formally, let kk be the length of the longest increasing subsequence of the given permutation. Then, finding any increasing subsequence of length at least 0.65k0.65k will suffice.

힌트

The sample test is used only to illustrate the interaction format and is not included in the testset. Each test from the testset has n=105n = 10^5.

In this problem, technically, a random permutation is an array of 11, \ldots, nn shuffled with some pseudo-random number generator.