Submission #1285772

#TimeUsernameProblemLanguageResultExecution timeMemory
1285772eri163개의 봉우리 (IOI25_triples)C++20
Compilation error
0 ms0 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) {}

Compilation message (stderr)

triples.cpp: In function 'long long int count_triples(std::vector<int>)':
triples.cpp:8:5: error: 'tt' was not declared in this scope; did you mean 'tm'?
    8 |     tt=h.size();
      |     ^~
      |     tm
triples.cpp:12:21: error: 'n' was not declared in this scope
   12 |     for (int i=0; i<n; i++){
      |                     ^
triples.cpp: In function 'std::vector<int> construct_range(int, int)':
triples.cpp:55:44: warning: no return statement in function returning non-void [-Wreturn-type]
   55 | vector<int> construct_range(int M, int K) {}
      |                                            ^