제출 #1363106

#제출 시각아이디문제언어결과실행 시간메모리
1363106KasymKRotating Lines (APIO25_rotate)C++20
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h"
#include "rotate.h"
using namespace std;
#define ff first
#define ss second    
#define all(v) v.begin(), v.end()
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define pli pair<ll, int>
#define pll pair<ll, ll>
#define tr(i, c) for(auto i = c.begin(); i != c.end(); ++i)
#define wr puts("----------------")
#define mm make_pair
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}

void energy(int n, vector<int> v){
    vector<pii> a;
    for(int i = 0; i < n; ++i)
        a.pb({v[i], i});
    sort(all(a));
    n/=2;
    for(int i = 0; i < n; ++i)
        rotate({p[i+n].ss}, p[i].ff+25000-p[i+n].ff);
}

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

rotate.cpp: In function 'void energy(int, std::vector<int>)':
rotate.cpp:25:17: error: 'p' was not declared in this scope
   25 |         rotate({p[i+n].ss}, p[i].ff+25000-p[i+n].ff);
      |                 ^