222242026-01-14 18:12:42TaxiradioJáték (50 pont)cpp17Wrong answer 5/508ms2564 KiB
#include <bits/stdc++.h>
using namespace std;

#define int int64_t

int p(int a , int b , int m){
	int x = 1;
	for(int i = 0; i < 30; i++){
		if((1<<i)&b){
			x*=a;
			x%=m;
		}
		a*=a;
		a%=m;
	}
	return x;
}

int M = 1e9+7;

vector<int> f;

int32_t main() {
	int b , c;cin >> b >> c;
	f.push_back(1);
	for(int i = 1; i <= 2*c; i++){
		f.push_back((f.back()*i)%M);
	}
	int d = (f[c-1+c-b]*p(f[c-1]*f[c-b] , M-2 , M))%M;
	int e = (f[c-1+c-b]*p(f[c]*f[c-b-1] , M-2 , M))%M;
	cout << (d-e)%M << endl;
}
SubtaskSumTestVerdictTimeMemory
base5/50
1Accepted0/01ms508 KiB
2Wrong answer0/01ms316 KiB
3Accepted2/21ms316 KiB
4Accepted3/31ms316 KiB
5Wrong answer0/31ms316 KiB
6Wrong answer0/31ms316 KiB
7Wrong answer0/31ms316 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms748 KiB
12Wrong answer0/32ms688 KiB
13Wrong answer0/33ms1052 KiB
14Wrong answer0/37ms2564 KiB
15Wrong answer0/34ms1496 KiB
16Wrong answer0/38ms2544 KiB
17Wrong answer0/34ms1472 KiB
18Wrong answer0/38ms2468 KiB
19Wrong answer0/38ms2448 KiB