Pagini recente » Cod sursa (job #2614307) | Cod sursa (job #1404752) | Cod sursa (job #1445154) | Cod sursa (job #1688365) | Cod sursa (job #11907)
Cod sursa(job #11907)
program triplete;
var n,m,i,j:word;
t:array[1..4096,1..4096]of boolean;
x,y:array[1..65536]of integer;
nr:longint;
f:text;
begin
assign(f,'triplete.in');reset(f);
readln(f,n,m);
for i:=1 to m do begin
readln(f,x[i],y[i]);
t[x[i]][y[i]]:=true;
t[y[i]][x[i]]:=true;
end;
close(f);
for i:=1 to m do
for j:=1 to n do
if (t[j][x[i]])and(t[j][y[i]]) then inc(nr);
nr:=nr div 3;
assign(f,'triplete.out');rewrite(f);
write(f,nr);
close(f);
end.