|
|
вернуться в форумPlease look, why wrong? Memory Limit Exceeded?Help Послано Sergey 23 апр 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; Re: Please look, why wrong? Memory Limit Exceeded?Help Послано Lion 31 июл 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 Послано Lion 31 июл 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 Послано Lion 31 июл 2003 21:07 > > > a,b:array[1..1000000]of char; > You have used more than 1000K , so You're wrong > |
|
|