| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 963368 | biank | Hidden Sequence (info1cup18_hidden) | C++14 | 5 ms | 1460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
#define sz(x) int(x.size())
int query(int k, int a, int b) {
vector<int> s(a, k);
while (b--) s.push_back(k ^ 1);
return k ^ 1 ^ isSubsequence(s);
}
vector<int> findSequence(int N) {
vector<int> s0, s1;
int n = 0, k = -1;
while (true) {
s0.push_back(0);
if (!isSubsequence(s0)) {
k = 0;
break;
}
s1.push_back(1);
if (!isSubsequence(s1)) {
k = 1;
break;
}
n++;
}
int m = N - n;
vector<int> ans;
int i = 0, j = 0;
while (i < n && j < m) {
int x = -1;
if (i + m - j < j + n - i) {
x = query(k, i + 1, m - j);
} else {
x = query(k ^ 1, j + 1, n - i);
}
if (x == k) i++;
else j++;
ans.push_back(x);
}
while (i < n) ans.push_back(k), i++;
while (j < m) ans.push_back(k ^ 1), j++;
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
