結果

問題 No.741 AscNumber(Easy)
ユーザー mint6421mint6421
提出日時 2019-07-15 22:22:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,047 bytes
コンパイル時間 3,333 ms
コンパイル使用メモリ 164,204 KB
実行使用メモリ 11,612 KB
最終ジャッジ日時 2023-08-18 15:17:10
合計ジャッジ時間 4,646 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 9 ms
11,508 KB
testcase_36 AC 5 ms
7,448 KB
testcase_37 AC 6 ms
7,420 KB
testcase_38 AC 6 ms
7,584 KB
testcase_39 AC 5 ms
7,424 KB
testcase_40 AC 7 ms
9,632 KB
testcase_41 AC 9 ms
11,596 KB
testcase_42 AC 6 ms
7,536 KB
testcase_43 AC 5 ms
7,500 KB
testcase_44 AC 7 ms
9,560 KB
testcase_45 AC 7 ms
9,616 KB
testcase_46 AC 9 ms
11,540 KB
testcase_47 AC 3 ms
4,820 KB
testcase_48 AC 9 ms
11,504 KB
testcase_49 AC 7 ms
9,508 KB
testcase_50 AC 3 ms
4,376 KB
testcase_51 AC 5 ms
7,648 KB
testcase_52 AC 9 ms
11,544 KB
testcase_53 AC 10 ms
11,592 KB
testcase_54 AC 9 ms
11,612 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:50:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
   50 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>



int fac[3100000];

int inv(int x){
  if(x==1) return 1;
  return (M-M/x)*inv(M%x)%M;
}


int comb(int n,int k){
  int x=(fac[k]*fac[n-k])%M;
  return (fac[n]*inv(x))%M;
}

void fac_init(int n){
  fac[0]=1;
  FOR(i,1,n+1){
    fac[i]=fac[i-1]*i;
    fac[i]%=M;
  }
}

main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin>>n;
  fac_init(n+100);

  cout<<comb(n+10-1,n)<<endl;

}
0