#2334: REcode216


cz908640443 (陈植)

學校 : 浙江省绍兴市第一中学
編號 : 7216
來源 : [61.174.215.174]
最後登入時間 :
2013-07-24 19:19:48
d380. 10106 - Product -- UVa10106 | From: [61.174.215.174] | 發表日期 : 2009-09-01 14:36

var
  bao:int64;
  a:array[1..300]of int64;
  b:array[1..300]of int64;
  c:array[1..300]of int64;
  cg:array[1..300,1..300]of int64;
  cs,cc:int64;
  i,j,k,n,x,y,t,bu,g,o,p:longint;
  an:ansistring;
  st:string[8];
  ch:char;
procedure into;
  begin
    read(an);
    k:=0;
    if length(an) mod 8<>0
       then begin
         inc(k);
         st:=copy(an,1,length(an) mod 8);
         val(st,a[k]);
         delete(an,1,length(an) mod 8);
       end;
    if an<>''
       then begin
    repeat
      inc(k);
      st:=copy(an,1,8);
      val(st,a[k]);
      delete(an,1,8);
    until length(an)=0;
    end;
    x:=k;
    for i:=1to k do begin
      b[x-i+1]:=a[i];
      a[i]:=0;
    end;
    readln;
  end;
procedure xiaoling;
  begin
    repeat
      i:=y;
      if c[i]<>0
         then exit
         else begin
           y:=y-1;
           xiaoling;
         end;
    until y<=0;
  end;
procedure outpp;
  begin
    for i:=y downto 1do begin
    if i<>y
       then begin
         if c[i]<=9
            then write('0000000')
            else if c[i]<=99
              then write('000000')
              else if c[i]<=999
                then write('00000')
                else if c[i]<=9999
                  then write('0000')
                  else if c[i]<=99999
                    then write('000')
                    else if c[i]<=999999
                      then write('00')
                      else if c[i]<=9999999
                        then write(0);
    end;
    write(c[i]);
  end;
end;
procedure cheng;
  begin
    into;
    for j:=1to x do begin
      for i:=1to y+1 do begin
        cg[j,i]:=(b[j]*c[i]+g)mod 100000000;
        g:=(b[j]*c[i]+g)div 100000000;
      end;
    end;
    y:=y*x+2;
    fillchar(c,sizeof(c),0);
    for i:=1to y do begin
      o:=i;
      p:=1;
      if (p<=0)or(o<=0)
         then break
         else begin
      repeat
        c[i]:=cg[p,o]+c[i];
        inc(o,-1);
        inc(p);
      until o<=0;
      bao:=c[i];
      c[i]:=(c[i]+g)mod 100000000;
      g:=(bao+g)div 100000000;
    end;
    end;
    xiaoling;
  end;
begin
  while not eof do begin
    x:=0;y:=0;
    into;
    for bu:=1to x do begin
      c[bu]:=b[bu];
      b[bu]:=0;
    end;
    y:=x;
    cheng;
    outpp;
    fillchar(a,sizeof(a),0);
    fillchar(b,sizeof(b),0);
    fillchar(c,sizeof(c),0);
    fillchar(cg,sizeof(cg),0);
  end;
end.
哪位帮看下怎么了? 
#2336: Re:REcode216


cccccc (cc)

學校 : 不指定學校
編號 : 7335
來源 : [61.174.215.174]
最後登入時間 :
2009-09-11 12:21:49
d380. 10106 - Product -- UVa10106 | From: [61.174.215.174] | 發表日期 : 2009-09-02 12:27

var
  bao:int64;
  a:array[1..300]of int64;
  b:array[1..300]of int64;
  c:array[1..300]of int64;
  cg:array[1..300,1..300]of int64;
  cs,cc:int64;
  i,j,k,n,x,y,t,bu,g,o,p:longint;
  an:ansistring;
  st:string[8];
  ch:char;
procedure into;
  begin
    read(an);
    k:=0;
    if length(an) mod 8<>0
       then begin
         inc(k);
         st:=copy(an,1,length(an) mod 8);
         val(st,a[k]);
         delete(an,1,length(an) mod 8);
       end;
    if an<>''
       then begin
    repeat
      inc(k);
      st:=copy(an,1,8);
      val(st,a[k]);
      delete(an,1,8);
    until length(an)=0;
    end;
    x:=k;
    for i:=1to k do begin
      b[x-i+1]:=a[i];
      a[i]:=0;
    end;
    readln;
  end;
procedure xiaoling;
  begin
    repeat
      i:=y;
      if c[i]<>0
         then exit
         else begin
           y:=y-1;
           xiaoling;
         end;
    until y<=0;
  end;
procedure outpp;
  begin
    for i:=y downto 1do begin
    if i<>y
       then begin
         if c[i]<=9
            then write('0000000')
            else if c[i]<=99
              then write('000000')
              else if c[i]<=999
                then write('00000')
                else if c[i]<=9999
                  then write('0000')
                  else if c[i]<=99999
                    then write('000')
                    else if c[i]<=999999
                      then write('00')
                      else if c[i]<=9999999
                        then write(0);
    end;
    write(c[i]);
  end;
end;
procedure cheng;
  begin
    into;
    for j:=1to x do begin
      for i:=1to y+1 do begin
        cg[j,i]:=(b[j]*c[i]+g)mod 100000000;
        g:=(b[j]*c[i]+g)div 100000000;
      end;
    end;
    y:=y*x+2;
    fillchar(c,sizeof(c),0);
    for i:=1to y do begin
      o:=i;
      p:=1;
      if (p<=0)or(o<=0)
         then break
         else begin
      repeat
        c[i]:=cg[p,o]+c[i];
        inc(o,-1);
        inc(p);
      until o<=0;
      bao:=c[i];
      c[i]:=(c[i]+g)mod 100000000;
      g:=(bao+g)div 100000000;
    end;
    end;
    xiaoling;
  end;
begin
  while not eof do begin
    x:=0;y:=0;
    into;
    for bu:=1to x do begin
      c[bu]:=b[bu];
      b[bu]:=0;
    end;
    y:=x;
    cheng;
    outpp;
    fillchar(a,sizeof(a),0);
    fillchar(b,sizeof(b),0);
    fillchar(c,sizeof(c),0);
    fillchar(cg,sizeof(cg),0);
  end;
end.
哪位帮看下怎么了?


好长....我也216...... 
ZeroJudge Forum