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

Common Board

Will someone help me. I dont know what does it mean "Crash"
Posted by Vladimir Milenov Vasilev 8 Jul 2001 03:29
Here is my program
It always gets CRASH?
Could you tell me why, please?

program staircase;
const max=500;
var n,i,j:longint;
a:array[0..max,0..max]of real;
 procedure br(n:integer);
 var i,j:integer;
 begin
 for i:=1 to n do
 for j:=1 to n do
 if j=1 then a[i,j]:=0
 else if (j*(j+1)div 2)<i then a[i,j]:=0
 else if j=i then a[i,j]:=1+a[j,j-1]
 else if (j=i-1)then a[i,j]:=1+a[i,j-1]
 else if j>i then a[i,j]:=a[i,i]
 else a[i,j]:=a[i-j,j-1]+a[i,j-1];
 end;
begin
readln(n);
br(n);
writeln(round(a[n,n]-1));
end.


Thank you!
The answer maybe out of real.
Posted by Dinh Hong Minh 8 Jul 2001 13:03
> Here is my program
> It always gets CRASH?
> Could you tell me why, please?
>
> program staircase;
> const max=500;
> var n,i,j:longint;
> a:array[0..max,0..max]of real;
>  procedure br(n:integer);
>  var i,j:integer;
>  begin
>  for i:=1 to n do
>  for j:=1 to n do
>  if j=1 then a[i,j]:=0
>  else if (j*(j+1)div 2)<i then a[i,j]:=0
>  else if j=i then a[i,j]:=1+a[j,j-1]
>  else if (j=i-1)then a[i,j]:=1+a[i,j-1]
>  else if j>i then a[i,j]:=a[i,i]
>  else a[i,j]:=a[i-j,j-1]+a[i,j-1];
>  end;
> begin
> readln(n);
> br(n);
> writeln(round(a[n,n]-1));
> end.
>
>
> Thank you!
>
>