結果
| 問題 |
No.741 AscNumber(Easy)
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-04-01 23:39:45 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 641 bytes |
| コンパイル時間 | 1,845 ms |
| コンパイル使用メモリ | 191,828 KB |
| 最終ジャッジ日時 | 2025-01-09 12:27:05 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 55 |
ソースコード
#include<bits/stdc++.h>
using lint=long long;
using real=long double;
lint mod=1'000'000'007;
lint inverse(lint x){
lint y=1,u=mod,v=0;
while(x){
lint q=u/x;
u-=q*x;std::swap(u,x);
v-=q*y;std::swap(v,y);
}
assert(x==0&&std::abs(y)==mod&&std::abs(u)==1&&std::abs(v)<mod);
return v<0?v+mod:v;
}
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
lint n;std::cin>>n;
lint ans=1;
for(lint i=1;i<=9;i++){
ans=ans*(n+i)%mod;
ans=ans*inverse(i)%mod;
}
std::cout<<ans<<'\n';
}
ngtkana