Submission #1020919

#TimeUsernameProblemLanguageResultExecution timeMemory
1020919ZicrusMechanical Doll (IOI18_doll)C++17
6 / 100
49 ms12864 KiB
#include <bits/stdc++.h> #include "doll.h" using namespace std; typedef long long ll; vector<int> C, X, Y; void connect(int a, vector<int> b) { if (b.empty()) return; if (b.size() == 1) { C[a] = b[0]; } else { X.push_back(b[0]); Y.push_back(b[1]); C[a] = -X.size(); } } void create_circuit(int M, vector<int> A) { A.push_back(0); C = vector<int>(M + 1); X = vector<int>(); Y = vector<int>(); vector<vector<int>> adj(M + 1); int prev = 0; for(auto &e : A) { adj[prev].push_back(e); prev = e; } for (int i = 0; i < adj.size(); i++) { connect(i, adj[i]); } answer(C, X, Y); return; }

Compilation message (stderr)

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