Pagini recente » Cod sursa (job #1249657) | Cod sursa (job #840759) | Cod sursa (job #314594) | Cod sursa (job #313887) | Cod sursa (job #68855)
Cod sursa(job #68855)
var a:array[1..3000,1..3000] of integer;
f,g:text;
n,j,x,y:integer;
nr,m,i:longint;
begin
assign(f,'triplete.in'); reset(f);
assign(g,'triplete.out'); rewrite(g);
read(f,n,m);
nr:=0;
for i:=1 to m do begin
read(f,x,y);
a[x,y]:=1;
a[y,x]:=1;
for j:=1 to n do
if (a[x,j]=1) and (a[y,j]=1) then
inc(nr);
end;
writeln(g,nr);
close(f); close(g);
end.