제출 #954202

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9542022024-03-27 11:44:04AlanGenetics (BOI18_genetics)C++17
0 / 100
2033 ms119260 KiB
#include <bits/stdc++.h>
using namespace std;
string s[4105], t[4105];
map<string, int> mp;
bool bad[4105];
int n, m, k, id[4105];
mt19937 r (chrono::high_resolution_clock().now().time_since_epoch().count());
int rnd (int mn, int mx) {
return uniform_int_distribution<int> (mn, mx) (r);
}
int diff (int x, int y) {
int cnt = 0;
for (int i = 0; i < (int) s[x].size(); i++) cnt += s[x][i] != s[y][i];
return cnt;
}
int solve () {
for (int i = n; i >= 1; i--) {
int swp = rnd(1, i);
swap(s[i], s[swp]);
swap(id[i], id[swp]);
}
for (int i = 1; i <= n; i++) bad[i] = mp[s[i]] > 1;
deque<int> dq;
for (int i = 1; i <= n; i++) if (!bad[i]) {
while (i <= n && !dq.empty() && diff(dq.back(), i) != k) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...