| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1263002 | silentloop | Roller Coaster Railroad (IOI16_railroad) | C++20 | 2096 ms | 4540 KiB | 
#include <bits/stdc++.h>
#define ll long long
#define sz(x) int(x.size())
#define fr first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
using namespace std;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t)
{
    vector<int>v;
    ll i, j, n=sz(s), mi=LLONG_MAX, dis;
    for(i=0; i<n; i++)
        v.pb(i);
    do
    {
        dis=0;
        for(j=1; j<n; j++)
            dis=dis+max(0ll,1ll*t[v[j-1]]-s[v[j]]);
        mi=min(mi,dis);
    }while(next_permutation(all(v)));
    return mi;
}
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... | ||||
