제출 #1097369

#제출 시각아이디문제언어결과실행 시간메모리
1097369vjudge1Genetics (BOI18_genetics)C++17
100 / 100
269 ms33620 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; int n,m,k; ll conststring[5000],Sum,pos[70][5000]; string xau[5000]; mt19937 rd(chrono::steady_clock::now().time_since_epoch().count()); #define rand rd ll Rand(ll l,ll h) { assert(l <= h); return l + rd() * 1LL * rd() % (h - l + 1); } void Solve() { for(int i=1;i<=n;i++) { ll tong=0; for(int j=1;j<=m;j++) { tong+=pos[xau[i][j]-'A'][j]-conststring[i]; } if(tong==(Sum-conststring[i])*(m-k)) { cout<<i; return; } } } void Input() { cin>>n>>m>>k; Sum=0; for(int i=1;i<=n;i++) { cin>>xau[i]; xau[i]=" "+xau[i]; conststring[i]=abs(Rand(78,1000000)); Sum+=conststring[i]; for(int j=1;j<=m;j++) { pos[xau[i][j]-'A'][j]+=conststring[i]; } } } int main() { Input(); Solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...