Submission #1290826

#TimeUsernameProblemLanguageResultExecution timeMemory
1290826ecen30Triple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
//testing AI code #include <vector> #include <algorithm> using namespace std; // Count mythical triples (brute-force; only efficient for N ≤ 100) long long count_triples(const std::vector<int>& H) { int N = H.size(); long long result = 0; for (int i = 0; i < N; ++i) { for (int j = i + 1; j < N; ++j) { for (int k = j + 1; k < N; ++k) { std::vector<int> dists = {j - i, k - i, k - j}; std::vector<int> heights = {H[i], H[j], H[k]}; std::sort(dists.begin(), dists.end()); std::sort(heights.begin(), heights.end()); if (dists == heights) result++; } } } return result; } // Naive stub for range construction (Part II) std::vector<int> construct_range(int M, int K) { int N = std::min(M, 10); // For testing, you can change this logic std::vector<int> H(N); for (int i = 0; i < N; ++i) H[i] = i + 1; return H; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccRiwGwq.o: in function `main':
grader.cpp:(.text.startup+0x367): undefined reference to `count_triples(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status