# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1257866 | noop | Rotating Lines (APIO25_rotate) | C++20 | 0 ms | 0 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);
}