Submission #958827

#TimeUsernameProblemLanguageResultExecution timeMemory
958827MinaRagy06Roller Coaster Railroad (IOI16_railroad)C++17
11 / 100
2045 ms8028 KiB
#include <bits/stdc++.h> #include "railroad.h" #ifdef MINA #include "grader.cpp" #endif using namespace std; #define ll long long ll plan_roller_coaster(vector<int> s, vector<int> t) { int n = s.size(); int a[n]; for (int i = 0; i < n; i++) { a[i] = i; } ll ans = 1e18; do { ll sum = 0; for (int i = 0; i + 1 < n; i++) { sum += max(0, t[a[i]] - s[a[i + 1]]); } ans = min(ans, sum); } while (next_permutation(a, a + n)); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...