Submission #6809693


Source Code Expand

Copy
/*
THE BEST IS YET TO COME
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define r(i,s,l) for(int i=s;i<l;i++)
#define mod 1000000007
#define INT_BITS 32
#define ld long double
#define pp pair<long long,long long>
#define ss second
#define ff first
#define N 2000005
#define all(a) a.begin(),a.end()
#define pb push_back
using namespace std;
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}

int main(){
    fast();
    int n;
    cin>>n;
    string s;
    unordered_map<string,int> mp;
    r(i,0,n)
    {
        string s;
        cin>>s;
        sort(all(s));
        mp[s]++;
    }
    ll ct=0;
    for(auto i=mp.begin();i!=mp.end();i++)
    {
        ll x=i->second;
        ct+= (x*(x-1))/2;
    }
    cout<<ct;
	return 0;
}

Submission Info

Submission Time
Task C - Green Bin
User codehard321
Language C++14 (GCC 5.4.1)
Score 300
Code Size 838 Byte
Status AC
Exec Time 67 ms
Memory 10660 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 13
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 AC 1 ms 256 KB
a02 AC 1 ms 256 KB
a03 AC 1 ms 256 KB
b04 AC 1 ms 256 KB
b05 AC 37 ms 1792 KB
b06 AC 40 ms 1792 KB
b07 AC 37 ms 256 KB
b08 AC 65 ms 10660 KB
b09 AC 67 ms 10532 KB
b10 AC 65 ms 10660 KB
b11 AC 37 ms 256 KB
b12 AC 57 ms 7588 KB
b13 AC 2 ms 384 KB