# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
923357 | vjudge1 | Hidden Sequence (info1cup18_hidden) | C++11 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "grader.h"
using namespace std;
vector<int>findSequence(int n){
vector<int>t;
while(isSubsequence(t)){
t.push_back(t.size()%2);
}
if(t.empty()){
exit(-1);
}
t.pop_back();
t.insert(t.begin(),1);
if(!isSubsequence(t)){
if(t.empty()){
exit(-1);
}
t.erase(t.begin());
}
vector<int>ans;
for(int i=0;i<t.size();i++){
vector<int>r=t;
int cnt=0;
while(isSubsequence(r)){
r.insert(r.begin()+i,t[i]);
cnt++;
}
for(int j=1;j<=cnt;j++){
ans.push_back(t[i]);
}
}
return ans;
}