Submission #616718

#TimeUsernameProblemLanguageResultExecution timeMemory
616718John3_141592Stations (IOI20_stations)C++14
0 / 100
1 ms464 KiB
#include "stations.h" #include <bits/stdc++.h> using namespace std; vector <int> grafo[1003]; int arr[1003]; bool vis[1003]; void dfs(int node,int c,int C){ vis[node]=true; if(c) arr[node]=C; for(auto i:grafo[node]) if(!vis[i]) dfs(node,c^1,C+1); if(!c) arr[node]=C; } std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { for(int i=0;i<n;i++) grafo[i].clear(); for(int i=0;i<n-1;i++) grafo[u[i]].push_back(v[i]),grafo[v[i]].push_back(u[i]); fill(arr,arr+n+1,0); fill(vis,vis+n+1,false); } int find_next_station(int s, int t, std::vector<int> c) { if(s<c[0]) for(auto i:c) if(i>t) return i; reverse(c.begin(),c.end()); for(auto i:c) if(i<t) return i; }

Compilation message (stderr)

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