# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1132228 | HappyCapybara | Martian DNA (IOI16_dna) | C++20 | 9 ms | 328 KiB |
#include "dna.h"
#include <bits/stdc++.h>
using namespace std;
string analyse(int n, int t) {
string cur = "";
int a = 0;
bool b = false;
while (cur.size() < n || !b){
if (a == 15 || cur.size() == n){
if (make_test(cur)) a = 0;
else {
int l = cur.size()-a, r = cur.size()+1;
//cout << l << " " << r << "\n";
while (l != r-1){
int m = (l+r)/2;
if (make_test(cur.substr(0, m))) l = m;
else r = m;
}
cur = cur.substr(0, l);
a = 0;
b = true;
if (cur.size() == n) return cur;
}
}
if (!b){
string c = "1";
string d = "0";
if (rand() < RAND_MAX/2){
c = "0";
d = "1";
}
if (make_test(cur+c)){
cur = cur+c;
a = 0;
}
else {
cur = cur+d;
a++;
}
}
else {
if (make_test("0"+cur)) cur = "0"+cur;
else cur = "1"+cur;
}
//cout << cur << "\n";
}
return cur;
}
컴파일 시 표준 에러 (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... |