QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#445962#6506. Chase Game 3Wavelet#WA 16ms3664kbC++20743b2024-06-16 17:58:092024-06-16 17:58:09

Judging History

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

  • [2024-06-16 17:58:09]
  • 评测
  • 测评结果:WA
  • 用时:16ms
  • 内存:3664kb
  • [2024-06-16 17:58:09]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define mdd 998244353
using namespace std;
ll t,n,m,x,y,z,flg;
ll max(ll x,ll y,ll z)
{
	if(x>y&&x>z)return x;
	else if(y>z)return y;
	return z;
}
ll min(ll x,ll y,ll z)
{
	if(x<y&&x<z)return x;
	else if(y<z)return y;
	return z;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>t;
	for(int ii=1;ii<=t;ii++)
	{
		cin>>n;flg=0;
		if(n==2){cin>>x>>y;cout<<"Yes\n";continue;}
		cin>>z>>y>>x;
		if((max(x,y,z)-min(x,y,z))!=2){flg=1;}
		for(int i=4;i<=n;i++)
		{
			z=y;y=x;cin>>x;
			//cout<<x<<' '<<y<<' '<<z<<endl;
			if((max(x,y,z)-min(x,y,z))!=2){flg=1;}
		}
		if(flg==1){cout<<"No\n";goto lb;}
		cout<<"Yes\n";
		lb:;
	}
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3592kb

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: 0ms
memory: 3664kb

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: 16ms
memory: 3592kb

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

result:

wrong answer expected YES, found NO [1st token]