제출 #1254121

#제출 시각아이디문제언어결과실행 시간메모리
1254121guymmkTriple Peaks (IOI25_triples)C++20
컴파일 에러
0 ms0 KiB
// Source: https://usaco.guide/general/io #include <bits/stdc++.h> #include "triples.h" using namespace std; vector<int> v; int n; map<vector<int>,int>mp; int is_triple(vector<int>g){ sort(g.begin(),g.end()); if(mp[g]||(g[0]==g[1]||g[0]==g[2]||g[1]==g[2])||g[0]<0||g[2]>=n)return 0; mp[g]++; vector<int>a,b; a={g[1]-g[0],g[2]-g[0],g[2]-g[1]}; b={v[g[0]],v[g[1]],v[g[2]]}; sort(a.begin(),a.end()); sort(b.begin(),b.end()); return (int)(a==b); } long long count_triples(vector<int> hsh) { v=hsh; int ans=0; n=v.size(); for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ ans+=is_triple({i,j,i+v[i]}); ans+=is_triple({i,j,j+v[i]}); ans+=is_triple({i,j,i+v[j]}); ans+=is_triple({i,j,j+v[j]}); ans+=is_triple({i,j,i-v[i]}); ans+=is_triple({i,j,j-v[i]}); ans+=is_triple({i,j,i-v[j]}); ans+=is_triple({i,j,j-v[j]}); } }return ans; } vector<int> construct_range(int M, int K) { return {7, 10, 7, 14, 7, 8, 12, 5, 11, 8, 17, 8, 1, 7, 9, 3, 3, 2, 9, 18} }

컴파일 시 표준 에러 (stderr) 메시지

triples.cpp: In function 'std::vector<int> construct_range(int, int)':
triples.cpp:41:76: error: expected ';' before '}' token
   41 |   return {7, 10, 7, 14, 7, 8, 12, 5, 11, 8, 17, 8, 1, 7, 9, 3, 3, 2, 9, 18}
      |                                                                            ^
      |                                                                            ;
   42 | 
   43 | }
      | ~