Submission #1073725

# Submission time Handle Problem Language Result Execution time Memory
1073725 2024-08-24T19:22:45 Z allin27x Stations (IOI20_stations) C++17
0 / 100
632 ms 688 KB
#include <bits/stdc++.h>
using namespace std;
#include "stations.h"

const int N = 1001;
vector<int> adj[N];
int tin[N];
int tout[N];
int tp = 0;

void dfs(int i, int p) {
	tin[i] = tp++;
	for (int c: adj[i]) {
		if (c == p) continue;
		dfs(c,i);
	}
	tout[i] = tp;
}

std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
	for (int i=0; i<n; i++) adj[i].clear();
	std::vector<int> labels(n);
	for (int i=0; i<n; i++) labels[i] = i;
	return labels;
}

int find_next_station(int s, int t, std::vector<int> c) {
	int s_in = s/1000; int s_out = s%1000;
	int t_in = t/1000; int t_out = t%1000;
	if (s_in <= t_in && t_out <= s_out) {
		// t is below s
		for (int x: c) {
			int x_in = x/1000; int x_out = x%1000;
			if (x_in <= t_in && t_out <= x_out) return x;
		}
	} else {
		for (int x: c) {
			if (x/1000 < s_in) return x;
		}
	}
	return c[0];
}
# Verdict Execution time Memory Grader output
1 Incorrect 368 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 313 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 332 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 632 ms 688 KB Output is correct
2 Incorrect 448 ms 684 KB Wrong query response.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 368 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -