超恶心, 经常TL
一定不能用c++的cin cout, 要改用c的printf 和 scanf
还用了stl的map.
// Problem#: 1486
// Author#: Reid Chan
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;
int main() {
int n;
bool f = true;
while (cin >> n) {
if (f) { f = false; }
else { printf("\n"); }
map<int, int> rst;
map<int, int>::iterator it;
int key;
for (int i = 0; i < n; ++i) {
scanf("%d", &key);
rst[key]++;
}
for (it = rst.begin(); it != rst.end(); it++) {
printf("%d %d\n", it->first, it->second);
}
}
return 0;
}