Submission #605901

#TimeUsernameProblemLanguageResultExecution timeMemory
605901polyaStations (IOI20_stations)C++14
0 / 100
914 ms652 KiB
#include "stations.h" #include <vector> using namespace std; vector<int> adj[1004]; vector<int> labels; int cnt = 0; void dfs(int nn) { if (labels[nn] != -1) return; labels[nn] = cnt++; for (auto &i : adj[nn]) dfs(i); } vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { labels.resize(n, -1); for (int i=0; i<u.size(); i++) { adj[u[i]].push_back(v[i]), adj[v[i]].push_back(u[i]); } for (int i=0; i<n; i++) { if (adj[i].size() != 2) dfs(i); } return labels; } int find_next_station(int s, int t, std::vector<int> c) { if (s < t) return s+1; else return s-1; }

Compilation message (stderr)

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:18:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |  for (int i=0; i<u.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...