Submission #1249974

#TimeUsernameProblemLanguageResultExecution timeMemory
1249974s4dzTriple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;
/*
    Author: s4dz
*/
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll maxn = 1000005;
const ll inf = 1e9 + 7;
int n, arr[maxn], q, a, b, c;
int st[4 * maxn], lazy[4 * maxn];
void sub4()
{
    ll ans = 0;
    for(int k = 1; k <= n; k++)
    {
        int i = k - arr[k];
        int j1 = i + arr[i];
        int j2 = k - arr[i];
        int temp = arr[i];
        int hj = max(arr[i], arr[k] - arr[i]);
        if(i < j1 && j1 < k && arr[j1] == hj) ans++;
        if(j1 != j2 && j2 > i && j2 < k && arr[j2] == hj) ans++;

    }
    cout << ans;
}
int main()
{
    fastio
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> arr[i];
    }

}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccCYBqpT.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccNbQVUV.o:triples.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccCYBqpT.o: in function `main':
grader.cpp:(.text.startup+0x18a): undefined reference to `construct_range(int, int)'
/usr/bin/ld: grader.cpp:(.text.startup+0x37b): undefined reference to `count_triples(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status