| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1307703 | Leyna | Roller Coaster Railroad (IOI16_railroad) | C++20 | 2094 ms | 7724 KiB |
#include "railroad.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
int n = s.size();
ll res = 1e17;
vector<pair<ll, ll>> elements;
for (int i=0; i<n; i++) elements.push_back({s[i], t[i]});
do{
ll speed = 1;
ll part_res = 0;
for (auto[start, end] : elements){
part_res += max((ll)0, speed-start);
speed = end;
}
res = min(res, part_res);
} while(next_permutation(elements.begin(), elements.end()));
return res;
}
Compilation message (stderr)
| # | 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... | ||||
