Problem D
Accepts: 2519
Submissions: 7501
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
#include <string>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <map>
#include <cstring>
using namespace std;
char str[100005];
map<string, int> num;
int main()
{
int n,strlen1;
scanf("%d",&n);
while (n--)
{
scanf("%s", str);
strlen1=strlen(str);
sort(str,str + strlen1);
printf("%d\n", num[str]);
num[str]++;
}
return 0;
}