QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#184125 | #6506. Chase Game 3 | CSU2023# | WA | 1ms | 3692kb | C++14 | 473b | 2023-09-20 13:25:32 | 2023-09-20 13:25:32 |
Judging History
answer
#include <bits/stdc++.h>
const int N = 1e6 + 3;
int n;
int p[N],rk[N];
int main()
{
freopen("a.txt","r",stdin);
int T;
scanf("%d",&T);
while(T--){
scanf("%d",&n);
for(int i = 1;i <= n;++i) scanf("%d",&p[i]),rk[p[i]] = i;
bool flag = 0;
for(int i = 2;i <= n;++i) flag |= (std::abs(rk[i] - rk[i - 1]) > 2);
if(!flag) puts("Yes");
else puts("No");
}
//system("pause");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3692kb
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:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
wrong answer expected NO, found YES [3rd token]