QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#108013 | #6506. Chase Game 3 | woyouxiangbaile# | WA | 2ms | 3444kb | C++14 | 913b | 2023-05-23 14:05:09 | 2023-05-23 14:05:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i, d, u) for(int i = d; i <= u; ++i)
#define dep(i, u, d) for(int i = u; i >= d; --i)
#define cep(n) while(n--)
#define gep(i, a) for(int i = firs[a]; i; i = neig[i])
int ured() {
int re = 0;
char ch;
do {
ch = getchar();
} while('9' < ch || ch < '0');
do {
re = re * 10 + (ch ^ '0');
} while('0' <= (ch = getchar()) && ch <= '9');
return re;
}
void uwit(int da) {
int ch[21], cn = 0;
do {
ch[++cn] = da - da / 10 * 10;
} while(da /= 10);
do {
putchar('0' ^ ch[cn]);
} while(--cn);
}
const int _maxn = 400011;
int t, n, p[_maxn], cnts;
int main() {
t = ured();
cep(t) {
n = ured();
rep(i, 1, n) {
p[i] = ured();
}
cnts = p[1] - p[n] == 1;
rep(i, 1, n) {
cnts += p[i + 1] - p[i] == 1;
}
if(cnts == n - 1) {
puts("Yes");
} else {
puts("No");
}
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3328kb
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: -100
Wrong Answer
time: 1ms
memory: 3444kb
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 No Yes No No
result:
wrong answer expected YES, found NO [5th token]