Submission #1269547

#TimeUsernameProblemLanguageResultExecution timeMemory
1269547SamAndMigrations (IOI25_migrations)C++20
Compilation error
0 ms0 KiB
#include "migrations.h" #include <cassert> #include <cstdio> int main() { int N; assert(1 == scanf("%d", &N)); std::vector<int> P(N, 0); for (int i = 1; i < N; ++i) { assert(1 == scanf("%d", &P[i])); } std::vector<int> S(N, 0); for (int i = 1; i < N; ++i) { S[i] = send_message(N, i, P[i]); } for (int i = 1; i < N; ++i) { printf("%d%c", S[i], " \n"[i + 1 == N]); } auto [U, V] = longest_path(S); printf("%d %d\n", U, V); fclose(stdout); return 0; } /* 41 0 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 */

Compilation message (stderr)

/usr/bin/ld: /tmp/ccL6F4sW.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccHYYVJd.o:migrations.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccHYYVJd.o: in function `main':
migrations.cpp:(.text.startup+0xf8): undefined reference to `send_message(int, int, int)'
/usr/bin/ld: migrations.cpp:(.text.startup+0x1d1): undefined reference to `longest_path(std::vector<int, std::allocator<int> >)'
/usr/bin/ld: /tmp/ccL6F4sW.o: in function `main':
stub.cpp:(.text.startup+0xa9): undefined reference to `send_message(int, int, int)'
/usr/bin/ld: stub.cpp:(.text.startup+0x230): undefined reference to `longest_path(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status