QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#665168#6506. Chase Game 3Ryan123RE 0ms0kbC++14407b2024-10-22 08:27:112024-10-22 08:27:12

Judging History

你现在查看的是最新测评结果

  • [2024-10-22 08:27:12]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-10-22 08:27:11]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int N = 4e5 + 5;

int w[N];

int solve(){
    int n;
    scanf("%d", &n);

    for(int i = 1; i <= n; i ++)scanf("%d", &w[i]);

    bool flg = 1;
    for(int i = 1; i < n; i ++)flg &= (abs(w[i] - w[i + 1]) <= 2);

    if(flg)puts("Yes");
    else puts("No");
}

int main(){
    int T;
    scanf("%d", &T);
    while(T --)solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Runtime Error

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:


result: