Submission #586023

#TimeUsernameProblemLanguageResultExecution timeMemory
586023wdjpngStations (IOI20_stations)C++17
0 / 100
925 ms636 KiB
#include<bits/stdc++.h> #include "stations.h" using namespace std; #define rep(i,n) for(int i = 0; i<n;i++) int c; vector<vector<int>>E; vector<int>pre; void dfs(int v, int p) { pre[v]=c++; for(int w : E[v]) if(w!=p) dfs(w,v); } vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { E.assign(n, vector<int>()); pre.resize(n); c=0; rep(i,n-1) {E[u[i]].push_back(v[i]); E[v[i]].push_back(u[i]);} dfs(0,-1); return pre; } int find_next_station(int s, int t, std::vector<int> c) { sort(c.begin(),c.end()); rep(i,c.size()-1) if(c[i+1]>t) return c[i]; return c[c.size()-1]; }

Compilation message (stderr)

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:6:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 | #define rep(i,n) for(int i = 0; i<n;i++)
......
   29 |  rep(i,c.size()-1) if(c[i+1]>t) return c[i];
      |      ~~~~~~~~~~~~                 
stations.cpp:29:2: note: in expansion of macro 'rep'
   29 |  rep(i,c.size()-1) if(c[i+1]>t) return c[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...