UVA 10420 - List of Conquests

Problem PDF

Solution:

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include 
#include 
#include
#define ll long long
#define sc scanf
#define pf printf
#define Pi 2*acos(0.0)
using namespace std;
int main()
{
    int n;
    vectorv;
    mapmp;
    string s,a;
    cin>>n;
    getchar();
    while(n--)
    {
        cin>>s;
        getchar();
        getline(cin,a);
        if(mp[s])
        {
           mp[s]++;
        }
        else
        {
         mp[s]++;
         v.push_back(s);
        }
    }
    sort(v.begin(),v.end());
    for(int i=0;i
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10420/10420.cpp