Submission #13288218


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}
const int MOD = 1000000007;

int main() {
    int n; cin >> n;string s[n];
    map<string,ll> ma;
    int cnt = 0;
    for(int i = 0;i < n;i++){
        string x; cin >> x;
        sort(x.begin(),x.end());
        ma[x]++;
    }
   ll sum  = 0;
      for(auto e:ma){
          ll tmp = e.second*(e.second-1)/2;
          sum += tmp;
      }
    cout<<sum<<endl;
}

Submission Info

Submission Time
Task C - Green Bin
User yutaosa
Language C++14 (GCC 5.4.1)
Score 300
Code Size 533 Byte
Status AC
Exec Time 167 ms
Memory 11904 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 119 ms 2688 KB
b06 AC 117 ms 2688 KB
b07 AC 96 ms 1024 KB
b08 AC 167 ms 11904 KB
b09 AC 165 ms 11776 KB
b10 AC 164 ms 11904 KB
b11 AC 91 ms 1024 KB
b12 AC 143 ms 8448 KB
b13 AC 2 ms 384 KB