제출 #1257866

#제출 시각아이디문제언어결과실행 시간메모리
1257866noopRotating Lines (APIO25_rotate)C++20
컴파일 에러
0 ms0 KiB
#include "rotate.h" #include <bits/stdc++.h> using namespace std; void energy(int n,vector<int> v){ pair<int,int> r[n]; for (int i=0; i<n; ++i) r[i]={v[i],i}; sort(r.begin(),r.end()); n>>=1; for (int i=0; i<n; ++i) rotate({r[i+n].second},r[i].first+25000-r[i+n].first); }

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

rotate.cpp: In function 'void energy(int, std::vector<int>)':
rotate.cpp:8:12: error: request for member 'begin' in 'r', which is of non-class type 'std::pair<int, int> [n]'
    8 |     sort(r.begin(),r.end());
      |            ^~~~~
rotate.cpp:8:22: error: request for member 'end' in 'r', which is of non-class type 'std::pair<int, int> [n]'
    8 |     sort(r.begin(),r.end());
      |                      ^~~