#include "rotate.h"
#include <bits/stdc++.h>
// #pragma GCC optimize("O3", "unroll-loops")
#define ll long long
#define pb push_back
#define fi first
#define se second
#define lf (id<<1)
#define rg ((id<<1)|1)
#define md ((l+r)>>1)
#define ld long double
#define rot rotate
using namespace std;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> ipii;
const ll MAXN = 3e5+10;
const ll MOD = 100000;
const ll Q = 25000;
const ll INF = 2e18+10;
ll sum(auto a, auto b){ return (a+MOD+b)%MOD; }
// LNG LONG
ll n, v[MAXN], idx;
vector<pii> vec;
void energy(int N, std::vector<int> V){
n = N;
for(int i=0; i<n; i++){
v[i] = V[i];
vec.pb({v[i], i});
}
sort(vec.begin(), vec.end());
int half = n/2;
for(int i=0; i+half<n; i++){
// cout << v[vec[i+half].se] << ' '<<v[vec[i].se]+Q << " p\n";
int val = sum(-v[vec[i+half].se], v[vec[i].se]+Q);
rot({(int)vec[i+half].se}, val);
v[vec[i+half].se] = sum(v[vec[i+half].se], val);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |