제출 #1056980

#제출 시각아이디문제언어결과실행 시간메모리
1056980fv3Roller Coaster Railroad (IOI16_railroad)C++14
11 / 100
2094 ms8140 KiB
#include "railroad.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll plan_roller_coaster(vector<int> s, vector<int> t) { const int N = (int)s.size(); vector<int> perm(N); iota(perm.begin(), perm.end(), 0); ll res = 1ll << 60; do { int speed = 0; ll temp = 0; for (int i = 0; i < N; i++) { temp += max(0, speed - s[perm[i]]); speed = t[perm[i]]; } res = min(res, temp); } while (next_permutation(perm.begin(), perm.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...