結果

問題 No.741 AscNumber(Easy)
ユーザー xxxasdfghjkxxxasdfghjk
提出日時 2018-10-05 22:08:41
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,162 ms / 2,000 ms
コード長 1,054 bytes
コンパイル時間 788 ms
コンパイル使用メモリ 66,300 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-04-20 17:17:21
合計ジャッジ時間 17,767 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
11,132 KB
testcase_01 AC 22 ms
11,136 KB
testcase_02 AC 23 ms
11,152 KB
testcase_03 AC 23 ms
11,224 KB
testcase_04 AC 24 ms
11,264 KB
testcase_05 AC 23 ms
11,016 KB
testcase_06 AC 22 ms
11,136 KB
testcase_07 AC 23 ms
11,136 KB
testcase_08 AC 23 ms
11,136 KB
testcase_09 AC 22 ms
11,136 KB
testcase_10 AC 24 ms
11,136 KB
testcase_11 AC 23 ms
11,136 KB
testcase_12 AC 23 ms
11,232 KB
testcase_13 AC 24 ms
11,136 KB
testcase_14 AC 24 ms
11,136 KB
testcase_15 AC 23 ms
11,128 KB
testcase_16 AC 23 ms
11,156 KB
testcase_17 AC 24 ms
11,164 KB
testcase_18 AC 23 ms
11,136 KB
testcase_19 AC 23 ms
11,136 KB
testcase_20 AC 24 ms
11,264 KB
testcase_21 AC 24 ms
11,264 KB
testcase_22 AC 25 ms
11,264 KB
testcase_23 AC 24 ms
11,224 KB
testcase_24 AC 23 ms
11,136 KB
testcase_25 AC 24 ms
11,136 KB
testcase_26 AC 24 ms
11,264 KB
testcase_27 AC 24 ms
11,136 KB
testcase_28 AC 25 ms
11,264 KB
testcase_29 AC 24 ms
11,264 KB
testcase_30 AC 24 ms
11,136 KB
testcase_31 AC 24 ms
11,148 KB
testcase_32 AC 23 ms
11,136 KB
testcase_33 AC 24 ms
11,136 KB
testcase_34 AC 24 ms
11,136 KB
testcase_35 AC 1,085 ms
11,100 KB
testcase_36 AC 491 ms
11,136 KB
testcase_37 AC 579 ms
11,244 KB
testcase_38 AC 566 ms
11,140 KB
testcase_39 AC 481 ms
11,284 KB
testcase_40 AC 659 ms
11,392 KB
testcase_41 AC 1,016 ms
11,264 KB
testcase_42 AC 550 ms
11,264 KB
testcase_43 AC 408 ms
11,120 KB
testcase_44 AC 788 ms
11,264 KB
testcase_45 AC 833 ms
11,136 KB
testcase_46 AC 1,035 ms
11,120 KB
testcase_47 AC 200 ms
11,132 KB
testcase_48 AC 1,073 ms
11,136 KB
testcase_49 AC 896 ms
11,140 KB
testcase_50 AC 140 ms
11,136 KB
testcase_51 AC 426 ms
11,264 KB
testcase_52 AC 1,162 ms
11,136 KB
testcase_53 AC 1,127 ms
11,136 KB
testcase_54 AC 1,132 ms
11,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#define MAX_N 100001
#define INF 2147483647
#define REP(i,n) for(int i=0;i<(int)(n);i++)

typedef long long int ll;
using namespace std;

long long int MOD = 1000000007;
long long int ruiseki[1000010];
void ncrset(){
  ruiseki[0] = 1;
  for(long long int i=1;i<1000010;i++){
    ruiseki[i] = (ruiseki[i-1] * i) % MOD;
  }
}

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

ll ncrgyaku(ll n,ll r){
  long long int gyakuk,gyakur;
  long long int res = 1,x,y,z;
  y = powld(ruiseki[r],MOD-2);
  z = powld(ruiseki[n-r],MOD-2);
  return (((ruiseki[n]*y) % MOD)*z) % MOD;

}


int main()
{
  long long int  N,K,res=0;
  ncrset();
  cin >> N;
  res = 10;
  for(int i=2;i<=N;i++){
    res = (res+ncrgyaku(i+8,8))%MOD;
  }
  cout << res << endl;
  return 0;
}

0