# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1251123 | aryan12 | Triple Peaks (IOI25_triples) | C++20 | 0 ms | 0 KiB |
#include "triples.h"
#include <bits/stdc++.h>
long long count_triples(std::vector<int> H) {
long long ans = 0;
int N = H.size();
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> index_diff = {j - i, k - i, k - j};
sort(index_diff.begin(), index_diff.end());
if(index_diff[0] == i && index_diff[1] == j && index_diff[2] == k) {
ans += 1;
}
}
}
}
return ans;
}
std::vector<int> construct_range(int M, int K) {
// std::mt19937_64 RNG(std::chrono::steady_clock::now().time_since_epoch().count());
// std::vector<int> peak_range;
// for(int i = 0; i < M; i++) {
// peak_range.push_back(RNG() % 10 + 5);
// }
// return peak_range;
return {};
}