| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1285772 | eri16 | 3개의 봉우리 (IOI25_triples) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "triples.h"
using namespace std;
long long count_triples(vector<int> h) {
tt=h.size();
long long ans=0;
for (int i=0; i<n; i++){
for (int j=i; j<n; j++){
for (int t=j; t<n; t++){
vector <int> v,v1;
v.push_back(h[i]);
v.push_back(h[i]);
v.push_back(h[i]);
v1.push_back(j-i);
v1.push_back(t-j);
v1.push_back(t-i);
sort(v.begin(),v.end());
sort(v1.begin(),v1.end());
int qwe=1;
for (int zz=0; zz<3; zz++){
if (v[zz]!=v1[zz]){qwe=0;}
}
ans+=qwe;
}
}
}
return(ans);
}
vector<int> construct_range(int M, int K) {}
