language: Pascal (fpc) (fpc 2.2.0)
date: 102 days 22 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var
a:array[0..5] of integer;
f:array[0..5,0..10000] of int64;
i,j,n:longint;
begin
read(n);
a[1]:=1;
f[0,0]:=1;
A[2]:=5;
A[3]:=10;
A[4]:=25;
A[5]:=50;
i:=0;
for i:=1 to 5 do
begin
for j:=0 to n do
   begin
      f[i,j]:=f[i-1,j]+f[i,j];
      if j-a[i]>=0 then f[i,j]:=f[i,j]+f[i,j-a[i]];
      write(f[i,j],' ');
        end;
writeln;
end;
write(f[5,n]);    
end.
  • upload with new input
  • result: Success     time: 0.01s    memory: 720 kB     returned value: 0

    5
    1 1 1 1 1 1 
    1 1 1 1 1 2 
    1 1 1 1 1 2 
    1 1 1 1 1 2 
    1 1 1 1 1 2 
    2