結果

問題 No.741 AscNumber(Easy)
ユーザー Y17Y17
提出日時 2018-10-05 23:19:35
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 617 bytes
コンパイル時間 1,267 ms
コンパイル使用メモリ 159,704 KB
実行使用メモリ 7,472 KB
最終ジャッジ日時 2024-04-20 17:29:48
合計ジャッジ時間 2,806 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
7,204 KB
testcase_01 AC 8 ms
7,332 KB
testcase_02 AC 8 ms
7,264 KB
testcase_03 AC 8 ms
7,296 KB
testcase_04 AC 7 ms
7,296 KB
testcase_05 AC 7 ms
7,424 KB
testcase_06 AC 8 ms
7,296 KB
testcase_07 AC 9 ms
7,228 KB
testcase_08 AC 9 ms
7,264 KB
testcase_09 AC 10 ms
7,220 KB
testcase_10 AC 8 ms
7,200 KB
testcase_11 AC 9 ms
7,420 KB
testcase_12 AC 8 ms
7,304 KB
testcase_13 AC 9 ms
7,424 KB
testcase_14 AC 9 ms
7,368 KB
testcase_15 AC 9 ms
7,296 KB
testcase_16 AC 8 ms
7,332 KB
testcase_17 AC 10 ms
7,296 KB
testcase_18 AC 9 ms
7,312 KB
testcase_19 AC 8 ms
7,296 KB
testcase_20 AC 8 ms
7,268 KB
testcase_21 AC 8 ms
7,420 KB
testcase_22 AC 8 ms
7,424 KB
testcase_23 AC 8 ms
7,472 KB
testcase_24 AC 8 ms
7,296 KB
testcase_25 AC 8 ms
7,296 KB
testcase_26 AC 8 ms
7,196 KB
testcase_27 AC 8 ms
7,368 KB
testcase_28 AC 8 ms
7,424 KB
testcase_29 AC 8 ms
7,296 KB
testcase_30 AC 8 ms
7,416 KB
testcase_31 AC 8 ms
7,296 KB
testcase_32 AC 8 ms
7,296 KB
testcase_33 AC 8 ms
7,360 KB
testcase_34 AC 8 ms
7,296 KB
testcase_35 AC 8 ms
7,412 KB
testcase_36 AC 7 ms
7,424 KB
testcase_37 AC 7 ms
7,260 KB
testcase_38 AC 9 ms
7,276 KB
testcase_39 AC 8 ms
7,296 KB
testcase_40 AC 8 ms
7,296 KB
testcase_41 AC 8 ms
7,296 KB
testcase_42 AC 8 ms
7,296 KB
testcase_43 AC 8 ms
7,376 KB
testcase_44 AC 8 ms
7,364 KB
testcase_45 AC 7 ms
7,252 KB
testcase_46 AC 8 ms
7,308 KB
testcase_47 AC 10 ms
7,296 KB
testcase_48 AC 7 ms
7,424 KB
testcase_49 AC 7 ms
7,412 KB
testcase_50 AC 8 ms
7,232 KB
testcase_51 AC 8 ms
7,248 KB
testcase_52 AC 9 ms
7,296 KB
testcase_53 AC 8 ms
7,224 KB
testcase_54 AC 8 ms
7,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007

int f[1000020];

void init(){
  f[0] = 1;
  for(int i = 1;i < 1000020;i++){
    f[i] = (long long)f[i-1] * i % MOD;
  }
  return;
}

int pow_mod(long long n, long long m){
  long long ans = 1;
  while(m > 0){
    if(m & 1) ans = (ans * n) % MOD;
    n = (n * n) % MOD;
    m >>= 1;
  }
  return ans;
}

long long reverse(int i){
  return pow_mod(i,MOD-2);
}

int comb(int i, int j){
  return (long long)f[i] * reverse(f[i-j]) % MOD * reverse(f[j]) % MOD;
}

int main(){
  int n;
  cin >> n;
  init();
  cout << comb(n+9,9) << endl;
  return 0;
}
0