Submission #300797

#TimeUsernameProblemLanguageResultExecution timeMemory
300797TMJNMechanical Doll (IOI18_doll)C++17
0 / 100
1 ms204 KiB
#include "doll.h" #include <bits/stdc++.h> using namespace std; int N; void create_circuit(int M,vector<int>A) { N = A.size(); vector<int>C(M+1,0); vector<int>K=A; vector<int>X,Y; while(K.size()>=2){ vector<int>P; for(int i=0;i+1<K.size();i+=2){ X.push_back(K[i]); Y.push_back(K[i+1]); P.push_back(-(int)X.size()); } if(K.size()&1){ P.push_back(K.back()); } swap(K,P); } C[0]=K.front(); answer(C,X,Y); }

Compilation message (stderr)

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