cyho2015 2015-10-20 13:57
:verygood: :verygood: :verygood: :saujai:
smalleyes 2015-10-20 14:33
回復 3# 的帖子
thanks so much...
793076670 2015-10-20 14:39
回復 1# 的帖子
我要看看看看看看看
bbwden 2015-10-20 14:47
Thanks for sharing.
5643 2015-10-20 18:44
[table=98%][tr][td][table=98%][tr][td]Thanks a lot[/td][/tr][/table]
[/td][/tr][tr][td][/td][/tr][/table]
wings3612 2015-10-20 21:02
thanks for your sharing
talivong 2015-10-20 21:10
:verygood:
as2as 2015-10-21 00:00
内容hhhhhhhhhhhh
go1234 2015-10-24 01:23
Ggffdsaaaassddf
samlau16 2015-10-24 18:41
Thx for sharing
youio 2015-10-24 19:39
qqqqqqqqqqqqqqqqq
tol1231 2015-10-24 19:42
Thx very much
a09330903 2015-10-29 22:54
本帖隱藏的內容需要回復才可以瀏覽
sdu2 2015-10-30 09:52
*** 作者被禁止或刪除 內容自動屏蔽 ***
Ricks 2015-11-9 11:42
Great....nice and thanks!
Johntin 2015-11-9 11:53
ccccccccccccc
After_80 2015-11-10 01:29
感謝分享
真實自拍
thank you very much
MANGAKAN 2015-11-10 12:09
回復 1# 的帖子
Thankfully
love4321 2015-11-10 12:25
Thank you
hung.600426 2015-11-22 14:54
正正正正正正正正正正正正正正正正正正
morewei 2015-11-22 15:11
:verygood: :verygood:
無限sky 2015-11-22 15:24
ccccccccccc
erike 2015-11-22 15:52
Thanks thanks
man818 2015-11-22 16:10
支持一下支持你!!!
katgnow 2015-11-22 20:34
thanks for sharing
lzt2002 2015-11-22 21:36
/*
Name:
Copyright: lzt2002
Author: lzt2002
Date: 20/08/15 22:18
Description:
*/
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
#define havetxt 0
#define shuru "input.txt"
#define shuchu "output.txt"
#define inf 0x7fffffff
#define esp 1e-9
#define mod 1000000007
typedef long long ll;
int u[22222],s[22222],v[22222],mark;
vector<int> adj[22222],G[22222];
int n,m,c;
int nin[22222],nout[22222];
void dfs1(int x)
{
u[x]=1;
for(int i=0;i<G[x].size();i++)
{
if(!u[G[x][i]]) dfs1(G[x][i]);
}
s[c++]=x;
}
void dfs2(int x)
{
if(u[x]!=0) return;
u[x]=mark;
for(int i=0;i<adj[x].size();i++)
{
if(!u[adj[x][i]]) dfs2(adj[x][i]);
}
}
int main()
{
int T;
cin>>T;
while(T--)
{
memset(u,0,sizeof(u));
memset(G,0,sizeof(G));
memset(adj,0,sizeof(adj));
mark=0;
c=0;
cin>>n>>m;
for(int i=0;i<m;i++)
{
int a,b;
cin>>a>>b;
G[a].push_back(b);
adj[b].push_back(a);
}
for(int i=1;i<=n;i++)
{
if(!u[i]) dfs1(i);
}
memset(u,0,sizeof(u));
for(int i=n-1;i>=0;i--)
{
if(!u[s[i]])
{
++mark;
dfs2(s[i]);
}
}
if(mark==1)
{
cout<<0<<endl;
continue;
}
memset(nin,0,sizeof(nin));
memset(nout,0,sizeof(nout));
for(int i=1;i<=n;i++)
{
for(int j=0;j<G[i].size();j++)
{
if(u[i]!=u[G[i][j]])
{
nin[G[i][j]]++;
nout[i]++;
}
}
}
int nin0=0,nout0=0;
for(int i=1;i<=n;i++)
{
if(nin[i]==0)
{
nin0++;
}
else if(nout[i]==0)
{
nout0++;
}
}
cout<<max(nin0,nout0)<<endl;
}
return 0;
}
卍邪神卍 2015-11-23 00:17
回復 2# 的帖子
:loveeyes: :loveeyes: :hamsup: :hamsup:
jk25711770 2015-11-23 01:04
Cccccccccccccc
nomvn 2015-11-23 01:50
回復 2# 的帖子
ccccccccccccccc
nomvn 2015-11-23 01:51
回復 3# 的帖子
ccccccccccccccccccc
Panda999999 2015-11-23 06:43
*** 作者被禁止或刪除 內容自動屏蔽 ***
閒雜人等 2015-11-23 08:41
thank you for sharing :verygood:
19380112 2015-11-23 09:43
thanks for sharing :verygood: :verygood:
dick169 2015-11-23 10:06
:loveeyes: :loveeyes: :loveeyes: :loveeyes: :loveeyes: :loveeyes: :loveeyes: :loveeyes:
Gunbird 2015-11-23 10:10
thanks for sharing
flyinglipas 2015-12-1 14:44
Thank you for sharing
rockharder 2015-12-1 14:52
cccccccccccccccccccccccccccc
ericmahahaha 2015-12-1 14:55
回復 2# 的帖子
:loveliness: :loveliness: :loveliness: :loveliness:
giveson 2015-12-1 14:59
Thanks for sharing!
penny1234 2015-12-2 01:08
cccccccccccccc
qqqkkk 2015-12-13 23:50
:funk: :funk: :funk: :funk: :funk:
kasama_shin 2015-12-13 23:53
Thanks for sharing bro
desy428 2015-12-14 21:20
thxxxxxxxxxxxxxx
goodbaba 2015-12-14 21:47
:clap: :clap: :clap:
c9lover2009 2015-12-14 21:51
thanks for share
one9stand 2015-12-14 21:52
Thanks for sharing
CPKTVman 2015-12-14 21:54
cccccccccccccccccccc
yellowbee36 2015-12-14 21:59
:clap: :jump: :clap: :clap: :clap:
wai8899 2015-12-18 17:24
回復 1# 的帖子
wa...wa...wa...:loveeyes:
shevcbutlo 2015-12-18 17:44
回復 3# 的帖子
Thanks for share