#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
int n;
while(t--)
{
cin>>n;
vector<int>v;
for(int i=0;i<n;i++)
{
int num;
cin>>num;
v.push_back(num);
}
reverse(v.begin(),v.end());
vector<int>s;
s=v;
sort(s.begin(),s.end());
if(v==s)
{
cout<<0<<endl;
}
else
{
cout<<1<<endl;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |