Contest Duration: - (local time) (100 minutes) Back to Home

Submission #6806434

Source Code Expand

Copy
```#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(ll x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
template<class T>bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

int main(){
cin.tie(0); ios::sync_with_stdio(false);
cout << fixed << setprecision(15);
ll n;
cin >> n;
vs s(n);
map<string, ll> mp;
rep(i, n){
cin >> s[i];
sort(ALL(s[i]));
mp[s[i]]++;
}
//sort(ALL(s));
ll ans = 0;
for(auto&& e: mp){
ans += e.second*(e.second-1)/2;
}
cout << ans << endl;
return 0;
}```

#### Submission Info

Submission Time 2019-08-10 21:06:26+0900 C - Green Bin RTnF C++14 (GCC 5.4.1) 300 1524 Byte AC 136 ms 16640 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 63 ms 7296 KB
b06 AC 73 ms 7296 KB
b07 AC 54 ms 5760 KB
b08 AC 136 ms 16640 KB
b09 AC 118 ms 16512 KB
b10 AC 118 ms 16640 KB
b11 AC 38 ms 5760 KB
b12 AC 94 ms 13184 KB
b13 AC 2 ms 384 KB