제출 #1311204

#제출 시각아이디문제언어결과실행 시간메모리
1311204mo_aladailiStations (IOI20_stations)C++20
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<int> v(n); for (int i = 0; i < n; i++) v[i] = i + 1; return v; } int find_next_station(int s, int t, vector<int> c) { int target = t - 1; for (int x : c) { int v = x - 1; int cur = target; while (cur > 0) { if (cur == v) return x; cur /= 2; } } }

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

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:5:16: error: declaration of 'std::vector<int> v' shadows a parameter
    5 |    vector<int> v(n);
      |                ^
stations.cpp:3:60: note: 'std::vector<int> v' previously declared here
    3 | vector<int> label(int n, int k, vector<int> u, vector<int> v)
      |                                                ~~~~~~~~~~~~^
stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^