제출 #298728

#제출 시각아이디문제언어결과실행 시간메모리
298728inbarin자동 인형 (IOI18_doll)C++14
37 / 100
104 ms8472 KiB
#include "doll.h" #include <iostream> #include <vector> using namespace std; #define fort(s,e) for(int i = s; i < e; i++) void answer(vector<int>a,vector<int>b,vector<int>c); void create_circuit(int m, vector<int> a){ int asc = a.size(); a.push_back(0); vector<int>trig(m+1); vector<int>x,y; fort(0,m+1){ trig[i] = -1; } int asp = 1; vector<int>dec; int jl = 0; while(asc){ jl++; asp*=2; dec.push_back(asc%2); asc/=2; } asc = a.size(); for(int i = 0; i < asp/2-1;i++){ x.push_back(-(i+1)*2); y.push_back(-(i+1)*2-1); } for(int i = asp/2 - 1;i < asp - 1;i++){ x.push_back(-1); y.push_back(-1); } int xl = asp / 2 - asc / 2; int yl = asp / 2 - asc / 2 - asc % 2; int l = 0; for(int i = 0; i < asp;i++){ int ci = i; int rev = 0; int j = 0; while(j < jl){ rev *= 2; rev += ci % 2; ci/=2; j++; } if(rev % 2){ if(asp/2 - 1 - rev/2 < xl){ continue; } l++; x[asp - 2 - rev/2] = a[(int)a.size()-l]; } else { if(asp/2 - 1 - rev/2 < yl){ continue; } l++; y[asp - 2 - rev/2] = a[(int)a.size()-l]; } if(l == (int)a.size()){ break; } } answer(trig,x,y); return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...