Submission #1162761

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11627612025-03-06 18:01:01vj09743Mechanical 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;
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:41:5: error: 'answer' was not declared in this scope
   41 |     answer(c, X, Y);
      |     ^~~~~~