简介
简单
code
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;
int main() {
int n;
cin >> n;
int k, v;
map<int, int> m;
for(int i = 0; i<n; i++){
cin >> k >> v;
m[k] += v;
}
for(auto it : m){
cout << it.first << " " << it.second << endl;
}
return 0;
}