제출 #244513

#제출 시각아이디문제언어결과실행 시간메모리
244513dantoh000Pipes (CEOI15_pipes)C++14
30 / 100
499 ms24700 KiB
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> ii; int n,m; bitset<10005> M[10005]; bitset<10005> G[10005]; int num[10005]; int p[10005]; int low[10005]; int ct = 1; void dfs(int u){ low[u] = num[u] = ct++; for (int v = 1; v <= n; v++){ if (G[u][v]){ if (num[v] == 0){ p[v] = u; dfs(v); if (low[v] > num[u]){ if (M[u][v] == 0){ printf("%d %d\n",u,v); } } low[u] = min(low[u],low[v]); } else if (v != p[u]){ low[u] = min(low[u],num[v]); } } } } int main(){ scanf("%d%d",&n,&m); for (int i = 0; i < m; i++){ int u,v; scanf("%d%d",&u,&v); if (G[u][v]){ M[u][v] = M[v][u] = 1; } else{ G[u][v] = G[v][u] = 1; } } for (int i = 1; i <= n; i++){ if (num[i] == 0){ dfs(i); } } }

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

pipes.cpp: In function 'int main()':
pipes.cpp:32:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
pipes.cpp:35:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&u,&v);
         ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...