Submission #1249470

#TimeUsernameProblemLanguageResultExecution timeMemory
1249470lunarechoTriple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
#include "triples.h" #include <bits/stdc++.h> using namespace std; using ll = long long; bool is(int i, int j, int k, int hi, int hj, int hk) { int d1 = j - i, d2 = k - i, d3 = k - j; bool cond1 = (d1 == hi && d2 == hj && d3 == hk); bool cond2 = (d1 == hi && d2 == hk && d3 == hj); bool cond3 = (d1 == hj && d2 == hi && d3 == hk); bool cond4 = (d1 == hj && d2 == hk && d3 == hi); bool cond5 = (d1 == hk && d2 == hi && d3 == hj); bool cond6 = (d1 == hk && d2 == hj && d3 == hi); return cond1 && cond2 && cond3 && cond4 && cond5 && cond6; } long long count_triples(std::vector<int> h) { int n = h.size(); ll cnt = 0; for(int i=0;i<n;++i) { for(int j=i+1;j<n;++j) { for(int k=j+1;k<n;++k) { if(is(i,j,k,h[i],h[j],h[k])) ++cnt; } } } return cnt; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccG2jwBo.o: in function `main':
grader.cpp:(.text.startup+0x18a): undefined reference to `construct_range(int, int)'
collect2: error: ld returned 1 exit status