Pagini recente » Cod sursa (job #120658) | Cod sursa (job #1063477) | Cod sursa (job #1928014) | Cod sursa (job #2295685) | Cod sursa (job #1318213)
#include <cstdio>
#include <cstdlib>
#define supermax 32640
#define SMax 40000
#define MOD 194768
using namespace std;
int N,S,Smax;
int DP[SMax];
int min(int x,int y){
if(x < y)
return x;
return y;
}
void Read()
{
scanf("%d%d",&N,&S);
if(S < 0)
S *= -1;
if(S > N*(N-1)/2){
printf("0\n");
exit(0);
}
Smax = N * (N - 1) / 2;
S = Smax - S;
}
void Solve()
{
int w;
DP[0] = 1;
for(int i = 1; i < N; ++i)
{
w = 2*i;
for(int j = i*(i+1); j >= w; --j)
DP[j] = (DP[j] + DP[j-w])%MOD;
}
printf("%d\n",DP[S]);
}
int main()
{
freopen("1-sir.in","r",stdin);
freopen("1-sir.out","w",stdout);
Read();
Solve();
return 0;
}