Untitled

mail@pastecode.io avatar
unknown
c_cpp
6 months ago
1.9 kB
6
Indexable
Never
#include <bits/stdc++.h>
using namespace std;

typedef long long       ll;
typedef pair<int, int>  pii;

#define FastIO          cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false);
#define FileIO          freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define fi              first
#define se              second
#define max_heap(T)     priority_queue<T>
#define min_heap(T)     priority_queue<T, vector<T>, greater<T>>
#define fr(i,a,b)       for(int i=a;i<b;i++)
#define frr(i,a,b)      for(int i=a;i>b;i--)
#define frin(i,A)       for(auto &i : A)
#define sz(x)           (int)x.size()
#define all(A)          A.begin(), A.end()
#define fll(A,l,r,x)    fr(i,l,r) A[i]=x
#define mins(a,b)       a = min(a,b)
#define maxs(a,b)       a = max(a,b)
#define pb              push_back
#define popcnt          __builtin_popcount
#define setprec(x)      cout << fixed << setprecision(x)
#define md(a)           (a%MOD+MOD)%MOD

const ll  INF  = 2e9;
const ll  MOD  = 1e9 + 7;
const int MAXN = 1e5 + 5;

int ADD(int a, int b) {
    return md(a+b);
}

int SUB(int a, int b) {
    return md(a-b);
}

int MUL(int a, int b) {
    return md(1ll*a*b);
}

int POW(int a, int b) {
    int res = 1;
    while(b) {
        if(b&1)
            res = MUL(res, a);
        a = MUL(a, a);
        b /= 2;
    }
    return res;
}

int DIV(int a, int b) {
    return MUL(a, POW(b, MOD-2));
}

int fac[MAXN], inv[MAXN];

void preproc() {
    fac[0] = 1;
    fr(i, 1, MAXN)
        fac[i] = MUL(fac[i-1], i);
    inv[MAXN-1] = DIV(1, fac[MAXN-1]);
    frr(i, MAXN-2, -1)
        inv[i] = MUL(inv[i+1], i+1);
}

int C(int n, int r) {
    if(r < 0 || r > n)
        return 0;
    return MUL(fac[n], MUL(inv[r], inv[n-r]));
}

void solve() {
    
}

int32_t main() {
    FastIO
    int T = 1;
    // cin >> T;
    while(T--)
        solve();
    return 0;
}