Submission #168960


Source Code Expand

Copy
//
//  main.cpp
//  ARCH
//
//  Created by 鹿島 悠 on 2014/04/20.
//  Copyright (c) 2014年 鹿島 悠. All rights reserved.
//

#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <stack>
#include <math.h>

typedef long long ll;
using namespace std;



int main(int argc, const char * argv[])
{
    multiset<string>counter;
    
    int N;
    cin >> N;
    string s;
    
    int max = 0;
    string max_s;
    for (int i = 0; i < N; i++) {
        cin >> s;
        counter.insert(s);
        int count = (int)counter.count(s);
        if (max < count) {
            max = count;
            max_s = s;
        }
    }
    cout << max_s << endl;
}


Submission Info

Submission Time
Task B - 投票
User nida_001
Language C++11 (GCC 4.8.1)
Score 100
Code Size 783 Byte
Status
Exec Time 27 ms
Memory 964 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
× 3
× 18
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, case_01.txt, case_02.txt, case_03.txt, case_04.txt, case_05.txt, case_06.txt, case_07.txt, case_08.txt, case_09.txt, case_10.txt, case_11.txt, case_12.txt, case_13.txt, case_14.txt, case_15.txt
Case Name Status Exec Time Memory
case_01.txt 24 ms 912 KB
case_02.txt 24 ms 920 KB
case_03.txt 25 ms 872 KB
case_04.txt 22 ms 912 KB
case_05.txt 26 ms 876 KB
case_06.txt 27 ms 816 KB
case_07.txt 25 ms 920 KB
case_08.txt 22 ms 904 KB
case_09.txt 23 ms 900 KB
case_10.txt 26 ms 820 KB
case_11.txt 23 ms 908 KB
case_12.txt 27 ms 868 KB
case_13.txt 22 ms 912 KB
case_14.txt 25 ms 908 KB
case_15.txt 23 ms 924 KB
sample_01.txt 26 ms 964 KB
sample_02.txt 24 ms 920 KB
sample_03.txt 25 ms 944 KB