| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1283601 | stanwaibbange | Roller Coaster Railroad (IOI16_railroad) | C++20 | 2096 ms | 5052 KiB |
#include "railroad.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = numeric_limits<ll>::max();
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
int n = s.size();
vector<pair<int,int>> st(n);
for (int i{0};i<n;++i) {
st[i] = {s[i],t[i]};
}
sort(st.begin(),st.end());
ll m = INF;
do {
ll o = 0;
for (int i{1};i<n;++i) {
o += max(0,st[i-1].second - st[i].first);
}
m = min(m,o);
} while (next_permutation(st.begin(),st.end()));
return m;
}
컴파일 시 표준 에러 (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... | ||||
