# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
963354 | Kalata_56 | Martian DNA (IOI16_dna) | C++17 | 12 ms | 684 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;
string dna;
string dna2;
string analyse(int n,int t){
int l=0,r=n+1;
while(l<r-1){
//cout<<"lala"<<endl;
int mid=(l+r)/2;
dna="";
for(int i=0;i<mid;i++){
dna+="0";
}
if(make_test(dna)){
l=mid;
}else{
r=mid;
}
}
dna="";
if(l==0){
for(int i=0;i<n;i++){
dna+="1";
}
return dna;
}
//cout<<"nuli\n";
for(int i=0;i<l;i++){
dna+="0";
}
//cout<<dna<<endl;
int kolko=0;
while(kolko<=l){
//cout<<"kude"<<endl;
dna+="1";
if(make_test(dna)){
kolko=0;
}else{
dna.pop_back();
dna.push_back('0');
kolko++;
}
}
//cout<<dna<<endl;
while(dna[dna.size()-1]=='0'){
dna.pop_back();
}
l=0;
r=n+1;
while(l<r-1){
int mid=(l+r)/2;
for(int i=0;i<mid;i++){
dna+="0";
}
if(make_test(dna)){
l=mid;
}else{
r=mid;
}
for(int i=0;i<mid;i++){
dna.pop_back();
}
}
for(int i=0;i<l;i++){
dna+="0";
}
//cout<<"otzad\n";
//cout<<dna<<endl;
for(int i=dna.size();i<n;i++){
dna2="0"+dna;
if(make_test(dna2)){
dna=dna2;
}else{
dna="1"+dna;
}
}
return dna;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |