QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#656849#9481. Min Nimucup-team896#WA 0ms3668kbC++14589b2024-10-19 13:47:002024-10-19 13:47:00

Judging History

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

  • [2024-10-19 13:47:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3668kb
  • [2024-10-19 13:47:00]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
int T,n,p[200010],ans=1,ok;
bool solve(int l,int r){
	if((r-l+1)&1)return 1;
	int u=l;
	while(u<r&&p[u+1]==p[l])
		u++;
	if((u-l+1)%2==1){
		return (p[l]-p[l-1])&1;
	}else if(u==r){
		return 0;
	}else{
		return solve(u+1,r)^((p[l]-p[l-1]+1)%2);
	}
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>T;
	while(T--){
		cin>>n;
		ok=0;
		for(int i=1;i<=n;i++)
			cin>>p[i];
		sort(p+1,p+n+1);
		if(solve(1,n)){
			cout<<"First\n";
		}else{
			cout<<"Second\n";
		}
	}
	return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3668kb

input:

2
3
3 1 4
8
3 1 4 1 5 9 2 6

output:

First
First

result:

wrong answer 2nd words differ - expected: 'Second', found: 'First'