Pagini recente » Cod sursa (job #2711751) | Cod sursa (job #2010210) | Cod sursa (job #783749) | Cod sursa (job #2455005) | Cod sursa (job #27427)
Cod sursa(job #27427)
const prim=194767;
maxs=2147483648;
var f:text;
s:longint;
n,i,j:integer;
type vect=array[0..maxs] of longint;
var a,c:vect;
begin
assign(f,'1-sir.in'); reset(f);
readln(f,n,s);
close(f);
a[0]:=1;
for i:=1 to n-1 do
begin
for j:=0 to ((i+1)*i) div 2 do
begin
c[j]:=0;
if j-i<=((i-1)*(i))div 2 then c[j]:=(c[j]+a[abs(j-i)]) mod prim;
if j+i<=((i-1)*(i))div 2 then c[j]:=(c[j]+a[j+i]) mod prim;
end;
a:=c;
end;
assign(f,'1-sir.out'); rewrite(f);
writeln(f,c[s]);
close(f);
end.