제출 #586023

#제출 시각아이디문제언어결과실행 시간메모리
586023wdjpng기지국 (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]; }

컴파일 시 표준 에러 (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...