QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#109648#6506. Chase Game 32811928366TL 2ms3368kbC++23620b2023-05-30 01:27:452023-05-30 01:27:48

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-30 01:27:48]
  • 评测
  • 测评结果:TL
  • 用时:2ms
  • 内存:3368kb
  • [2023-05-30 01:27:45]
  • 提交

answer

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
const int MAXN = 4e5 + 10;
int main() {
    long long T;
    cin >> T;
    for (long long i = 0; i < T; i++) {
        long long n;
        bool go = true;
        cin >> n;
		long t;
        vector<int>str(n+1);
        for (int j = 1; j <= n; j++) {
            cin >> t;
			str[j]=t;
            if (j != 1 && abs(str[j - 1] - str[j]) >= 3) {
                go = false;
            }
        }
        if (go) {
            cout << "Yes\n";
        }
        else {
            cout << "No\n";
        }
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3364kb

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
No
No
Yes

result:

ok 5 token(s): yes count is 3, no count is 2

Test #2:

score: 0
Accepted
time: 2ms
memory: 3368kb

input:

8
2
1 2
2
2 1
3
1 2 3
3
3 1 2
3
2 1 3
3
2 3 1
3
3 2 1
3
1 3 2

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes

result:

ok 8 token(s): yes count is 8, no count is 0

Test #3:

score: -100
Time Limit Exceeded

input:

100000
4
4 1 3 2
4
3 2 4 1
4
3 2 1 4
4
2 4 3 1
4
1 2 3 4
4
2 3 1 4
4
1 3 4 2
4
3 4 1 2
4
1 3 2 4
4
1 4 3 2
4
3 4 2 1
4
3 2 4 1
4
4 2 3 1
4
3 2 4 1
4
4 1 2 3
4
3 2 1 4
4
4 1 3 2
4
1 3 4 2
4
1 4 2 3
4
2 4 3 1
4
2 3 1 4
4
4 2 3 1
4
2 1 3 4
4
3 1 2 4
4
1 2 3 4
4
4 3 2 1
4
3 4 1 2
4
1 3 2 4
4
4 2 1 3
4
3...

output:

No
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
No
No
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
No
...

result: