Submission #1088390

#TimeUsernameProblemLanguageResultExecution timeMemory
1088390whtthAnagramistica (COCI21_anagramistica)C++14
0 / 110
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; long long n, k, f[2000010], cnt=0, mod=1e9+7, dp[2010], ans=0; string S[2010]; unordered_map<string, long long> thutu; long long modpow(int a, int b){ int s=a; for(int i=1;i<=b;i++){ a*=s; a%=mod; } return a; } int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); //freopen("anagramistica.inp", "r", stdin); //freopen("anagramistica.out", "w", stdout); cin>>n>>k; for(int i=1;i<=n;i++){ cin>>S[i]; sort(S[i].begin(), S[i].end()); } for(int i=1;i<=n;i++){ thutu[S[i]]++; } for(auto x : thutu){ f[x.second*(x.second-1)/2]++; } if(k==0){ long long ko=modpow(2, f[0]); cout<<ko; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...