QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#115624 | #6506. Chase Game 3 | jzh# | WA | 98ms | 3476kb | C++14 | 764b | 2023-06-26 13:39:24 | 2023-06-26 13:39:25 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 5005;
int main() {
ios::sync_with_stdio(false);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
if (n <= 3) {
cout << "Yes" << "\n";
continue;
}
bool sud = true;
for (int i = 0; i < n - 1; i++) {
if (abs(a[i] - a[i + 1]) > 2) {
sud = false;
}
}
if (sud) {
cout << "Yes" << "\n";
} else {
cout << "No" << "\n";
}
}
return 0;
}
/*
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
*/
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3476kb
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: 1ms
memory: 3404kb
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
Wrong Answer
time: 98ms
memory: 3472kb
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:
wrong answer expected YES, found NO [1st token]