# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
973626 | penguin133 | Hidden Sequence (info1cup18_hidden) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
vector < int > findSequence (int N)
{
vector <int> x;
for(int i = 0; i < N / 2 + 1; i++)x.push_back(0);
if(isSubsequence(x)){
int ones = 0;
while(1){
x.clear();
for(int i = 0; i < ones + 1; i++)x.push_back(1);
if(isSubsequence(x))ones++;
else break;
}
vector <int> ans;
for(int i = 0; i < ones; i++){
int zrs = 0;
while(1){
vector <int> qry;
for(int j = 0; j < zrs + 1; j++)qry.push_back(0);
for(int j = 0; j < ones - i; j++)qry.push_back(1);
if(isSubsequence(qry))zrs++;
else break;
}
for(int j = 0; j < zrs; j++)ans.push_back(0);
ans.push_back(1);
}
while(ans.size() < N)ans.push_back(0);
return ans;
}
else{
int ones = 0;
while(1){
x.clear();
for(int i = 0; i < ones + 1; i++)x.push_back(0);
if(isSubsequence(x))ones++;
else break;
}
vector <int> ans;
for(int i = 0; i < ones; i++){
int zrs = 0;
while(1){
vector <int> qry;
for(int j = 0; j < zrs + 1; j++)qry.push_back(1);
for(int j = 0; j < ones - i; j++)qry.push_back(0);
if(isSubsequence(qry))zrs++;
else break;
}
for(int j = 0; j < zrs; j++)ans.push_back(1);
ans.push_back(0);
}
while(ans.size() < N)ans.push_back(1);
return ans;
}
}