QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#341749 | #996. 割点 | jucason_xu# | WA | 4ms | 22116kb | C++14 | 1.1kb | 2024-02-29 21:00:11 | 2024-02-29 21:00:13 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define rd(i,n) for(int i=0;i<n;i++)
#define rp(i,n) for(int i=1;i<=n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=b;i>=a;i--)
#define st string
#define vt vector
#define pb push_back
//#define int long long
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int N=500005;
int n,m,a[N],b[N],c;
int dfn[N],low[N],ti;
vt<int>G[N];
vt<int>ans;
inline void dfs(int x,int p){
dfn[x]=low[x]=++ti;
for(auto i:G[x])if(i!=p){
if(!dfn[i]){
dfs(i,x);
low[x]=min(low[x],low[i]);
}else{
low[x]=min(low[x],dfn[i]);
}
}
if(low[x]==dfn[x])ans.pb(x);
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n>>m;
rp(i,m){
cin>>a[i]>>b[i];
G[a[i]].pb(b[i]);
G[b[i]].pb(a[i]);
}
rp(i,n)if(!dfn[i])dfs(i,0);
sort(ans.begin(),ans.end());
for(auto i:ans)cout<<i<<endl;
return 0;
}
//Rain Rain Rain
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 4ms
memory: 22116kb
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 9 14 23 24 27 28 29 30 33 36 38 39 56 82 93 109 111 112 116 119 120 123 124 129 131 136 142 147 151 154 155 160 166 175 181 183 185 197 201 207 239 265 270 289 293 295 302 313 316 318 319 328 336 347 358 371 373 378 383 387 389 393 400 419 424 440 451 453 471 485 489 494 500 502 511 520 526 530 53...
result:
wrong answer 1st numbers differ - expected: '1440', found: '1'