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