# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
470497 | 2021-09-04T05:49:07 Z | Cross_Ratio | Mechanical Doll (IOI18_doll) | C++14 | 1 ms | 204 KB |
#include <bits/stdc++.h> #include "doll.h" using namespace std; void create_circuit(int M, vector<int> A) { int sz; int i; int N = A.size(); for(sz=1;sz<2*N;sz*=2) {} vector<int> C, X, Y; C.resize(M+1); fill(C.begin(),C.end(),-1); X.resize(sz); Y.resize(sz); for(i=1;i<sz/2;i++) { X[i] = -2*i; Y[i] = -2*i-1; } vector<bool> isX(sz, true); for(i=0;i<sz/2;i++) { int pt = 1; while(pt<sz/2) { if(isX[pt]) { isX[pt] = false; pt = 2*pt; } else { isX[pt] = true; pt = 2*pt + 1; } } bool isXp = 1 - pt % 2; pt /= 2; if(isXp) { if(i==sz/2-1) X[pt] = 0; else if(i < N) X[pt] = A[i]; else X[pt] = -1; } else { if(i==sz/2-1) Y[pt] = 0; else if(i < N) Y[pt] = A[i]; else Y[pt] = -1; } } for(i=0;i<X.size()-1;i++) { X[i] = X[i+1]; Y[i] = Y[i+1]; } X.pop_back(); Y.pop_back(); answer(C, X, Y); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |