Submission #473283

#TimeUsernameProblemLanguageResultExecution timeMemory
473283Ahmadsm2005Genetics (BOI18_genetics)C++14
27 / 100
1022 ms5636 KiB
#include <bits/stdc++.h> #define endl '\n' #define modulo 998244353 #define modulo2 998244353 #define eps 0.00000001 #define int long long #define PI acos(-1) #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") //#pragma GCC optimize("trapv") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops") #define sinDegrees(x) sin((x) * PI / 180.0) #define cosDegrees(x) cos((x) * PI / 180.0) #define tanDegrees(x) tan((x) * PI / 180.0) #define atanDegrees(x) atan(x)* 180.0 / PI #define asinDegrees(x) asin(x)* 180.0 / PI #define EPS 0.000000001 using namespace std; int power(int x,int y,int m=modulo) { if(y<0) return 0; int temp; if(y == 0) return 1; temp = (power(x, y/2,m))%m; if (y%2 == 0) return ((temp%m)*temp)%m; else return ((x*temp%m)*temp%m)%m; } int inv(int x,int m=modulo) { return (power(x,m-2,m))%m; } int n,m,k; string s; vector<string>lolz; int COMP(int x,int y){ int K=0; for(int i=0;i<m;i++) if(lolz[x][i]!=lolz[y][i]) K++; return K; } map<string,int>lol; int32_t main() { cin.tie(0),iostream::sync_with_stdio(0); //freopen("halfnice.in","r",stdin); cin>>n>>m>>k; for(int i=0;i<n;i++){ cin>>s; lolz.push_back(s); lol[s]++; } for(int i=0;i<n;i++){ if(lol[lolz[i]]-1)continue; for(int l=0;l<2000;l++){ int X=rand()%n; if(X==i){ l--; continue; } if(COMP(i,X)!=k) goto a; } cout<<i+1<<endl; a:; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...