Cod sursa(job #11907)
Utilizator | Data | 2 februarie 2007 12:08:18 | |
---|---|---|---|
Problema | Triplete | Scor | 20 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
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.