제출 #781026

#제출 시각아이디문제언어결과실행 시간메모리
781026Blagoj기지국 (IOI20_stations)C++17
0 / 100
766 ms660 KiB
#include <bits/stdc++.h> #include "stations.h" using namespace std; vector<int> g[1005], labels; int in[1005], out[1005], timer = 0; void dfs(int n, int p) { labels[n] = ++timer; for (auto x : g[n]) if (x != p) dfs(x, n); } vector<int> label(int n, int k, vector<int> u, vector<int> v) { labels.resize(n, 0); for (int i = 0; i < n; i++) g[i].clear(); timer = 0; for (int i = 0; i < u.size(); i++) { g[u[i]].push_back(v[i]); g[v[i]].push_back(u[i]); } dfs(0, -1); return labels; } int find_next_station(int s, int t, vector<int> c) { sort(c.begin(), c.end()); if (t < s) return c[0]; c.push_back(INT_MAX); for (int i = 0; i < c.size() - 1; i++) if (c[i] <= t && t < c[i + 1]) return c[i]; }

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

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:18:20: 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++) {
      |                  ~~^~~~~~~~~~
stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:30:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |  for (int i = 0; i < c.size() - 1; i++) if (c[i] <= t && t < c[i + 1]) return c[i];
      |                  ~~^~~~~~~~~~~~~~
stations.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#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...