제출 #1250244

#제출 시각아이디문제언어결과실행 시간메모리
1250244haiphong5g0World Map (IOI25_worldmap)C++20
컴파일 에러
0 ms0 KiB
#include "worldmap.h" #include <bits/stdc++.h> #define task "TEST" #define task2 "A" #define pl pair<ll, ll> #define pf push_front #define pb push_back #define pob pop_back #define pof pop_front #define mp make_pair #define fi first #define se second #define FOR(i, a, b, c) for (int i=a; i<=b; i+=c) #define FORE(i, a, b, c) for (int i=a; i>=b; i+=c) using namespace std; using ll = long long; using ull = unsigned long long; const int Mod = 998244353; const int maxn = 1e3; const ll Inf = 1e16; vector<int> adj[maxn+1]; vector<vector<int>> res; vector<int> L; int ck[maxn+1]; void Resize(ll v) { FOR(i, 1, v, 1) res.resize(v); } void DFS(ll v) { L.pb(i); ck[i] = true; for (auto p : adj[i]) { if (ck[p]) continue; DFS(p); } } vector<vector<int>> create_map(int n, int m, vector<int> A, vector<int> B) { Resize(3*n); DFS(1); int row = 0; for (auto p : L) { res[row].resize(3*n, p); res[row+2].resize(3*n, p); for (auto q : adj[p]) { res[row+1].pb(q); res[row+1].pb(p); } res[row+1].resize(3*n, p); } return res; }

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

worldmap.cpp: In function 'void DFS(ll)':
worldmap.cpp:28:10: error: 'i' was not declared in this scope
   28 |     L.pb(i); ck[i] = true;
      |          ^