Pagini recente » Cod sursa (job #2294695) | Cod sursa (job #2192999) | Cod sursa (job #3216251) | Cod sursa (job #1908787) | Cod sursa (job #45651)
Cod sursa(job #45651)
const MAX=4096;
var f,g:text;
a:array[1..MAX,1..MAX] of byte;
{ v:array[0..MAX*MAX] of byte;}
t,n1,n2,n3,nt,x,y,n,m,i,j,k,num:word;
begin
assign(f,'triplete.in');
reset(f);
read(f,n,m);
num:=0;
for t:=1 to m do begin
read(f,i,j);
if a[i,j]=1 then continue;
a[i,j]:=1;
a[j,i]:=1;
for k:=1 to n do begin
if (a[i,k]=0) or (a[k,j]=0) then continue;
num:=num+1;
end;
end;
close(f);
assign(g,'triplete.out');
rewrite(g);
writeln(g,num);
close(g);
end.