Pagini recente » Rating Morosan Mara (MaraMorosan) | Cod sursa (job #1468253) | Cod sursa (job #1876651) | Cod sursa (job #1665217) | Cod sursa (job #7555)
Cod sursa(job #7555)
const max=64000;
var v1,v2:array[-max..max] of longint;
n,s,i,j:longint;
begin
assign(input,'1-sir.in');
reset(input);
readln(n,s);
v1[0]:=1;
fillchar(v2,sizeof(v2),0);
for i:=1 to n-1 do
begin
for j:=-max to max do
if v1[j]<>0 then
begin
v2[j+i]:=(v2[j+i]+v1[j]) mod 194767;
v2[j-i]:=(v2[j-i]+v1[j]) mod 194767;
end;
v1:=v2;
fillchar(v2,sizeof(v2),0);
end;
assign(output,'1-sir.out');
rewrite(output);
writeln(v1[s]);
close(output);
end.