# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1126158 | qrn | Hidden Sequence (info1cup18_hidden) | C++20 | 8 ms | 424 KiB |
#include<bits/stdc++.h>
#include "grader.h"
#define pb push_back
#define endl "\n"
#define ALL(x) x.begin(), x.end()
using namespace std;
vector<int> findSequence (int N) {
int initN = N;
int l = 0, r = N + 1, numzero = 0;
while(l <= r) {
int mid = (l + r) / 2;
vector<int> seq;
for(int i = 0; i < mid; i++) seq.pb(0);
if(isSubsequence(seq)) {
numzero = mid;
l = mid + 1;
} else {
r = mid - 1;
}
}
N -= numzero;
vector<int>ans;
for(int cnt = 0; cnt <= numzero; cnt++) {
int l = 0, r = N + 1, numone = 0;
while(l <= r) {
int mid = (l + r) / 2;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |