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 1048. Superlong Sums

Please look, why wrong? Memory Limit Exceeded?Help
Posted by Sergey 23 Apr 2003 23:55
{ @JUDGE_ID: 21830HZ 1048 Pascal }
var res:AnsiString;
    i,tmpa,tmpb,tmp,k,ind,sdvig:integer;
    n,j:integer;
    tmps:string[3];
    a,b:array[1..1000000]of char;
    longint
begin
     readln(n);
     for i:=1 to n do
     begin
          readln(tmps);
          a[i]:=tmps[1];
          b[i]:=tmps[3];
     end;
    res:='';
     for i:=n downto 1 do
     begin
          val(a[i],tmpa,tmp);
          val(b[i],tmpb,tmp);
          tmp:=tmpa+tmpb+sdvig;
          if tmp>=10 then
             begin
                  Sdvig:=1;
                  str(tmp,tmps);
                  res:=res+tmps[2];
                  if i=1 then res:=res+tmps[1];
             end
             else
             begin
                  Sdvig:=0;
                  str(tmp,tmps);
                  res:=res+tmps;
             end;
          tmps:='';
          inc(ind);
     end;
     Writeln;
     for i:=length(res) downto 1 do Write(res[i]);
end.
a,b:array[1..1 000 000]of char;
Posted by Evil Hacker 24 Apr 2003 01:04
Re: Please look, why wrong? Memory Limit Exceeded?Help
Posted by Lion 31 Jul 2003 21:03

>     a,b:array[1..1000000]of char;
You have used more than 1000K , so You're wrong
Re: Please look, why wrong? Memory Limit Exceeded?Help
Posted by Lion 31 Jul 2003 21:04
>
>a,b:array[1..1000000]of char;> You have used more than 1000K , so
You're wrong
>
a,b:array[1..1000000]of char;You have used more than 1000K , so You're wrong
Posted by Lion 31 Jul 2003 21:07
>
> >     a,b:array[1..1000000]of char;
> You have used more than 1000K , so You're wrong
>