|
|
вернуться в форумWA13 Why!!!! Послано ZiV 31 янв 2006 16:42 Const MaxN = 500; Answer is sum of edjes in graph and subgraphs(except graphs with one vertex)... Var n,m,i,j,k,x: longint; b,c : array[1..MaxN] of Word; BEGIN Read(m,n); K := 0; Fillchar(c,sizeof(c),0); For i := 1 to m do b[i] := i; For i := 1 to m do For j := 1 to n do Begin Read(x); if x <> i then Inc(k); // I count number of edjes b[x] := b[i]; End; For i := 1 to m do Begin Inc(c[b[i]]); if c[b[i]] = 2 then Inc(k); // Here i count number of subgraphs End; Writeln(k-1+byte((k-1)<0)); END. Re: WA13 Why!!!! Послано Okey 25 сен 2007 19:13 I am WA too.... who can give us any hits??? |
|
|