QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#792452 | #996. 割点 | bugmaker3243 | WA | 3ms | 11356kb | C++20 | 2.2kb | 2024-11-29 10:21:24 | 2024-11-29 10:21:24 |
Judging History
answer
#include<bits/stdc++.h>
#define N 500005
//#define gc() (iS==iT?(iT=(iS=ibuf)+fread(ibuf,1,SIZE,stdin),(iS==iT?EOF:*iS++)):*iS++)
#define gc() getchar()
#define fi first
#define se second
#define Kamisato return
#define Ayaka 0;
#define file(_s) freopen(#_s".in","r",stdin);freopen(#_s".out","w",stdout);
//#define CHECK_MEMORY ___JQH___
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf=1e9;
const ll INF=2e18;
bool Memory_Begin;
namespace IO{const int SIZE=(1<<21)+1;char ibuf[SIZE],*iS,*iT,obuf[SIZE],*oS=obuf,*oT=oS+SIZE-1,c,qu[55];int f,qr;inline void flush(){fwrite(obuf,1,oS-obuf,stdout),oS=obuf,fflush(stdout);}inline void putc(char x){*oS++=x;if(oS==oT)flush();}template <class I>inline void read(I &x){for(f=1,c=gc();c<'0'||c>'9';c=gc())if(c=='-')f=-1;for(x=0;c<='9'&&c>='0';c=gc())x=x*10+(c&15);x*=f;}template <class I>inline void print(I x){if(!x)putc('0');if(x<0)putc('-'),x=-x;while(x)qu[++qr]=x%10+'0',x/=10;while(qr)putc(qu[qr --]);}inline void reads(string &s){s.clear();for(c=gc();c<33||c>126;)c=gc();for(;c>=33&&c<=126;c=gc())s.push_back(c);}inline void prints(string s){for(char c:s)putc(c);}struct Flusher_ {~Flusher_(){flush();}}io_flusher_;}
using IO::read;using IO::putc;using IO::print;using IO::reads;using IO::prints;
template<class I>I updiv(I x,I y){return (x%y==0?x/y:x/y+1);}
template<class I>bool cmin(I &x,I y){if(x>y)return x=y,1;return 0;}
template<class I>bool cmax(I &x,I y){if(x<y)return x=y,1;return 0;}
int n,m,x[N],y[N];
vector<pii>s[N];
int dfn[N],low[N],sign;
bool cut[N];
void tarjan(int x,int prt)
{
dfn[x]=low[x]=++sign;
for(pii i:s[x])
{
int y=i.fi,id=i.se;
if(id==prt) continue;
if(!dfn[y])
{
tarjan(y,id),cmin(low[x],low[y]);
}
else cmin(low[x],dfn[y]);
}
if(dfn[x]==low[x]) cut[x]=1;
}
bool Memory_End;
signed main()
{
#ifdef CHECK_MEMORY
cerr<<"Memory: "<<(&Memory_End-&Memory_Begin)/1048576.0<<" MiB\n";
#endif
read(n),read(m);
for(int i=1;i<=m;i++)
{
read(x[i]),read(y[i]);
s[x[i]].push_back({y[i],i});
s[y[i]].push_back({x[i],i});
}
for(int i=1;i<=n;i++) if(!dfn[i]) tarjan(i,0);
for(int i=1;i<=n;i++) if(cut[i]) print(i),putc('\n');
Kamisato Ayaka
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 11356kb
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'