#include #include #include #include #include #include using namespace std; int to_min(int h, int m) { return h * 60 + m; } struct Flight { int from, to, s, t; }; struct City { int id; long long x, y, w; }; int calc_duration(const City& a, const City& b) { double d = sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2)); double cost = 60.0 * d / 800.0 + 40.0; return ((int)ceil(cost / 5.0)) * 5; } class Solver { int N, M, K; double R; vector cities; vector> schedule; public: void read_input() { cin >> N >> R; cities.resize(N); for(int i=0; i> cities[i].x >> cities[i].y >> cities[i].w; cin >> M; for(int i=0; i> a >> s_h >> c >> s_m >> b >> t_h >> c >> t_m; } cin >> K; schedule.resize(K); } void generate_initial_solution() { for(int k=0; k to_min(21, 0)) break; schedule[k].push_back({current_city, next_city, current_time, current_time + dur}); current_time += dur; current_city = next_city; } } } void solve() { mt19937 engine(42); double temp = 1000.0; double cooldown = 0.9999; for (int iter = 0; iter < 100000; ++iter) { int k = engine() % K; if (schedule[k].empty()) continue; int f_idx = engine() % schedule[k].size(); int old_s = schedule[k][f_idx].s; int diff = (engine() % 2 == 0 ? 5 : -5); temp *= cooldown; } } void output() { for(int k=0; k