제출 #385690

#제출 시각아이디문제언어결과실행 시간메모리
385690Ahmadsm2005기지국 (IOI20_stations)C++14
0 / 100
965 ms1236 KiB
#include<bits/stdc++.h> #include "stations.h" using namespace std; int C; vector<vector<int>>edges; vector<int>labels; void DFS(int v,int u=-1){ int INIT=C; for(int i=0;i<edges[v].size();i++){ C+=10001; if(edges[v][i]!=u) DFS(edges[v][i],v); C-=10001; C++; } C--; labels[v]=100000000-C; } vector<int>label(int n,int k,vector<int>u,vector<int>v){ labels.clear(); labels.resize(n); edges.resize(n); for(int i=0;i<u.size();i++){ edges[u[i]].push_back(v[i]),edges[v[i]].push_back(u[i]); } DFS(0); C=0; edges.clear(); return labels; } int find_next_station(int s, int t,vector<int>c){ if((s/1001)<(t/1001)) return c.back(); for(int i=0;i<c.size();i++){ if(c[i]%10001>=t%10001) return c[i]; } return c.back(); }

컴파일 시 표준 에러 (stderr) 메시지

stations.cpp: In function 'void DFS(int, int)':
stations.cpp:9:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 | for(int i=0;i<edges[v].size();i++){
      |             ~^~~~~~~~~~~~~~~~
stations.cpp:8:5: warning: unused variable 'INIT' [-Wunused-variable]
    8 | int INIT=C;
      |     ^~~~
stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:23:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 | for(int i=0;i<u.size();i++){
      |             ~^~~~~~~~~
stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:34:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 | for(int i=0;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...