QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#656670 | #9481. Min Nim | ucup-team896# | WA | 7ms | 4064kb | C++14 | 553b | 2024-10-19 13:31:21 | 2024-10-19 13:31:22 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
int T,n,p[200010],ans=1;
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]&1;
}else if(u==r){
return p[l]&1;
}else{
return solve(u+1,r);
}
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin>>T;
while(T--){
cin>>n;
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: 100
Accepted
time: 0ms
memory: 3720kb
input:
2 3 3 1 4 8 3 1 4 1 5 9 2 6
output:
First Second
result:
ok 2 tokens
Test #2:
score: -100
Wrong Answer
time: 7ms
memory: 4064kb
input:
1 100000 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 825605713 8...
output:
First
result:
wrong answer 1st words differ - expected: 'Second', found: 'First'