QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#665271 | #6506. Chase Game 3 | hhoppitree | WA | 0ms | 3848kb | C++17 | 330b | 2024-10-22 10:40:51 | 2024-10-22 10:40:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int p[N];
signed main() {
int n; scanf("%d", &n);
for (int i = 1; i <= n; ++i) scanf("%d", &p[i]);
for (int i = 1; i < n; ++i) {
if (abs(p[i] - p[i + 1]) >= 3) return 0 & puts("No");
}
puts("Yes");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3848kb
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
result:
wrong answer Answer contains longer sequence [length = 5], but output contains 1 elements