54932023-06-30 14:45:09111Játék (50 pont)cpp14Runtime error 23/5027ms63380 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int B, C;
	cin >> B >> C;
	int X[C + 1][C + 1];
	for (int c = 1; c <= C; c++) {
		X[c][c] = 1;
	}
	for (int c = 1; c <= C; c++) {
		X[c][0] = 0;
	}
	for (int c = 2; c <= C; c++) {
		for (int b = c - 1; b >= 1; b--) {
			X[c][b] = X[c][b + 1] + X[c - 1][b - 1];
			X[c][b] %= 1000000007;
		}
	}
	cout << X[C][B] << endl;
    return 0;
}

SubtaskSumTestVerdictTimeMemory
base23/50
1Accepted0/03ms1872 KiB
2Accepted0/025ms32016 KiB
3Accepted2/23ms2292 KiB
4Accepted3/33ms2540 KiB
5Accepted3/33ms2776 KiB
6Accepted3/37ms8252 KiB
7Accepted3/314ms20028 KiB
8Accepted3/323ms30764 KiB
9Accepted3/321ms30140 KiB
10Accepted3/325ms31620 KiB
11Runtime error0/326ms63380 KiB
12Runtime error0/327ms63312 KiB
13Runtime error0/327ms63088 KiB
14Runtime error0/327ms63076 KiB
15Runtime error0/327ms62832 KiB
16Runtime error0/321ms62808 KiB
17Runtime error0/326ms62784 KiB
18Runtime error0/321ms62760 KiB
19Runtime error0/326ms62748 KiB