# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100103 | SomeoneUnknown | Roller Coaster Railroad (IOI16_railroad) | C++14 | 2009 ms | 4240 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(vector<int> s, vector<int> t) {
long long tal = 0;
int p2[s.size()];
for(int i = 0; i < s.size(); i++){
p2[i] = i;
}
do{
long long p = 1;
long long subtal = 0;
for(int i = 0; i < s.size(); i++){
subtal += max(0LL, p-s[p2[i]]);
p = t[p2[i]];
}
tal = max(tal, subtal);
}while(next_permutation(p2, p2+s.size()));
return tal;
}
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... |