이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Dgrader.cpp
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define all(x) begin(x), end(x)
#define sz(x) ((int) (x).size())
using ll = long long;
using ld = long double;
const int N = 4e5 + 10;
pair<int, int> switches[N];
int next_free = 1;
int create(vector<int> a) {
int result = next_free++;
if (sz(a) == 1) {
switches[result] = {-result, a[0]};
} else if (sz(a) == 2) {
switches[result] = {a[0], a[1]};
} else {
vector<int> left, right;
for (int i = 0; i < sz(a); ++i) {
(i % 2 ? right : left).push_back(a[i]);
}
switches[result] = {
-create(left),
-create(right)
};
}
return result;
}
void create_circuit(int m, vector<int> a) {
while (1) {
int total = sz(a) + 1;
if (!(total & (total - 1))) {
break;
}
a.push_back(-1);
}
a.push_back(0);
create(a);
vector<int> xs, ys;
for (int i = 1; i < next_free; ++i) {
xs.push_back(switches[i].x);
ys.push_back(switches[i].y);
// cout << -i << ": " << switches[i].x << " " << switches[i].y << endl;
}
answer(vector<int>(m + 1, -1), xs, ys);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |