# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100055 | helloworldworld | Roller Coaster Railroad (IOI16_railroad) | C++14 | 2017 ms | 4280 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "railroad.h"
#include <bits/stdc++.h>
using namespace std;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
int n = (int) s.size();
int arr[n];
for(int i=0;i<n;i++)
arr[i]=i;
long long mini,cur;
for(int i=1;i<n;i++){
if(t[i-1]>s[i])
cur+=t[i-1]-s[i];
}
mini=cur;
while(next_permutation(arr,arr+n)){
for(int i=1;i<n;i++){
if(t[i-1]>s[i])
cur+=t[i-1]-s[i];
}
if(mini>cur) mini=cur;
}
return mini;
}
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... |