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 1150. Page Numbers

Help! Why do I get WA?
Posted by zhou MX 19 Feb 2002 18:11

I think my program is right , but I get WA .

program Ural_1150;
        // Digits
const
  bit:array[1..10] of longint=
(1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000);
var
  num:array[0..9] of longint;
  n,i,j,x:longint;

begin
  readln(n);
  for i:=1 to 9 do
  begin
    x:=n mod bit[i+1] div bit[i];
    for j:=1 to 9 do
    begin
      num[j]:=num[j]+n div bit[i+1]*bit[i];
      if x>j then
        num[j]:=num[j]+bit[i]
      else
      if x=j then
        num[j]:=num[j]+n mod bit[i]+1;
    end;
    if n>=bit[i+1] then
    begin
      num[0]:=num[0]+n div bit[i+1]*bit[i]-bit[i];
      if x>0 then
        num[0]:=num[0]+bit[i]
      else
        num[0]:=num[0]+n mod bit[i]+1;
    end;
  end;
  for i:=0 to 9 do
    writeln(num[i]);
end.
I've got AC.
Posted by zhou MX 3 Mar 2002 08:27
fuck you sukers!
Posted by ratrax21 17 Mar 2003 13:50
> sucket!
Re: fuck you sukers!
Posted by Vadim 25 Nov 2018 19:42
I got AC too, loser:)