QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#108013#6506. Chase Game 3woyouxiangbaile#WA 2ms3444kbC++14913b2023-05-23 14:05:092023-05-23 14:05:12

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-23 14:05:12]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3444kb
  • [2023-05-23 14:05:09]
  • 提交

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]