Submission #1162762

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11627622025-03-06 18:03:43vj09743Mechanical Doll (IOI18_doll)C++20
Compilation error
0 ms0 KiB
//
// Created by Viraj Verma on 06/03/2025.
//
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
auto answer(vector<int> C, vector<int> X, vector<int> Y);
void create_circuit() {
int M;
int N;
cin>>M>>N;
unordered_map<int, vector<int>> adjacency_list(M);
vector<int> c (M+1);
vector<int> travel_guide;
int place = 0;
for (int i = 0; i<N; i++) {
int destination;
cin>>destination;
adjacency_list[place].push_back(destination);
place = destination;
}
adjacency_list[place].push_back(0);
int switch_namer = -1;
vector<int> X;
vector<int> Y;
for (int i = 0; i <= M; i++) {
vector<int> adjacents = adjacency_list[i];
if (adjacents.size() == 1) {
c[i] = adjacents[0];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

doll.cpp: In function 'void create_circuit()':
doll.cpp:42:11: error: use of 'auto answer(std::vector<int>, std::vector<int>, std::vector<int>)' before deduction of 'auto'
   42 |     answer(c, X, Y);
      |     ~~~~~~^~~~~~~~~