QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#658809#9481. Min Nimucup-team3659#WA 6ms3744kbC++20730b2024-10-19 17:39:432024-10-19 17:39:43

Judging History

This is the latest submission verdict.

  • [2024-10-19 17:39:43]
  • Judged
  • Verdict: WA
  • Time: 6ms
  • Memory: 3744kb
  • [2024-10-19 17:39:43]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
void test()
{
    int n;
    map<int,int> mp;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        int x;
        cin>>x;
        mp[x]++;
    }
    if(n&1)
    {
        cout<<"First\n";
        return;
    }
    int cnt=0;
    mp[1000000007]++;
    for(pair<int,int> p:mp)
    {
        if(p.second&1)
        {
            if(cnt&1)
                cout<<"Second\n";
            else
                cout<<"First\n";
            break;
        }
        else
            cnt+=p.second/2;
    }
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    for(int i=1;i<=t;i++)
        test();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3568kb

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'