Submission #1091084

# Submission time Handle Problem Language Result Execution time Memory
1091084 2024-09-19T17:29:29 Z Nelt Stations (IOI20_stations) C++17
0 / 100
631 ms 684 KB
#include "stations.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define endl "\n"

using namespace std;
using namespace __gnu_pbds;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T, typename key = less<T>>
using ordered_set = tree<T, null_type, key, rb_tree_tag, tree_order_statistics_node_update>;
const ll N = 1005;
vector<ll> g[N];
vector<int> d;
ll timer = 0;
void dfs(ll v, ll par = 0)
{
	d[v] = timer++;
	for (ll to : g[v])
	 	if (to != par) dfs(to, v);
}
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
	timer = 0;
	d.assign(n, 0);
	for (ll i = 0; i < n; i++) g[i].clear();
	for (ll i = 0; i < n - 1; i++) g[u[i]].push_back(v[i]), g[v[i]].push_back(u[i]);
	dfs(0);
	return d;
}

int find_next_station(int s, int t, std::vector<int> c) {
	for (ll i = 1; i < c.size(); i++)
		if (c[i] > t) return c[i - 1];
	return c.back();
}

Compilation message

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:34:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |  for (ll i = 1; i < c.size(); i++)
      |                 ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 370 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 323 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 357 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 631 ms 684 KB Output is correct
2 Correct 472 ms 684 KB Output is correct
3 Incorrect 382 ms 684 KB Wrong query response.
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 367 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -