Submission #1512954


Source Code Expand

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstdlib>
#include <cmath>
#include<stdio.h>
#include<queue>
#include<stack>
#include<set>
#define ll long long
#define MAX 1000000000000000000LL
ll inf=100000000000007;
using namespace std;

int main(){
    int n;cin>>n;
    vector<int> v;
    int a;
    for(int i=0; i<n; i++){
        cin>>a;
        v.push_back(a);
    }
    sort(v.begin(),v.end());
    int key=1;
    int lo=0;
    for(int i=1; i<n; i++){
        if(v[i-1]==v[i])key++;
        else{
            while(key/2!=0){
                lo+=key/2;
                   key/=2;
            }
            key=1;
        }
    }
    int ans=(lo/2)*2+(lo%2)*2;
    cout<<n-ans<<endl;
    return 0;
}

Submission Info

Submission Time
Task D - Card Eater
User birdway
Language C++14 (GCC 5.4.1)
Score 0
Code Size 780 Byte
Status WA
Exec Time 36 ms
Memory 892 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 2
AC × 5
WA × 12
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 1 ms 256 KB
00_example_02.txt AC 1 ms 256 KB
01.txt WA 1 ms 256 KB
02.txt WA 3 ms 256 KB
03.txt AC 1 ms 256 KB
04.txt WA 1 ms 256 KB
05.txt AC 1 ms 256 KB
06.txt WA 32 ms 892 KB
07.txt WA 32 ms 892 KB
08.txt WA 36 ms 892 KB
09.txt WA 32 ms 892 KB
10.txt WA 32 ms 892 KB
11.txt WA 34 ms 892 KB
12.txt WA 32 ms 892 KB
13.txt WA 34 ms 892 KB
14.txt AC 30 ms 892 KB
15.txt WA 31 ms 892 KB