제출 #889153

#제출 시각아이디문제언어결과실행 시간메모리
889153Ghulam_JunaidRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
2009 ms4564 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll plan_roller_coaster (vector<int> s, vector<int> t){ int n = s.size(); if (n == 1) return 0; vector<int> all; for (int i=0; i<n; i++) all.push_back(i); ll output = 2e18; do{ ll val = 0; for (int i=1; i<n; i++){ val += max(0ll, (ll)(t[i - 1] - s[i])); } output = min(output, val); } while(next_permutation(all.begin(), all.end())); return output; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...