Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

2229

Posted by dfoierzwk at 2007-02-16 17:25:52 on Problem 2229
runtime error 是什么意思
请各位大牛指点小弟(附程序)
type
  arr=record
    s:array[1..250] of longint;
    l:longint;
end;
var
  n,i,j:longint;len:longint;
  opt:array[1..1000000] of arr;
  a,b:array[1..250] of longint;

function max(a,b:longint):longint;
begin
  if a>b then exit(a)
         else exit(b);
end;

begin
  readln(n);
  opt[1].s[1]:=1;opt[2].s[1]:=2;
  opt[1].l:=1;opt[2].l:=1;
  for i:=3 to n do
    begin
      if odd(i) then begin
        opt[i].l:=opt[i-1].l;
        for j:=1 to opt[i-1].l do
          opt[i].s[j]:=opt[i-1].s[j];
        end
                else begin
         fillchar(a,sizeof(a),0);
         fillchar(b,sizeof(b),0);
         opt[i].l:=max(opt[i-1].l,opt[i div 2].l);
         for j:=1 to opt[i-1].l do
           a[j]:=opt[i-1].s[j];
         for j:=1 to opt[i div 2].l do
           b[j]:=opt[i div 2].s[j];
         for j:=1 to max(opt[i-1].l,opt[i div 2].l) do
         begin
           a[j]:=a[j]+b[j];
           if a[i]>10 then
             begin
               a[i]:=a[i]-10;
               a[i+1]:=a[i+1]+1;
             end;
         end;
         if a[j+1]<>0 then inc(opt[i].l);
         for j:=1 to opt[i].l do
           opt[i].s[j]:=a[j];
        end;
    end;
  for i:=opt[n].l downto 1 do
    write(opt[n].s[j]);
    writeln;
end.


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator