QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#342788 | #996. 割点 | ycz# | WA | 16ms | 20116kb | C++14 | 832b | 2024-03-01 16:53:55 | 2024-03-01 16:53:55 |
Judging History
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=5e5+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]);
// if(low[u.F]>dfn[x]) v[wh]=1;
}
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};
fq(i,1,n) if(!dfn[i]) tarjan(i,-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: 16ms
memory: 20116kb
input:
12783 21968 4933 7832 8238 2739 3628 7841 9169 6390 7850 8797 8120 8710 5306 9807 10166 2063 2666 5157 5015 4651 4790 12586 10366 7137 12440 7218 6330 3670 2735 8492 1968 2750 6237 1112 6578 9221 743 3820 7155 4583 2537 9747 11331 9916 4454 5631 2978 10340 5293 1803 4944 4296 11800 2742 7903 2018 10...
output:
8244 4436 10218 9890 45 10438 5222 11555 6660 9097 316 9478 1260 12246 9764 7892 2693 6250 10601 1025 4562 23 6476 788 10767 2729 6739 5949 1127 3289 7774 5568 1227 5873 12284 2970 2005 12009 11362 10348 644 9037 47 3313 1648 8225 1596 12385 5567 8564 2864 12117 1677 12274 5056 8543 8869 7486 4642 4...
result:
wrong answer 1st numbers differ - expected: '1440', found: '8244'