| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1205427 | AI_2512 | Rotating Lines (APIO25_rotate) | C++20 | 0 ms | 0 KiB | 
#include "rotate.h"
#include <bits/stdc++.h>
#define ff first
#define ss second
using namespace std;
bool comp(pair<int,int> a, pair<int,int> b){
    return a.ff > b.ff;
}
void energy(int n, vector<int> v){
    vector<pair<int,int>> a(n);
    for (int i = 0; i< n;i++){
        a[i].ff = v[i];
        a[i].ss = i;
    }
    sort(a.begin(), a.end(), comp);
    for (int i = 0;i<n/2;i++){
        rotate({a[i].ss}, 25000-abs(a[i].ff-a[i+n/2].ff));
    }
}
