| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 403952 | Iwanttobreakfree | Martian DNA (IOI16_dna) | C++98 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dna.h"
#include <string>
#include <cstdlib>
#include <set>
using namespace std;
string analyse(int n, int t){
string str,prueba;
bool first=false,posz,poso;
set<string> s;
while(true){
poso=posz=true;
if(str.length()==n)return str;
if(!first){
prueba=str+'0';
int k=prueba.length();
for(string x:s){
int m=x.length();
for(int i=0;i<k-m;i++){
if(prueba.substr(i,m)==x){
posz=false;
}
}
}
if(make_test(str+'0')&&posz){
str+='0';
continue;
}
else if(posz)s.insert(str+'0');
prueba=str+'1';
int k=prueba.length();
for(string x:s){
int m=x.length();
for(int i=0;i<k-m;i++){
if(prueba.substr(i,m)==x){
poso=false;
}
}
}
if(make_test(str+'1')&&poso){
str+='1';
continue;
}
else if(poso)s.insert(str+'1');
first=true;
}
if(first){
prueba='0'+str;
int k=prueba.length();
for(string x:s){
int m=x.length();
for(int i=0;i<k-m;i++){
if(prueba.substr(i,m)==x){
posz=false;
}
}
}
if(make_test('0'+str)&&posz){
str='0'+str;
continue;
}
else if(posz)s.insert('0'+str);
prueba='1'+str;
int k=prueba.length();
for(string x:s){
int m=x.length();
for(int i=0;i<k-m;i++){
if(prueba.substr(i,m)==x){
poso=false;
}
}
}
if(make_test('1'+str)&&poso){
str='1'+str;
continue;
}
else if(poso)s.insert('1'+str);
}
}
}
