Hunan University of Technology Innovation Laboratory 2015 Freshman (i) 1009 (re-opened)

Source: Internet
Author: User

Score Statistics Time limit:3000/1000ms (java/other) Memory limit:65535/32768k (Java/other) total submission (s): Accepted Su Bmission (s): 19font:times New Roman | Verdana | Georgiafont Size:←→problem Description Double 12 problem processing finished, Ikids seniors again met a
Thorny question now ikids seniors have a lot of people to count them
The total number, need your help, ikids seniors afraid of problems too
Trouble, the kind of people are numbered. Input inputs contain multiple sets of inputs

Enter M, m for m record
Each record contains two integers, each representing the person's number and score
M < 1000
Number, score < 1E9 + 7;output will all recorded people follow the number from small to large way
Output their numbers, fractions. Sample Input
52 33 24 22 12 1
Sample Output
2 53 24 2
Simple usage of Authoraoxuets map
#include <stdio.h>//#include <bits/stdc++.h> #include <string.h> #include <iostream> #include <math.h> #include <sstream> #include <set> #include <queue> #include <map> #include < vector> #include <algorithm> #include <limits.h> #define INF 0x3fffffff#define Lson l,m,rt<<1#    Define Rson m+1,r,rt<<1|1#define LL long longusing namespace std;map<string,int>q;struct p{string s; int num;}    Hehe[10000];bool cmd (P x,p y) {if (X.S&LT;Y.S) return 1; return 0;}   int main () {int t;   int i;   string S;   int num;          while (cin>>t) {for (i=0;i<t;i++) {cin>>hehe[i].s>>hehe[i].num;       Q[hehe[i].s]+=hehe[i].num;       }//Cout<<q.size () <<endl;       Map<string,int>::iterator it;        For (It=q.begin (); It!=q.end (); it++) {cout<<it->first<< "" <<it->second<<endl;   } q.clear (); } return 0;}

  

Hunan University of Technology Innovation Laboratory 2015 Freshman (i) 1009 (re-opened)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.