Pagini recente » Cod sursa (job #2712281) | Cod sursa (job #1500295) | Cod sursa (job #2323111) | Cod sursa (job #3243877) | Cod sursa (job #1089094)
var i,j,n,m,x,y,k:longint;
u:byte;
a:array[1..100001,1..1000001] of byte;
begin
assign(input,'dfs.in');
assign(output,'dfs.out');
reset(input);
rewrite(output);
read(n); readln(m);
for i:=1 to m do
begin
read(x); readln(y);
a[x][y]:=1;
end;
k:=n;
for i:=1 to n do
begin
u:=1;
for j:=i to n do
begin
if u=1 then
if a[i][j]=1 then begin u:=0; dec(k) end;
end;
end;
writeln(k);
close(input);
close(output);
{Totusi este trist in lume}
end.