제출 #566260

#제출 시각아이디문제언어결과실행 시간메모리
566260minhcoolGenetics (BOI18_genetics)C++17
27 / 100
193 ms26828 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define pb push_back #define mp make_pair #define foru(i, l, r) for(int i = l; i <= r; i++) #define ford(i, r, l) for(int i = r; i >= l; i--) typedef pair<int, int> ii; typedef pair<ii, int> iii; typedef pair<ii, ii> iiii; const int N = 4005; const int oo = 1e18 + 7, mod = 1e9 + 7; int n, m, K; int a[N][N]; int ha[256]; int tol[N]; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int rnd(int l, int r){ int temp = rng() % (r - l + 1); temp = (temp + (r - l + 1)) % (r - l + 1); return temp + l; } void process(){ ha[0] = 1, ha[6] = 2, ha['T' - 'A'] = 3, ha[2] = 4; cin >> n >> m >> K; //cout << n << " " << m << " " << K << "\n"; for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++){ char c; cin >> c; a[i][j] = ha[c - 'A']; //cout << a[i][j] << "\n"; } } for(int itr = 1; itr <= 70000; itr++){ //if(se.size() ) int sum = 0; int temp1 = rnd(1, n), temp2 = rnd(1, n); while(temp2 == temp1) temp2 = rnd(1, n); for(int k = 1; k <= m; k++) sum += (a[temp1][k] != a[temp2][k]); //cout << i << " " << j << " " << sum << "\n"; if(sum != K){ tol[temp1] = 1, tol[temp2] = 1; } } for(int i = 1; i <= n; i++){ if(!tol[i]){ cout << i; return; } } //int cnt = 0; } signed main(){ ios_base::sync_with_stdio(0); process(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...