제출 #571158

#제출 시각아이디문제언어결과실행 시간메모리
571158grt즐거운 행로 (APIO20_fun)C++17
컴파일 에러
0 ms0 KiB
//GRT_2018 #include <bits/stdc++.h> #define PB push_back #define ST first #define ND second //mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); using namespace std; using ll = long long; using pi = pair<int,int>; using vi = vector<int>; //int hoursRequired(int x, int y) { //cout << x << " " << y << endl; //int w; //cin >> w; //return w; //} set<int>aval; int furthest(int x) { int w = x, d = 0; for(int y : aval) { if(y == x) continue; int p = hoursRequired(x, y); if(p > d) d = p, w = y; } return w; } vi createFunTour(int n, int q) { for(int i = 0; i < n; ++i) aval.insert(i); int x = furthest(0); vi ans(n); for(int i = 0; i < n; ++i) { ans[i] = x; aval.erase(x); x = furthest(x); } return ans; } //int main() { //ios_base::sync_with_stdio(0); //cin.tie(0); //auto v = createFunTour(7, 1); //for(int x : v) cout << x << " "; //}

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

fun.cpp: In function 'int furthest(int)':
fun.cpp:27:11: error: 'hoursRequired' was not declared in this scope
   27 |   int p = hoursRequired(x, y);
      |           ^~~~~~~~~~~~~