Submission #1221514

#TimeUsernameProblemLanguageResultExecution timeMemory
1221514nibertMessage (IOI24_message)C++20
Compilation error
0 ms0 KiB
#include <iostream> #include <fstream> #include <vector> #include <algorithm> using namespace std; vector<int> ucs(vector<int> A, vector<int> B) { int N = A.size(), M = B.size(); vector<vector<int>> dp(N + 1, vector<int>(M + 1, 0)); for (int i = N - 1; i >= 0; --i) { for (int j = M - 1; j >= 0; --j) { if (A[i] == B[j]) { dp[i][j] = 1 + dp[i + 1][j + 1]; } else { dp[i][j] = max(dp[i + 1][j], dp[i][j + 1]); } } } vector<int> lcs; int i = 0, j = 0; bool multiple = false; while (i < N && j < M) { if (A[i] == B[j]) { lcs.push_back(A[i]); i++; j++; } else if (dp[i + 1][j] == dp[i][j] && dp[i][j + 1] == dp[i][j]) { multiple = true; break; } else if (dp[i + 1][j] == dp[i][j]) { i++; } else { j++; } } if (multiple) return {-1}; return lcs; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccGl462j.o: in function `(anonymous namespace)::run_decoder()':
stub.cpp:(.text+0x6a1): undefined reference to `receive_message(std::vector<std::vector<bool, std::allocator<bool> >, std::allocator<std::vector<bool, std::allocator<bool> > > >)'
/usr/bin/ld: /tmp/ccGl462j.o: in function `(anonymous namespace)::run_encoder()':
stub.cpp:(.text+0xc33): undefined reference to `send_message(std::vector<bool, std::allocator<bool> >, std::vector<bool, std::allocator<bool> >)'
collect2: error: ld returned 1 exit status