結果

問題 No.741 AscNumber(Easy)
ユーザー ikeyanabcd894ikeyanabcd894
提出日時 2019-04-27 16:44:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 758 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 1,401 ms
コンパイル使用メモリ 144,164 KB
実行使用メモリ 97,288 KB
最終ジャッジ日時 2023-08-19 01:59:41
合計ジャッジ時間 13,330 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 2 ms
4,384 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 721 ms
92,724 KB
testcase_36 AC 316 ms
42,344 KB
testcase_37 AC 370 ms
49,392 KB
testcase_38 AC 364 ms
48,508 KB
testcase_39 AC 309 ms
41,484 KB
testcase_40 AC 419 ms
55,204 KB
testcase_41 AC 661 ms
84,872 KB
testcase_42 AC 348 ms
46,476 KB
testcase_43 AC 252 ms
34,556 KB
testcase_44 AC 516 ms
67,364 KB
testcase_45 AC 557 ms
72,100 KB
testcase_46 AC 688 ms
88,356 KB
testcase_47 AC 119 ms
17,776 KB
testcase_48 AC 687 ms
88,432 KB
testcase_49 AC 575 ms
74,360 KB
testcase_50 AC 79 ms
12,980 KB
testcase_51 AC 265 ms
36,120 KB
testcase_52 AC 754 ms
96,980 KB
testcase_53 AC 758 ms
97,288 KB
testcase_54 AC 748 ms
96,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int N;
long long memo[1000009][12];
long long mod=1000000007;

int main(){
  cin >> N;
  for(int i=0;i<=9;i++){memo[0][i]=1;}
  for(int i=1;i<N;i++){
    for(int j=0;j<=9;j++){
      for(int k=j;k>=0;k--){memo[i][j]=(memo[i][j]+memo[i-1][k])%mod;}
    }
  }
  long long ans=0;
  for(int i=0;i<=9;i++){ans=(ans+memo[N-1][i])%mod;}
  cout << ans << endl;
}
0