# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
115517 | onjo0127 | Mechanical Doll (IOI18_doll) | C++11 | 30 ms | 2232 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 "doll.h"
#include <bits/stdc++.h>
using namespace std;
void create_circuit(int M, vector<int> A) {
int N = A.size();
vector<int> C(M + 1);
C[0] = -1; C[1] = -1;
int i;
for(i=1; (1<<i)<=N; i++);
vector<int> X(i), Y(i);
int x = N;
vector<int> S;
while(x) {
S.push_back(x%2);
x /= 2;
}
reverse(S.begin(), S.end());
for(int j=0; j<i; j++) X[j] = -1, Y[j] = -j-2;
Y[i-1] = 0;
for(int i=0; i<S.size(); i++) {
if(S[i]) X[i] = 1;
}
answer(C, X, Y);
}
Compilation message (stderr)
# | 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... |