Submission #601609

#TimeUsernameProblemLanguageResultExecution timeMemory
601609enerelt14Mechanical Doll (IOI18_doll)C++14
6 / 100
63 ms12828 KiB
#include "doll.h" #include<bits/stdc++.h> #define pb push_back using namespace std; void create_circuit(int M, vector<int>A){ vector<int>adj[M+1], c(M+1), x, y; c[0]=A[0]; A.pb(0); for (int i=0;i<A.size()-1;i++){ adj[A[i]].pb(A[i+1]); } int num=0; for (int i=1;i<=M;i++){ if (adj[i].size()==0)c[i]=0; else if(adj[i].size()==1)c[i]=adj[i][0]; else{ num++; c[i]=-num; x.pb(adj[i][0]); y.pb(adj[i][1]); } } answer(c, x, y); }

Compilation message (stderr)

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