| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367527 | peem | Rotating Lines (APIO25_rotate) | C++20 | 0 ms | 836 KiB |
#include "rotate.h"
#include <bits/stdc++.h>
using namespace std;
void energy(int n, vector<int> v){
long long mx=25000*(n/2)*((n+1)/2);
int p=v[0];
for(int i=n/2;i<n;++i) {
rotate({i},25000+p-v[i]);
v[i]=25000+p-v[i];
long long res = 0;
for (int k = 0; k < n; k++){
for (int j = k + 1; j <n; j++){
int d = abs(v[k] - v[j]);
res += std::min(d, 50000 - d);
}
}
if(res==mx) return;
}
for(int i=1;i<n/2;++i) {
rotate({i},p-v[i]);
v[i]=p;
long long res = 0;
for (int k = 0; k <n; k++){
for (int j = k + 1; j <n; j++){
int d = abs(v[k] - v[j]);
res += std::min(d, 50000 - d);
}
}
if(res==mx) return;
}
}| # | 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... | ||||
