# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
794854 | bane | Detecting Molecules (IOI16_molecules) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "dna.h"
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
string analyse(int n, int t) {
string ans = "";
int resp = 0;
while(ans.size() < n){
if (19 < resp){
break;
}
ans += '0' + uniform_int_distribution<int>(0,1)(rng);
if (make_test(ans)){
resp = 0;
continue;
}
if (ans.back() == '1')ans.back() = '0';
else ans.back() = '1';
++resp;
}
int r = ans.size() - 1, l = ans.size() - resp;
while(l<=r){
int mid = (l+r) / 2;
if (make_test(ans.substr(0,mid+1))){
l = mid + 1;
}else{
r = mid - 1;