Cod sursa(job #2139818)
| Utilizator | Data | 22 februarie 2018 20:12:46 | |
|---|---|---|---|
| Problema | 1-sir | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <cstdio>
using namespace std;
const int MOD = 194767;
int main()
{
freopen("1-sir.in", "r", stdin);
freopen("1-sir.out", "w", stdout);
int n, s;
int mat[260][260];
scanf("%d %d", &n, &s);
mat[1][1] = 1;
for(int i = 2; i <= n; i++){
for(int j = 1; j <= i; j++){
mat[i][j] = (mat[i - 1][j] + mat[i - 1][j - 1]) % MOD;
}
}
int x = n;
int nr = 0;
while(x != s){
x -= 2;
nr++;
}
printf("%d", mat[n][nr + 1]);
return 0;
}
