| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367548 | peem | Rotating Lines (APIO25_rotate) | C++20 | 2733 ms | 1784 KiB |
#include "rotate.h"
#include <bits/stdc++.h>
using namespace std;
long long cal_energy(vector<int>&v) {
long long res = 0;
for (int i = 0; i < (int) v.size(); i++){
for (int j = i + 1; j < (int) v.size(); j++){
int d = abs(v[i] - v[j]);
res += std::min(d, 50000 - d);
}
}
return res;
}
void energy(int n, vector<int> v){
long long mx=25000ll*(n/2)*((n+1)/2);
if(cal_energy(v)==mx) return;
for(int i=1;i<n;i+=2) {
rotate({i},25000+v[i-1]-v[i]);
v[i]=(25000+v[i-1])%50000;
}
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
