Submission #926215

#TimeUsernameProblemLanguageResultExecution timeMemory
926215velislavgarkovStations (IOI20_stations)C++14
0 / 100
3043 ms2097152 KiB
#include "stations.h" #include <iostream> #include <algorithm> #include <vector> using namespace std; const int MAXN=1e3+10; vector <int> ver[MAXN]; vector <int> in; int br; void dfs(int x, int par) { in[x]=br; br++; for (auto i:ver[x]) { if (i==par) continue; dfs(i,x); } } vector<int> label(int n, int k, vector<int> u, vector<int> v) { in.resize(n); for (int i=0;i<n-1;i++) { ver[u[i]].push_back(v[i]); ver[v[i]].push_back(u[i]); } dfs(0,-1); return in; } int find_next_station(int s, int t, vector<int> c) { sort(c.begin(),c.end()); if (s>t) return c[0]; int ans=c[0]; for (int i=1;i<c.size();i++) { if (t>c[i]) ans=c[i]; } return ans; }

Compilation message (stderr)

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:32:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |  for (int i=1;i<c.size();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...