|
|
back to boardWA8!!! var a : array[1..150] of integer; n, i, j, k, m, t, l : integer; begin readln(n); for i := 1 to n do begin readln(a[i]); end; for i := 1 to n do begin for j := 1 to n - i do begin if a[j] < a[j + 1] then begin t := a[j]; a[j] := a[j + 1]; a[j + 1] := t; end; end; end; i := 2; k := 1; while i <= n do begin if a[i] = a[i - 1] then begin inc(k); end else begin inc(m); if k >= 4 then begin inc(l); end; k := 1; end; inc(i); end; l := l + (k div 4); writeln(l); end. Why is WA? |
|
|