QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#244450 | #6506. Chase Game 3 | uicere | WA | 0ms | 3404kb | C++14 | 416b | 2023-11-09 08:12:14 | 2023-11-09 08:12:16 |
Judging History
answer
#include<iostream>
#include<cstring>
using namespace std;
const int N=4e5+8;
int p[N],v[N];
void solve(){
int n;cin>>n;
for(int i=1;i<=n;i++) cin>>p[i],v[p[i]]=i;
for(int i=1;i<n;i++){
if(abs(p[i]-p[i+1])){
puts("No");
return ;
}
}
puts("Yes");
return ;
}
int main(){
int T;
cin>>T;
while(T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3404kb
input:
5 2 1 2 3 2 3 1 4 1 4 3 2 5 1 5 2 3 4 6 1 2 3 4 5 6
output:
No No No No No
result:
wrong answer expected YES, found NO [1st token]