|
|
вернуться в форумI have AC Послано OSPU 15 мар 2003 13:04 program a1048; const nn=500003; var a:array[0..nn] of byte; i,j,c,b,n:longint; procedure mass(i:longint;x:byte); begin if i mod 2=0 then a[i div 2]:=(a[i div 2] mod 10)+x*10 else a[i div 2]:=(a[i div 2] div 10)*10+x; end; function mas(i:longint):byte; begin if i mod 2 =0 then mas:=a[i div 2] div 10 else mas:=a[i div 2] mod 10; end; begin fillchar(a,SizeOf(a),0); readln(n); for i:=1 to n do begin readln(b,c); b:=b+c; for j:=i downto 1do begin b:=b+mas(j); mass(j,b mod 10); b:=b div 10; if b=0 then break; end; end; for i:=1 to n do write(mas(i)); writeln; end. OK, please, stop do it! If you're so clever, don't post your AC's on the board (-) I agree lord, don`t continue pasting AC :) (-) > Re: I have AC What a long, slow, big program! |
|
|