View Code of Problem 3935

#include<iostream>
#include<map>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	map<string,int> mp;
	int k = 0;
	while(n --)
	{
		string s;
		cin >> s;
		mp[s] = k ++;
	}
	int t;
	cin >> t;
	while(t --)
	{
		int x, y;
		cin >> x >> y;
		for(auto a : mp)
		{
			if(a.second == y) cout << a.first << endl;
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3935