Submission #5548679


Source Code Expand

#include<bits/stdc++.h>
using namespace std;

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define SORTG(v) sort(v.begin(),v.end(),greater<>())
#define SORT(v) sort(v.begin(),v.end())
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/3

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;

template<class T> void chmax(T& a, T b) {if(a<b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a>b){a=b;}}
void YesNo(int a){cout<<((a)?"Yes":"No")<<endl;}
void YESNO(int a){cout<<((a)?"YES":"NO")<<endl;}
void AorB(int a,string b,string c){cout<<((a)?b:c)<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

signed main(){start();
    int n,count=0;
    cin>>n;
    map<int,int> mp;
    REP(i,0,n){
        int t;
        cin>>t;
        mp[t]++;
    }
    for(auto x : mp){
        if(x.second>1) count+=x.second-1;
    }
    if(count%2==1) cout<<mp.size()-1<<endl;
    else cout<<mp.size()<<endl;
    return 0;
}

Submission Info

Submission Time
Task D - Card Eater
User hanaoka_
Language C++14 (GCC 5.4.1)
Score 400
Code Size 1292 Byte
Status AC
Exec Time 43 ms
Memory 6528 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 17
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 AC 1 ms 256 KB
02.txt AC 2 ms 256 KB
03.txt AC 1 ms 256 KB
04.txt AC 1 ms 256 KB
05.txt AC 1 ms 256 KB
06.txt AC 12 ms 256 KB
07.txt AC 12 ms 256 KB
08.txt AC 22 ms 896 KB
09.txt AC 11 ms 256 KB
10.txt AC 11 ms 256 KB
11.txt AC 20 ms 768 KB
12.txt AC 12 ms 256 KB
13.txt AC 16 ms 384 KB
14.txt AC 43 ms 6528 KB
15.txt AC 9 ms 256 KB