# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1126156 | Captain_Georgia | Hidden Sequence (info1cup18_hidden) | C++20 | 7 ms | 420 KiB |
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
vector<int> findSequence (int N) {
int low = 0, high = N + 1;
vector<int> tmp;
while (low < high) {
int mid = (low + high + 1) / 2;
tmp.clear();
for (int i = 0;i < mid;i ++) tmp.push_back(0);
if (isSubsequence (tmp) == true) {
low = mid;
} else {
high = mid - 1;
}
}
vector<int> answer;
int cnt_zero = low;
N -= low;
for (int i = 0;i < cnt_zero;i ++) {
low = 0;
high = N + 1;
while (low < high) {
int mid = (low + high + 1) / 2;
tmp.clear();
for (int j = 0;j < i;j ++) {
tmp.push_back(0);
}
for (int j = 0;j < mid;j ++) {
tmp.push_back(1);
}
for (int j = i;j < cnt_zero;j ++) {
tmp.push_back(0);
}
if (isSubsequence (tmp) == true) {
low = mid;
} else {
high = mid - 1;
}
}
for (int j = 0;j < low;j ++) {
answer.push_back(1);
}
answer.push_back(0);
N -= low;
}
for (int i = 0;i < N;i ++) answer.push_back(1);
return answer;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |