Submission #1307811

#TimeUsernameProblemLanguageResultExecution timeMemory
1307811exoworldgdTriple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0) using namespace std; using ll=long long; ll count_triples(vector<int>h){ int n=h.size(); set<set<int>>s; for(int i=0;i<n;i++)for(int j=i+1;j<n;j++)for(int id:{i,j})for(int dist:{h[i],h[j]})for(int k:{id-dist,id+dist}){ if(k>=0&&k<n&&k^i&&k^j){ vector<int>a={h[i],h[j],h[k]},b={abs(i-j),abs(i-k),abs(j-k)}; sort(a.begin(),a.end()),sort(b.begin(),b.end()); if(a==b)s.insert({i,j,k}); } } return triples.size(); } vector<int>construct_range(int m,int k){ vector<int>res; int pat[]={1,2,1,3,2,1,4,3,2,1},sz=10; for(int i=0;i<m;i++)res.push_back(pat[i%sz]); return res; }

Compilation message (stderr)

triples.cpp: In function 'll count_triples(std::vector<int>)':
triples.cpp:15:12: error: 'triples' was not declared in this scope
   15 |     return triples.size();
      |            ^~~~~~~