Submission #1249545

#TimeUsernameProblemLanguageResultExecution timeMemory
1249545Charizard2021Triple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "triples.h" using namespace std; long long count_triples(vector<long long> H){ long long n = (long long)H.size(); if(n <= 100){ long long ans = 0; for(long long i = 0; i < n; i++){ for(long long j = i + 1; j < n; j++){ for(long long k = j + 1; k < n; k++){ vector<long long> v; v.push_back(j - i); v.push_back(k - j); v.push_back(k - i); vector<long long> v2; v2.push_back(H[i]); v2.push_back(H[j]); v2.push_back(H[k]); sort(v2.begin(), v2.end()); sort(v.begin(), v.end()); if(v == v2){ ans++; } } } } return ans; } long long thing = 0; for(long long i = 0; i < n; i++){ thing = max(thing, H[i]); } if(thing <= 10){ long long ans = 0; for(long long i = 0; i + 10 < n; i++){ for(long long j = i + 1; j <= i + 10; j++){ for(long long k = j + 1; k <= i + 10; k++){ vector<long long> v; v.push_back(j - i); v.push_back(k - j); v.push_back(k - i); vector<long long> v2; v2.push_back(H[i]); v2.push_back(H[j]); v2.push_back(H[k]); sort(v2.begin(), v2.end()); sort(v.begin(), v.end()); if(v == v2){ ans++; } } } } return ans; } }

Compilation message (stderr)

triples.cpp: In function 'long long int count_triples(std::vector<long long int>)':
triples.cpp:56:1: warning: control reaches end of non-void function [-Wreturn-type]
   56 | }
      | ^
/usr/bin/ld: /tmp/ccHQHmID.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