QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#92093#996. 割点SoyTony#WA 3ms5252kbC++141.3kb2023-03-30 10:40:262023-03-30 10:40:30

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-30 10:40:30]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:5252kb
  • [2023-03-30 10:40:26]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int maxn=2e4+10;
const int maxm=1e5+10;

inline int read(){
    int x=0,w=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}
    while(c<='9'&&c>='0'){x=(x<<3)+(x<<1)+c-'0';c=getchar();}
    return x*w;
}

int n,m;
struct Graph{
    vector<int> E[maxn];
    inline void add_edge(int u,int v){
        E[u].push_back(v);
        E[v].push_back(u);
    }
    int dfn[maxn],dfncnt,low[maxn];
    vector<int> ans;
    inline void Tarjan(int rt,int u){
        dfn[u]=++dfncnt,low[u]=dfn[u];
        int cnt_subtree=0;
        for(int v:E[u]){
            if(!dfn[v]){
                Tarjan(rt,v);
                ++cnt_subtree;
                low[u]=min(low[u],low[v]);
                if(low[v]>=dfn[u]) ans.push_back(u);
            }
            else low[u]=min(low[u],dfn[v]);
        }
        if(u==rt&&cnt_subtree>1) ans.push_back(u);
    }
    inline void solve(){
        for(int u=1;u<=n;++u){
            if(!dfn[u]) Tarjan(u,u);
        }
        sort(ans.begin(),ans.end());
        ans.erase(unique(ans.begin(),ans.end()),ans.end());
        for(int i:ans) printf("%d\n",i);
    }
}G;

int main(){
    n=read(),m=read();
    for(int i=1;i<=m;++i){
        int u=read(),v=read();
        G.add_edge(u,v);
    }
    G.solve();
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 5252kb

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:

1
13
22
26
27
29
33
35
37
39
45
47
53
56
62
78
91
118
127
132
144
151
155
156
163
166
168
177
181
183
187
192
194
196
205
219
220
223
225
239
248
250
254
256
265
270
285
290
302
313
315
337
338
347
356
358
376
386
388
408
414
415
427
446
459
461
464
477
486
504
513
519
530
538
555
557
571
574
608
61...

result:

wrong answer 1st numbers differ - expected: '1440', found: '1'