| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1307716 | ballbreaker | Martian DNA (IOI16_dna) | C++20 | 14 ms | 508 KiB |
#include "dna.h"
#include<bits/stdc++.h>
using namespace std;
string analyse(int n, int t) {
if (make_test(string(n, '1'))) {
return string(n, '1');
}
int l = 1, r = n;
while (l < r) {
int mid = (l + r + 1) >> 1;
if (make_test(string(mid, '0'))) {
l = mid;
} else {
r = mid - 1;
}
}
string o = string(l, '0');
int cnt = 0;
while (o.size() < n) {
if (make_test(o + '1')) {
o += '1';
cnt++;
} else {
o += '0';
cnt = 0;
}
}
l = 1, r = n;
while (l < r) {
int mid = (l + r + 1) >> 1;
if (make_test(o.substr(0, mid))) {
l = mid;
} else {
r = mid - 1;
}
}
o = o.substr(0, l);
while (o.size() < n) {
if (make_test('0' + o)) {
o = '0' + o;
} else {
o = '1' + o;
}
}
return o;
}
컴파일 시 표준 에러 (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... | ||||
