ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1864. Get-Together at Den's

WA 3
Posted by Zhandarbek 15 Oct 2011 17:08
why WA on 3 test?
Re: WA 3
Posted by George_Aloyan[PTSObninsk] 15 Oct 2011 17:15
Not all friends should get money from DAN
Re: WA 3
Posted by andy 15 Oct 2011 17:19
and...???
Re: WA 3
Posted by George_Aloyan[PTSObninsk] 15 Oct 2011 17:31
And you should give them their money not thinking of ALL the liters someone brought, but of the liters he paid, but didn't drink.
E.G.

var
  k, i, s, n: longint;
  a: array[1..100] of longint;
begin
  readln(n);
  for i :=1 to n do
    begin
      read(a[i]);
      s := s + a[i];
    end;
  for i := 1 to n do
    begin
      write((a[i]*100) div s, ' ');
    end;
end. - WA3

var
  k, i, s, n: longint;
  a: array[1..100] of longint;
begin
  readln(n);
  for i :=1 to n do
    begin
      read(a[i]);
      s := s + a[i];
    end;
  s := s div (n + 1);
  for i := 1 to n do
    a[i] := a[i] - s;
  s := 0;
  for i := 1 to n do
    if a[i] > 0 then
      s := s + a[i];
  for i := 1 to n do
  begin
    if (a[i] > 0) then
      write((a[i]*100) div s, ' ')
    else
      write('0 ');
  end;
end. - WA6.
And then I came to WA 9)
I've done some more mistakes, for example i must calculate real numbers, but i did everything with integer, but it is discussed in sime other topics

Edited by author 15.10.2011 18:37