Submission #1088388

#TimeUsernameProblemLanguageResultExecution timeMemory
1088388whtthAnagramistica (COCI21_anagramistica)C++14
0 / 110
2 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; }

Compilation message (stderr)

anagramistica.cpp: In function 'int main()':
anagramistica.cpp:16:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     freopen("anagramistica.inp", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
anagramistica.cpp:17:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |     freopen("anagramistica.out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...