Submission #1250049

#TimeUsernameProblemLanguageResultExecution timeMemory
1250049s4dz3개의 봉우리 (IOI25_triples)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
std::vector<int> construct_range(int M, int K)
{
    return{};
}
long long count_triples(const vector<int>& H)
{
    int n = H.size();
    ll ans = 0;
    for (int k = 0; k < n; k++)
    {
        int c = H[k];
        int i = k - c;
        if (i < 0 || i >= n) continue;

        int a = H[i];
        if (a > c - a) continue;

        int need = c - a;
        int j1   = i + a;
        int j2   = k - a;
        if (i < j1 && j1 < k && H[j1] == need) ans++;
        if (j2 != j1 && i < j2 && j2 < k && H[j2] == need) ans++;
    }
    return ans;
}

Compilation message (stderr)

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