제출 #1193446

#제출 시각아이디문제언어결과실행 시간메모리
1193446nuutsnoyntonPipes (CEOI15_pipes)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; using ll = int; using pll = pair < ll, ll >; const ll N = 1e5 + 2; ll tin[N], timer = 1, low[N]; vector < ll > adj[N]; void euler_tour(ll node, ll par) { tin[node] = timer; low[node] = timer; used[node] = 1; timer ++; bool parent_found = false; for ( ll nxt : adj[node]) { if ( nxt == par && parent_found == false) { parent_found = true; continue; } if ( tin[nxt] > 0) { low[node] = min(low[node], tin[nxt]); continue; } euler_tour(nxt, node); low[node] = min(low[node], low[nxt]); if ( low[nxt] > tin[node]) { cout << node << " " << nxt << endl; } } } int main() { ll n, m, r, x, y, i, j, ans, t; cin >> n >> m; for (i = 1; i <= m; i ++) { cin >> x >> y; adj[x].push_back(y); adj[y].push_back(x); } for (i = 1; i <= n; i ++) { if ( used[i] == 0) euler_tour(i, -1); } }

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

pipes.cpp: In function 'void euler_tour(ll, ll)':
pipes.cpp:15:9: error: 'used' was not declared in this scope
   15 |         used[node] = 1;
      |         ^~~~
pipes.cpp: In function 'int main()':
pipes.cpp:48:22: error: 'used' was not declared in this scope
   48 |                 if ( used[i] == 0) euler_tour(i, -1);
      |                      ^~~~