제출 #1132700

#제출 시각아이디문제언어결과실행 시간메모리
1132700SpyrosAlivLongest Trip (IOI23_longesttrip)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; //#define int long long //bool are_connected(vector<int> a, vector<int> b); vector<int> longest_trip(int n, int d) { if (d == 3) { vector<int> ans; for (int i = 0; i < n; i++) ans.push_back(i); return ans; } else if (d == 2) { vector<int> ans; ans.push_back(0); for (int i = 0; i < n-1; i++) { bool x = are_connected({i}, {i+1}); if (x) { ans.push_back(i+1); continue; } else { ans.push_back(i+2); ans.push_back(i+1); i++; } } return ans; } return {}; }

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

longesttrip.cpp: In function 'std::vector<int> longest_trip(int, int)':
longesttrip.cpp:17:22: error: 'are_connected' was not declared in this scope; did you mean 'SYS_connect'?
   17 |             bool x = are_connected({i}, {i+1});
      |                      ^~~~~~~~~~~~~
      |                      SYS_connect