QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#658474 | #9481. Min Nim | ucup-team3474# | WA | 7ms | 19316kb | C++20 | 610b | 2024-10-19 16:52:57 | 2024-10-19 16:53:01 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=3e5+10;
typedef long long ll;
typedef pair<ll,ll> PII;
int n,m,k;
int a[N],b[N];
char s[N];
vector<PII> e[N];
int d[N];
bool tf[N];
set<PII> se[N];
void __(){
scanf("%d",&n);
ll sg=0;
for(int i=1;i<=n;i++){
int x;
scanf("%d",&x);
// cout<<x<<endl;
sg^=(x-1);
}
if(n%2){
puts("First");
return;
}
if(sg==0) puts("First");
else puts("Second");
}
int main(){
int _;
cin>>_;
while(_--){
__();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 5ms
memory: 19196kb
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: 19316kb
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'