제출 #298722

#제출 시각아이디문제언어결과실행 시간메모리
298722inbarin자동 인형 (IOI18_doll)C++14
0 / 100
1 ms204 KiB
#include <iostream> #include <vector> using namespace std; #define fort(s,e) for(int i = s; i < e; i++) 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; int cs = 0; 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; } } return; }

컴파일 시 표준 에러 (stderr) 메시지

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:11:6: warning: unused variable 'cs' [-Wunused-variable]
   11 |  int cs = 0;
      |      ^~
#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...