| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 60274 | kingpig9 | Martian DNA (IOI16_dna) | C++11 | 22 ms | 760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "dna.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define fillchar(a, s) memset((a), (s), sizeof(a))
string analyse (int n, int t) {
//find zeroes max
int lo = 0, hi = n + 1;
while (hi - lo > 1) {
int mid = (lo + hi) / 2;
if (make_test(string(mid, '0'))) {
lo = mid;
} else {
hi = mid;
}
}
if (lo == n) {
return string(n, '0');
}
if (lo == 0) {
return string(n, '1');
}
int mxzero = lo;
string ans(mxzero, '0');
for (int i = 0; i < n - mxzero; i++) {
if (make_test(ans + '1')) {
ans += '1';
} else {
int end0 = 0;
for (int j = ans.size() - 1; j >= 0; j--) {
if (ans[j] != '0') {
break;
}
end0++;
}
if (end0 > mxzero) {
break;
}
ans += '0';
}
}
lo = mxzero;
hi = ans.size() + 1;
while (hi - lo > 1) {
int mid = (lo + hi) / 2;
if (make_test(ans.substr(0, mid))) {
lo = mid;
} else {
hi = mid;
}
}
ans = ans.substr(0, lo);
while (ans.size() < n) {
if (make_test('1' + ans)) {
ans = '1' + ans;
} else {
ans = '0' + ans;
}
}
return ans;
}
컴파일 시 표준 에러 (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... | ||||
