結果

問題 No.741 AscNumber(Easy)
ユーザー chocorusk
提出日時 2018-10-05 22:03:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 799 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 85,960 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 13:09:18
合計ジャッジ時間 2,252 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 55
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
   
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD=1e9+7;
ll powmod(ll a, ll k){
    ll ap=a, ans=1;
    while(k>0){
        if(k%2==1){
            ans*=ap;
            ans%=MOD;
        }
        ap=ap*ap;
        ap%=MOD;
        k/=2;
    }
    return ans;
}
ll inv(ll a){
	return powmod(a, MOD-2);
}
int main()
{
	int n;
	cin>>n;
	ll f1=1, f=1;
	for(ll i=1; i<=9+n; i++){
		f*=i; f%=MOD;
	}
	for(ll i=1; i<=n; i++){
		f1*=i; f1%=MOD;
	}
	cout<<f*inv(f1)%MOD*inv(362880ll)%MOD<<endl;
    return 0;
}
0