Submission #168982


Source Code Expand

Copy
#include <iostream>
#include <vector>
#include <string>
#include <map>

using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()


int main() {
	int N;
	cin >> N;

	map<string, int> S;
	REP(i, N)
	{
		string name;
		cin >> name;
		S[name]++;
	}

	int max = -1;
	string ans;
	map<string, int>::iterator it = S.begin();
	while (it != S.end())
	{
		if (max < (*it).second)
		{
			max = (*it).second;
			ans = (*it).first;
		}
	}
	cout << ans << endl;
}

Submission Info

Submission Time
Task B - 投票
User enigsol
Language C++ (G++ 4.6.4)
Score 0
Code Size 605 Byte
Status TLE
Exec Time 2035 ms
Memory 924 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
TLE × 3
TLE × 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 TLE 2030 ms 804 KB
case_02.txt TLE 2030 ms 884 KB
case_03.txt TLE 2028 ms 792 KB
case_04.txt TLE 2032 ms 804 KB
case_05.txt TLE 2035 ms 796 KB
case_06.txt TLE 2028 ms 808 KB
case_07.txt TLE 2029 ms 808 KB
case_08.txt TLE 2029 ms 924 KB
case_09.txt TLE 2031 ms 804 KB
case_10.txt TLE 2035 ms 804 KB
case_11.txt TLE 2029 ms 808 KB
case_12.txt TLE 2029 ms 868 KB
case_13.txt TLE 2029 ms 812 KB
case_14.txt TLE 2034 ms 800 KB
case_15.txt TLE 2029 ms 808 KB
sample_01.txt TLE 2029 ms 800 KB
sample_02.txt TLE 2034 ms 860 KB
sample_03.txt TLE 2029 ms 808 KB