Submission #1162760

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11627602025-03-06 17:57:08vj09743Mechanical 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;
int main() {
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;
for (int i = 0; i <= M; i++) {
vector<int> adjacents = adjacency_list[i];
if (adjacents.size() == 1) {
c[i] = adjacents[0];
}
else if (adjacents.size() == 2) {
c[i] = int(switch_namer);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

/usr/bin/ld: /tmp/ccr8SYzS.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc6gAOOc.o:doll.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccr8SYzS.o: in function `main':
grader.cpp:(.text.startup+0x168): undefined reference to `create_circuit(int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status