# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1091083 |
2024-09-19T17:29:05 Z |
Nelt |
Stations (IOI20_stations) |
C++17 |
|
609 ms |
688 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[0];
}
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 |
328 ms |
684 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
283 ms |
688 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
371 ms |
684 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
609 ms |
684 KB |
Output is correct |
2 |
Incorrect |
481 ms |
684 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
351 ms |
684 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |