Все задачи на 5.10.17 13:00

This commit is contained in:
2017-10-05 13:08:02 +03:00
parent 93746b05d7
commit ca2ca71f63
120 changed files with 2343 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#include <iostream>
using namespace std;
//#define DEBUG
int main() {
#ifndef DEBUG
freopen("count.in", "r", stdin);
freopen("count.out", "w", stdout);
#else
freopen("../count.in", "r", stdin);
#endif
long long x[31][31];
long long m = 0;
long long n = 0;
long long s = 0;
for (int i = 0; i <= 31; i++) {
for (int j = 0; i <= 31; i++) {
x[i][j] = 0;
}
}
for (int i = 0; i <= 30; i++) {
x[1][i] = 1;
}
cin >> m >> n;
for (int i = 2; i <= m; i++) {
for (int j = 0; j <= n; j++) {
for (int k = 0; k <= j; k++) {
x[i][j] += x[i-1][k];
}
}
}
for (int i = 0; i <= n; i++) {
s += x[m][i];
}
cout << s;
fclose(stdout);
return 0;
}

View File

@@ -0,0 +1 @@
3 5