# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19868 | yongwhan | 괄호 (kriii4_R) | C++14 | 912 ms | 17336 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
const int mx=1e6+5;
typedef long long ll;
ll fact[mx], f[mx];
ll exp(ll a, ll b, ll m) {
ll r=1;
while(b) {
if(b%2) r=(r*a)%m;
a=(a*a)%m;
b/=2;
}
return r;
}
ll inv(ll a, ll m) {
return exp(a,m-2,m);
}
int binom(int n, int m, int mod) {
ll a=fact[n], b=fact[m], c=fact[n-m];
ll ret=a*inv(b,mod);
ret%=mod;
ret*=inv(c,mod);
ret%=mod;
return ret;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |