제출 #1226071

#제출 시각아이디문제언어결과실행 시간메모리
1226071paskalisapo즐거운 행로 (APIO20_fun)C++20
컴파일 에러
0 ms0 KiB
using namespace std; stack<int> s; vector<bool> visited; vector<vector<pair<int,int>>> adj; vector<int> v; int n; void dfs(int cur, int mw) { for(auto &x : adj[cur]) { if(visited[x.first] || x.second >= mw) { continue; } dfs(x.first, x.second); visited[x.first] = true; s.push(x.first); } if(s.size() == n) { while(!s.empty()) { v.push_back(s.top()); s.pop(); } return; } else { visited[cur] = false; s.pop(); } } std::vector<int> createFunTour(int N, int Q) { int H = hoursRequired(0, N - 1); int A = attractionsBehind(0, N - 1); return std::vector<int>(N); n = N; visited.resize(N); adj.resize(N); for(int i = 0;i < N ; i++){ for(int j = i + 1; j < N ;j ++) { int temp = hoursRequired(i , j); if(attractionsBehind(i, j) == 0) { adj[i].push_back({j, temp}); adj[j].push_back({i , temp}); } } } for(int i = 0 ;i < N ;i++) { dfs(i , INT_MAX); } reverse(v.begin(), v.end()); return v; }

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

fun.cpp:3:1: error: 'stack' does not name a type
    3 | stack<int> s;
      | ^~~~~
fun.cpp:4:1: error: 'vector' does not name a type
    4 | vector<bool> visited;
      | ^~~~~~
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:1:1: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
  +++ |+#include <utility>
    1 | using namespace std;
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:1:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
  +++ |+#include <vector>
    1 | using namespace std;
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:5:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:5:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:5:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:5:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:5:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:5:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:5:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:8: error: 'vector' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |        ^~~~~~
fun.cpp:5:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
fun.cpp:5:15: error: 'pair' was not declared in this scope
    5 | vector<vector<pair<int,int>>> adj;
      |               ^~~~
fun.cpp:5:15: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
fun.cpp:5:1: error: 'vector' does not name a type
    5 | vector<vector<pair<int,int>>> adj;
      | ^~~~~~
fun.cpp:6:1: error: 'vector' does not name a type
    6 | vector<int> v;
      | ^~~~~~
fun.cpp: In function 'void dfs(int, int)':
fun.cpp:9:19: error: 'adj' was not declared in this scope
    9 |     for(auto &x : adj[cur]) {
      |                   ^~~
fun.cpp:10:12: error: 'visited' was not declared in this scope
   10 |         if(visited[x.first] || x.second >= mw) {
      |            ^~~~~~~
fun.cpp:14:9: error: 'visited' was not declared in this scope
   14 |         visited[x.first] = true;
      |         ^~~~~~~
fun.cpp:15:9: error: 's' was not declared in this scope
   15 |         s.push(x.first);
      |         ^
fun.cpp:17:8: error: 's' was not declared in this scope
   17 |     if(s.size() == n) {
      |        ^
fun.cpp:19:13: error: 'v' was not declared in this scope
   19 |             v.push_back(s.top());
      |             ^
fun.cpp:25:9: error: 'visited' was not declared in this scope
   25 |         visited[cur] = false;
      |         ^~~~~~~
fun.cpp: At global scope:
fun.cpp:31:6: error: 'vector' in namespace 'std' does not name a template type
   31 | std::vector<int> createFunTour(int N, int Q) {
      |      ^~~~~~
fun.cpp:31:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
   31 | std::vector<int> createFunTour(int N, int Q) {
      | ^~~