OJ-Problems-Source/HDOJ/5500_autoAC.cpp
KiritoTRw b39288d6ef Powered By HC TECH : AutoACer Engine
5400-5504(END by now)
2016-09-13 04:55:33 +08:00

41 lines
870 B
C++

#include<cstdio>
#include<cstdlib>
#include<vector>
#include<cstring>
#include<set>
#include<queue>
#include<stack>
#include<map>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<bitset>
using namespace std;
#define N 300005
#define NMAX 2000000000
typedef long long ll;
int a[22];
bool cmp(const int& x, const int& y){
return x>y;
}
int main(){
int T, n, m;
while ( scanf("%d", &T) != EOF){
while ( T > 0 ){
T--;
scanf("%d", &n);
int index = -1;
for ( int i = 0 ;i < n; i++ ){
scanf("%d", &a[i]);
}
int ans = 0, t = n - 1, cur = n;
while ( t >= 0 ){
if ( a[t] == cur ) cur--;
t--;
}
cout << cur << endl;
}
}
return 0;
}