Submission #430067

#TimeUsernameProblemLanguageResultExecution timeMemory
430067TheWilpMechanical Doll (IOI18_doll)C++14
0 / 100
6 ms5068 KiB
#include "doll.h" #include <vector> std::vector<int> f[100005]; int cnt = 1; std::vector<int> C; std::vector<int> X; std::vector<int> Y; int create(int pos,int left,int right){ if(right == left) return f[pos][left]; int node_create = cnt; cnt++; int mid = (right + left) / 2; X.push_back(0);Y.push_back(0); X[node_create - 1] = create(pos,left,mid); Y[node_create - 1] = create(pos,mid + 1,right); return -node_create; } void create_circuit(int M, std::vector<int> A) { for(int q = 1;q<A.size();q++){ f[A[q - 1]].push_back(A[q]); } f[A.back()].push_back(0); C.push_back(A[0]); for(int q = 1 ;q<=M;q++){ C.push_back(create(q,0,f[q].size())); } answer(C,X,Y); }

Compilation message (stderr)

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:22:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |     for(int q = 1;q<A.size();q++){
      |                   ~^~~~~~~~~
#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...