Submission #168872


Source Code Expand

#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;
	map<string, int> S;
	REP(i, N)
	{
		string name;
		cin >> name;
		S[name]++;
	}

	int max = -1;
	string ans;
	FOR(i, S)
	{
		if (max < i.second)
		{
			max = i.second;
			ans = i.first;
		}
	}

}

Submission Info

Submission Time
Task B - 投票
User enigsol
Language C++ (G++ 4.6.4)
Score 0
Code Size 501 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:27:15: error: ‘std::map<std::basic_string<char>, int>::iterator’ has no member named ‘second’
./Main.cpp:29:12: error: ‘std::map<std::basic_string<char>, int>::iterator’ has no member named ‘second’
./Main.cpp:30:12: error: ‘std::map<std::basic_string<char>, int>::iterator’ has no member named ‘first’