Submission #985344

#TimeUsernameProblemLanguageResultExecution timeMemory
985344MaaxleStations (IOI20_stations)C++17
0 / 100
538 ms864 KiB
#include "stations.h" #include <bits/stdc++.h> #define range(it, a, b) for (ll it = a; it < b; it++) #define all(x) begin(x), end(x) #define ll long long #define ull unsigned long long #define INF64 ((ll) 1 << 62) #define INF32 (1 << 30) #define mset multiset #define uset unordered_set #define umap unordered_map #define pqueue priority_queue #define ptr(A) shared_ptr<A> using namespace std; vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<vector<int>> adj (n); range(i, 0, n-1) { adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } int l; range(i, 0, n) { if (adj[i].size() == 1) { l = i; break; } } vector<int> ans (n); int prev = l; range(i, 0, n) { ans[l] = i; for (int& k : adj[l]) { if (k != prev) { l = k; prev = l; break; } } } return ans; } int find_next_station(int s, int t, vector<int> c) { if (t > s) return s+1; return s-1; }

Compilation message (stderr)

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:37:8: warning: 'l' may be used uninitialized in this function [-Wmaybe-uninitialized]
   37 |   ans[l] = i;
      |        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...