Submission #130210

#TimeUsernameProblemLanguageResultExecution timeMemory
130210rondojim자동 인형 (IOI18_doll)C++17
37 / 100
174 ms12772 KiB
#include "doll.h" #include <bits/stdc++.h> #define maxn 756000 #define loop(i, a, b) for(int i=a;i<b;i++) #define cc(a) cout<< a << endl; using namespace std; vector<int> arr; vector<int> X, Y; int cnt=-1; void ne(vector<int> sez){ int js=-cnt-1; cnt--; X.push_back(0);Y.push_back(0); if(sez.size()==2){ X[js]=sez[0]; Y[js]=sez[1]; } else{ vector<int> l;vector<int> r; loop(i, 0, sez.size()){ if(i%2==0) l.push_back(sez[i]); if(i%2==1) r.push_back(sez[i]); } X[js]=cnt;ne(l); Y[js]=cnt;ne(r); } } void create_circuit(int M, vector<int> A) { vector<int> C(M + 1);loop(i, 0, M+1) C[i]=-1; arr=A; int cr=1;for(;cr<arr.size()+1;cr<<=1); while(arr.size()!=cr) arr.push_back(-1); arr[arr.size()-1]=0; ne(arr); answer(C, X, Y); }

Compilation message (stderr)

doll.cpp: In function 'void ne(std::vector<int>)':
doll.cpp:5:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define loop(i, a, b) for(int i=a;i<b;i++)
......
   24 |         loop(i, 0, sez.size()){
      |              ~~~~~~~~~~~~~~~~       
doll.cpp:24:9: note: in expansion of macro 'loop'
   24 |         loop(i, 0, sez.size()){
      |         ^~~~
doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:36:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |     int cr=1;for(;cr<arr.size()+1;cr<<=1);
      |                   ~~^~~~~~~~~~~~~
doll.cpp:37:21: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   37 |     while(arr.size()!=cr) arr.push_back(-1);
      |           ~~~~~~~~~~^~~~
#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...