Submission #747946

#TimeUsernameProblemLanguageResultExecution timeMemory
747946saayan007City Mapping (NOI18_citymapping)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "citymapping.h" using namespace std; using ll = long long; #define eb emplace_back #define nl endl #define qry qry void find_roads(int N, int Q, int A[], int B[], int W[]) { deque<int> path; vector<int> node[N + 1]; for(int i = 2; i <= N; ++i) { int d = qry(1, i); node[d].eb(i); } path.eb(1); for(int i = 1; i <= N; ++i) { if((int)dist[i].size() == 2) { int a = node[i][0], b = node[i][1]; if(qry(a, path.back()) == 1) swap(a, b); path.emplace_front(a); path.eb(b); } else if((int) dist[i].size() == 2) { int a = node[i][0]; if(qry(a, path.back()) == 1) path.eb(a); else path.emplace_front(a); } } for(int i = 0; i < N - 1; ++i) { A[i] = path[i], B[i] = path[i + 1], W[i] = 1; } return; }

Compilation message (stderr)

citymapping.cpp: In function 'void find_roads(int, int, int*, int*, int*)':
citymapping.cpp:7:13: error: 'qry' was not declared in this scope
    7 | #define qry qry
      |             ^~~
citymapping.cpp:13:17: note: in expansion of macro 'qry'
   13 |         int d = qry(1, i);
      |                 ^~~
citymapping.cpp:19:17: error: 'dist' was not declared in this scope
   19 |         if((int)dist[i].size() == 2) {
      |                 ^~~~
citymapping.cpp:7:13: error: 'qry' was not declared in this scope
    7 | #define qry qry
      |             ^~~
citymapping.cpp:21:16: note: in expansion of macro 'qry'
   21 |             if(qry(a, path.back()) == 1) swap(a, b);
      |                ^~~
citymapping.cpp:7:13: error: 'qry' was not declared in this scope
    7 | #define qry qry
      |             ^~~
citymapping.cpp:26:16: note: in expansion of macro 'qry'
   26 |             if(qry(a, path.back()) == 1) path.eb(a);
      |                ^~~