QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#995. 桥

الإحصائيات

题目描述

给出一个 $n$ 个点,$m$ 条边的无向图,求图的桥。

输入格式

第一行输入两个正整数 $n, m$。

下面 $m$ 行每行输入两个正整数 $x,y$ 表示 $x$ 到 $y$ 有一条边。

输出格式

输出若干行,每行一条边,表示所有的桥边,按照输入的顺序进行输出,不能调换两端点的顺序

图中可能含有重边与自环。

样例数据

样例 1 输入

6 7
1 2
1 3
1 4
2 5
3 5
4 5
5 6

样例 1 输出

5 6

样例 2 输入

10 13
1 2
2 3
3 4
4 5
1 5
2 5
1 6
6 7
6 8
6 9
8 9
9 10
9 10

样例 2 输出

1 6
6 7

子任务

对于全部数据,$1 \leq n \leq 10^5, 1 \leq x,y \leq n , 1 \leq m \leq 5 \times 10^5$.

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.