Pagini recente » Cod sursa (job #929021) | Cod sursa (job #2466223) | Cod sursa (job #337767) | Cod sursa (job #2870513) | Cod sursa (job #1318205)
#include <cstdio>
#include <cstdlib>
#define supermax 32640
#define SMax 40000
#define MOD 194768
using namespace std;
int N,S,Smax;
int DP[SMax];
void Read()
{
scanf("%d%d",&N,&S);
if(S < 0)
S *= -1;
if(S > supermax){
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 = SMax - 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;
}