1 solutions

  • 0
    @ 2025-5-10 14:56:58
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	map<string,int> hash;
    	long long res=0;
    	for(int i=1;i<=n;i++)
    	{
    		string s;
    		cin>>s;
    		sort(s.begin(),s.end());
    		res+=hash[s];
    		hash[s]++;
    	} 
    	cout<<res;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2226
    Time
    2000ms
    Memory
    1024MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    5
    Accepted
    2
    Uploaded By