Submission #1069551

#TimeUsernameProblemLanguageResultExecution timeMemory
1069551IgnutRoller Coaster Railroad (IOI16_railroad)C++17
11 / 100
2084 ms8020 KiB
// Ignut #include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1e18 + 123; ll plan_roller_coaster(vector<int> s, vector<int> t) { int n = s.size(); vector<int> vec(n, 0); iota(vec.begin(), vec.end(), 0); ll res = INF; do { int speed = 1; ll ans = 0; for (int i : vec) { ans += max(0, speed - s[i]); speed = t[i]; } res = min(res, ans); } while (next_permutation(vec.begin(), vec.end())); return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...