이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define F first
#define S second
#define ll long long
#define int ll
#define pii pair<int, int>
#define io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define M_PI 3.14159265358979323846
#define all(v) v.begin(), v.end()
#define pss pair<string, string>
#define no cout<<"No"<<endl;
#define yes cout<<"Yes"<<endl;
#define imp cout<<-1<<endl;
#define flu cout.flush();
#define Endl endl
const int N = 100009;
const int mod = 1e9+7;
int fac(int n){
int ans=1;
for(int i=1; i<=n; i++){
ans*=i%mod;
}
return ans%mod;
}
int cam(int n, int r){
return (fac(n)%mod)/(fac(r)%mod*fac(n-r)%mod)%mod;
}
void solve(){
int n, st, fi;
cin>>n>>st>>fi;
cout<<__gcd(cam(n, st), cam(n, fi));
}
signed main(){
io;
int t=1;
//cin>>t;
while(t--){
solve();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |