Mai intai trebuie sa te autentifici.
Cod sursa(job #287579)
Utilizator | Data | 24 martie 2009 23:06:35 | |
---|---|---|---|
Problema | Triplete | Scor | 60 |
Compilator | fpc | Status | done |
Runda | aa | Marime | 0.6 kb |
var a:array[1..4090,1..4090]of boolean;
i,j,n,nr:integer; m,k:0..65537;
f,g:text;
begin
assign(f,'triplete.in');reset(f);
assign(g,'triplete.out');rewrite(g);
readln(f,n,m);
for i:=1 to n do
for j:=1 to n do a[i,j]:=false;
for k:=1 to m do
begin
readln(f,i,j);
a[i,j]:=true;
a[j,i]:=true;
end;
for i:=1 to n do
for j:=i+1 to n do
begin
if a[i,j]=true then
for k:=j+1 to n do
if a[i,k]=true then
if a[j,k]=true then inc(nr);
end;
writeln(g,nr);
close(f);
close(g);
end.