QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#677012 | #9481. Min Nim | m107239# | WA | 6ms | 3712kb | C++20 | 713b | 2024-10-26 08:33:51 | 2024-10-26 08:33:52 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
void solve()
{
int n;
std::cin >> n;
int cnt = 0;
for (int i = 0; i < n; i++) {
int x;
std::cin >> x;
cnt += (x == 1);
}
cnt = n - cnt;
if (n & 1) {
std::cout << "First\n";
return;
}
if (cnt & 1) {
std::cout << "First\n";
} else {
if (cnt == n) {
std::cout << "First\n";
} else {
std::cout << "Second\n";
}
}
}
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3712kb
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: 6ms
memory: 3620kb
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'