-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSBANK.cpp
More file actions
33 lines (29 loc) · 707 Bytes
/
SBANK.cpp
File metadata and controls
33 lines (29 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* http://www.spoj.com/problems/SBANK/ */
#include<string>
#include<stdio.h>
#include<map>
#include<iostream>
using namespace std;
int main(){
//freopen ("SBANK.in","r",stdin);
map<string,int> myMap;
map<string,int>::iterator it;
int n,t;
string aux;
char myString[256];
scanf("%d",&t);
for(int i=0;i<t;i++){
scanf("%d",&n);
gets(myString); //?
for(int j=0;j<n;j++){
gets(myString);
aux=myString;
myMap[aux]++;
}
for(it=myMap.begin();it!=myMap.end();it++) printf("%s %d\n",it->first.c_str(),it->second);
printf("\n");
myMap.clear();
}
//fclose (stdin);
return 0;
}