Gravatar
leon
积分:1499
提交:485 / 1163

Gravatar
瑆の時間~無盡輪迴·林蔭
积分:3363
提交:807 / 1554
回复 @noip : 附议,Cogs ac在洛谷只有55分,

Gravatar
瑆の時間~無盡輪迴·林蔭
积分:3363
提交:807 / 1554
回复 @noip : 附议,Cogs ac在洛谷只有55分,

Gravatar
Shirry
积分:2254
提交:554 / 1107
tarjan

Gravatar
Albert S. Chang
积分:197
提交:58 / 74
COGS的淼数据没有“有多个SCC的出度都为0”的数据,所以不判断符合要求的SCC是否唯一也可以AC,然而POJ是有这样的数据的...

Gravatar
Hallmeow
积分:1513
提交:469 / 1048
VIP蒟蒻的百题纪念。

Gravatar
rvalue
积分:720
提交:213 / 573
数据弱QwQ这能过的代码POJ 2186死活不过

Gravatar
Rapiz
积分:1619
提交:386 / 700
邻接矩阵开不了的统计奇技淫巧
证明:缩点后的图中有出度的点不是受欢迎的。
假设它受欢迎,则所有点到它都有边,所以它和它的出点互达。因此不是DAG,与题设矛盾。
立得受欢迎的点出度为0
然而这说明出度为0是必要条件而不是充分条件。
所以要判断有几个这样的点。

Gravatar
哒哒哒哒哒!
积分:3350
提交:1118 / 2737

Gravatar
Skyo
积分:722
提交:222 / 599
在 poj 上 过不了 wa
啊啊 求助 poj 2186

Gravatar
提莫
积分:6
提交:3 / 7
回复 @◆半城烟沙灬你打天下 :
~~~装逼遭雷劈!!!~~~

Gravatar
OI永别
积分:568
提交:240 / 406
回复 @FF_Sky||幻 : VIP这TM的是填空题么???

Gravatar
OI永别
积分:568
提交:240 / 406
VIP上面的2b不要再刷了,2不2啊

Gravatar
LuciFer_T-J
积分:118
提交:81 / 123
#include<cstring>
#include<iostream>
#include<cstdio>
using namespace std;
#define __________________ 10005
#define ___________________ 50005
struct node{
int __________, ___________;
}________________[___________________];
int _________________[__________________],____[___________________];
int _[__________________],______[__________________],_____[__________________],___[__________________],__[__________________];
bool ____________________[__________________];
int ______________;
char _______________;
int n,m,s,_______,___s,________,_________;
void _____________(int __________,int ___________){
________________[++s].__________=__________;
________________[s].___________=___________;
____[s]=_________________[__________];
_________________[__________]=s;
}
void ____________(int x){
int i;
_______++;
_[x]=______[x]=_______;
_____[++________]=x;
____________________[x]=1;
for (i=_________________[x];i;i=____[i]){
if (!_[________________[i].___________]){
____________(________________[i].___________);
______[x]=min(______[x],______[________________[i].___________]);
}
else{
if (____________________[x]){
______[x]=min(______[x],_[________________[i].___________]);
}
}
}
if (______[x]==_[x]){
___s++;
while (_____[________+1]!=x){
___[_____[________]]=___s;
__[___s]++;
____________________[_____[________]]=0;
________--;
}
}
}
void _____________________(){
int i;
memset(____________________,1,sizeof(____________________));
for (i=1;i<=m;i++){
if (___[________________[i].__________]==___[________________[i].___________]) continue;
____________________[___[________________[i].__________]]=0;
}
}
int ______________________(){
while ((_______________=getchar()) && (_______________>'9' || _______________<'0'));
______________=_______________-'0';
while ((_______________=getchar()) && (_______________<='9' && _______________>='0')){
______________=______________*10+_______________-'0';
}
return ______________;
}
int main(){
freopen("cow.in","r",stdin);
freopen("cow.out","w",stdout);
int i,__________,___________;
n=______________________();
m=______________________();
s=0;
for (i=1;i<=m;i++){
__________=______________________();
___________=______________________();
_____________(__________,___________);
}
_______=0;
________=0;
___s=0;
for (i=1;i<=n;i++){
if (_[i]) continue;
____________(i);
}
_____________________();
_________=0;
for (i=1;i<=___s;i++){
if (____________________[i]){
if (_________) {
cout<<0<<endl;
return 0;
}
_________=__[i];
}
}
cout<<_________<<endl;
return 0;
}

Gravatar
(ˇˍˇ) ~耶稣
积分:216
提交:110 / 186
回复 @LuciFer_T-J :
~~~装逼遭雷劈!!!~~~

Gravatar
◆半城烟沙灬為你打天下
积分:132
提交:42 / 66
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
struct sky
{
int ff,tt,next;
};
sky c[50005];
int _[10005],__[10005],___[10005],____[10005],_____[10005];
int ______[50005];
bool v[50005];
int n,m,top,now,colors,ans,tot,ret;
char ch;
inline void add(int x,int y)
{
tot++;
c[tot].ff=x;
c[tot].tt=y;
c[tot].next=______[x];
______[x]=tot;
}
inline int read()
{
while (!isdigit(ch = getchar()));
ret = ch-48;
while (isdigit(ch = getchar())) (ret *= 10) += ch-48;
return ret;
}
void tarjan(int x)
{
now++;
_[x]=__[x]=now;
___[++top]=x;
v[x]=1;
for (int i=______[x];i;i=c[i].next)
{
if (!_[c[i].tt])
{
tarjan(c[i].tt);
__[x]=min(__[x],__[c[i].tt]);
}
else
{
if (v[x])
{
__[x]=min(__[x],_[c[i].tt]);
}
}
}
if (__[x]==_[x])
{
colors++;
while (___[top+1]!=x)
{
____[___[top]]=colors;
_____[colors]++;
v[___[top]]=0;
top--;
}
}
}
int main()
{
freopen("cow.in","r",stdin);
freopen("cow.out","w",stdout);
n = read(); m = read();
memset(______,0,sizeof(______));
tot=0;
for (int i=1;i<=m;i++)
{
int x,y;
x=read();y=read();
add(x,y);
}
now=top=colors=0;
memset(_____,0,sizeof(_____));
memset(_,0,sizeof(_));
memset(v,0,sizeof(v));
for (int i=1;i<=n;i++)
{
if (_[i]) continue;
tarjan(i);
}
memset(v,1,sizeof(v));
for (int i=1;i<=tot;i++)
{
if (____[c[i].ff]==____[c[i].tt]) continue;
v[____[c[i].ff]]=0;
}
ans=0;
for (int i=1;i<=colors;i++)
{
if (v[i])
{
if (ans)
{
printf("0");
return 0;
}
ans=_____[i];
}
}
printf("%d",ans);
}

Gravatar
FF_Sky||幻
积分:182
提交:98 / 189
这成了机房里的竞速题了- -

Gravatar
noip
积分:177
提交:34 / 95
数据太弱了。。。我的明显错误做法都能过

Gravatar
依然。。寒冰
积分:160
提交:71 / 139
因为入度会有重边,所以要求出度。

Gravatar
cstdio
积分:4748
提交:1198 / 2108
一开始居然把分支内部的边也算到它的入度里了……智商是硬伤……