답안 #958829

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
958829 2024-04-06T23:45:17 Z MinaRagy06 Shortcut (IOI16_shortcut) C++17
컴파일 오류
0 ms 0 KB
#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> in, vector<int> out) {
	int n = in.size();
	set<array<int, 2>> s;
	for (int i = 0; i < n; i++) {
		s.insert({in[i], out[i]});
	}
	vector<array<int, 2>> a;
	while (s.size()) {
		array<int, 2> val = *s.begin();
		s.erase(s.begin());
		int st = val[0];
		while (1) {
			auto it = s.lower_bound({val[1], 0});
			if (it == s.end()) {
				break;
			}
			val = *it;
			s.erase(it);
		}
		int en = val[1];
		a.push_back({st, en});
	}
	n = a.size();
	ll sum = 0;
	for (int i = 0; i < n; i++) {
		sum += a[i][1] - a[i][0];
	}
	ll ans = 1e18;
	for (int x = 0; x < n; x++) {
		for (int y = 0; y < n; y++) {
			if (x == y) continue;
			ans = min(ans, sum + a[x][0] - a[y][1]);
		}
	}
	return ans;
}

Compilation message

shortcut.cpp:2:10: fatal error: railroad.h: No such file or directory
    2 | #include "railroad.h"
      |          ^~~~~~~~~~~~
compilation terminated.