Submission #1250642

#TimeUsernameProblemLanguageResultExecution timeMemory
1250642Cebrayil09Triple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
#include "triple.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long

long long count_triples(vector<int> h) {
    ll cnt = 0;

    for(int i = 0;i < h.size();i++) {
        int j = -1, k = -1;
        if(h[i] <= i) {
            int jn = i - h[i];
            int kn = jn + h[jn];

            if(h[kn] == i - kn) {
                cnt++;

                j = jn;
                k = kn;
            }

            kn = i - h[jn];

            if(h[kn] == kn - jn) {
                if(j != jn || k != kn) {
                    cnt++;
                }
            }
        }

    }

    return cnt;
}

Compilation message (stderr)

triples.cpp:1:10: fatal error: triple.h: No such file or directory
    1 | #include "triple.h"
      |          ^~~~~~~~~~
compilation terminated.