제출 #743396

#제출 시각아이디문제언어결과실행 시간메모리
743396Dan4Life어르신 집배원 (BOI14_postmen)C++17
0 / 100
9 ms12500 KiB
#include <bits/stdc++.h>
using namespace std;
#define sz(a) (int)a.size()
#define pb push_back
#define int long long
const int mxN = (int)5e5+10;
int n, m, vis[mxN], vis1[mxN], nx[mxN];
vector<pair<int,int>> v, adj[mxN];

void dfs(int s){
	vis[s]=1;
	while(sz(adj[s])){
		auto [u,e] = adj[s].back(); adj[s].pop_back();
		if(vis1[e]) continue; vis1[e]=1; 
		if(vis[u]==1){
			int p = u;
			while(vis[p]) cout<<p<<" ", vis[p]=0, p = nx[p];
			cout << "\n";
		}
		nx[s]=u, dfs(u);
	}
}

int32_t main(){
	cin >> n >> m;
	for(int i = 0; i < m; i++){
		int a, b; cin >> a >> b;
		adj[a].pb({b,i}); adj[b].pb({a,i});
	}
	dfs(1);
}

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

postmen.cpp: In function 'void dfs(long long int)':
postmen.cpp:14:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   14 |   if(vis1[e]) continue; vis1[e]=1;
      |   ^~
postmen.cpp:14:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   14 |   if(vis1[e]) continue; vis1[e]=1;
      |                         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...