Submission #305691

#TimeUsernameProblemLanguageResultExecution timeMemory
305691arthurconmyStations (IOI20_stations)C++14
0 / 100
2 ms768 KiB
#ifndef ARTHUR_LOCAL #include "stations.h" #endif #ifdef ARTHUR_LOCAL #include <bits/stdc++.h> #endif using namespace std; using ll = long long; vector<int> adj[1001]; bool vis[1001]; int curv; int labellist[1001]; void dfs(int v) { vis[v]=1; labellist[v]=curv++; for(auto u:adj[v]) { if(!vis[u]) dfs(u); } } vector<int> label(int n, int k, vector<int> U, vector<int> V) { for(int i=0; i<n; i++) { adj[i].clear(); vis[i]=0; } for(int i=0; i<n-1; i++) { adj[U[i]].push_back(V[i]); adj[V[i]].push_back(U[i]); } for(int i=0; i<n-1; i++) { if(adj[i].size() == 1) { curv=0; dfs(i); break; } } } int find_next_station(int s, int t, vector<int> C) { if(C.size() == 1) return C[0]; if(s < t) { return C[1]; } else { return C[0]; } }

Compilation message (stderr)

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:51:1: warning: no return statement in function returning non-void [-Wreturn-type]
   51 | }
      | ^
#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...