Pagini recente » Cod sursa (job #1394515) | Cod sursa (job #1377773) | Cod sursa (job #2370727) | Cod sursa (job #2564219) | Cod sursa (job #1089093)
var i,j,n,m,x,y,k:longint;
u:byte;
a:array[1..1001,1..1001] 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.