QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#342765#995. 桥ycz#WA 272ms23864kbC++14740b2024-03-01 16:48:192024-03-01 16:48:20

Judging History

你现在查看的是最新测评结果

  • [2024-03-01 16:48:20]
  • 评测
  • 测评结果:WA
  • 用时:272ms
  • 内存:23864kb
  • [2024-03-01 16:48:19]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define fq(i,l,r) for(int i=(l);i<=(r);i++)
#define ffq(i,r,l) for(int i=(r);i>=(l);i--)
#define pii pair<int,int>
#define F first
#define S second
const int N=2e5+9;
int n,m,x,y,dfn[N],low[N],cnt,v[N];
struct A{int u,v;} e[N];
vector<pii> q[N];
void tarjan(int p,int wh){
    low[p]=dfn[p]=++cnt;
    for(auto u:q[p]) 
        if(!dfn[u.F]) tarjan(u.F,u.S),low[p]=min(low[p],low[u.F]);
        else if(u.S!=wh) low[p]=min(low[p],dfn[u.F]);
    if(dfn[p]<=low[p]) v[wh]=1;
}
int main(){
    cin>>n>>m;
    fq(i,1,m) cin>>x>>y,q[x].push_back({y,i}),q[y].push_back({x,i}),e[i]={x,y};
    tarjan(1,-1);
    fq(i,1,m) if(v[i]) cout<<e[i].u<<" "<<e[i].v<<endl;
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 272ms
memory: 23864kb

input:

24942 387166
12556 21443
22404 16376
11073 24296
1535 11968
23745 2818
5073 12731
22550 14761
24118 12008
22695 18979
15118 13639
2080 8721
692 22578
22581 15267
9278 4127
7457 21674
17693 23448
10949 23429
9700 6009
14140 5064
7742 15164
17336 1662
18903 9760
17645 19575
6540 11942
11 4937
15282 10...

output:

12556 21443
22404 16376
11073 24296
1535 11968
23745 2818
5073 12731
22550 14761
24118 12008
22695 18979
15118 13639
2080 8721
692 22578
22581 15267
9278 4127
7457 21674
17693 23448
10949 23429
9700 6009
14140 5064
7742 15164
17336 1662
18903 9760
17645 19575
6540 11942
11 4937
15282 10861
22639 159...

result:

wrong output format Extra information in the output file