|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||256 MB||64||20||20||46.512%|
Your chicken farm would like to send eggs to the market. Each package has different sizes, so you need to take care how you pack them. You decide to pack the egg packages vertically and sort them from the shortest to tallest.
Your farm uses the hydraulic arm system and the arm can do one of these three actions at a time.
For the speed of the process, the arm cannot move any package on the right conveyor belt.
Write the program to check if the given position of the package can be process to the desire position, all package on the right conveyor belt, sorted from smallest on the right and tallest on the left.
The first lint contain integer T (1 ≤ T ≤ 20), the number of testcases. In each testcase there will be as follow.
The first line contains integer N (1 ≤ N ≤ 10,000), the number of egg packages.
Next line contains positive integer a1, a2, a3, …, aN (1 ≤ ai ≤ N), the height of the egg packages from left to right of the left conveyor belt. There will not be two packages that have the same height.
For each testcase, print “yes” or “no” on the following condition.
3 3 2 1 3 4 4 2 3 1 5 1 4 3 2 5
yes no yes