| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1327209 | mamabear | Martian DNA (IOI16_dna) | C++20 | 10 ms | 504 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');
if (o.size() < n && !make_test(o + '1')) {
} else {
int cnt = 0;
o += '1';
while (o.size() < n && cnt <= l) {
if (make_test(o + '1')) {
o += '1';
cnt = 0;
} else {
o += '0';
cnt++;
}
}
int trim_l = 1, trim_r = n;
while (trim_l < trim_r) {
int mid = (trim_l + trim_r + 1) >> 1;
if (make_test(o.substr(0, mid))) {
trim_l = mid;
} else {
trim_r = mid - 1;
}
}
o = o.substr(0, trim_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... | ||||
