ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1100. Final Standings

C++ SOLUTION
Posted by em2011_svo 6 Dec 2012 03:12
#include <iostream>
#include <vector>
#include <map>

int main ()
{
    int n;
    std::cin >> n;
    std::map<int, std::vector<int> > count;
    for (int i = 0; i < n; i++)
    {
        int a, b;
        std::cin >> a >> b;
        count [b].push_back (a);
    }
    std::map<int, std::vector<int> >::reverse_iterator it = count.rbegin ();
    while (it != count.rend ())
    {
        int _cnt = it->second.size ();
        for (int i = 0; i < _cnt; i++)
            std::cout << it->second [i] << " " << it->first << std::endl;
        it++;
    }
    return 0;
}
Re: C++ SOLUTION
Posted by namlunoy 17 May 2013 21:55
Thank you! So much! :)