結果

問題 No.741 AscNumber(Easy)
ユーザー suikameron1suikameron1
提出日時 2018-11-10 11:32:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 1,570 ms
コンパイル使用メモリ 64,912 KB
実行使用メモリ 99,360 KB
最終ジャッジ日時 2023-08-15 10:54:40
合計ジャッジ時間 8,618 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
20,572 KB
testcase_01 AC 47 ms
20,672 KB
testcase_02 AC 47 ms
20,620 KB
testcase_03 AC 49 ms
22,776 KB
testcase_04 AC 48 ms
20,788 KB
testcase_05 AC 47 ms
22,840 KB
testcase_06 AC 47 ms
20,668 KB
testcase_07 AC 48 ms
18,656 KB
testcase_08 AC 48 ms
20,712 KB
testcase_09 AC 50 ms
20,628 KB
testcase_10 AC 48 ms
20,600 KB
testcase_11 AC 49 ms
20,748 KB
testcase_12 AC 48 ms
20,684 KB
testcase_13 AC 48 ms
20,708 KB
testcase_14 AC 47 ms
22,760 KB
testcase_15 AC 49 ms
20,668 KB
testcase_16 AC 47 ms
20,560 KB
testcase_17 AC 47 ms
18,684 KB
testcase_18 AC 47 ms
20,568 KB
testcase_19 AC 48 ms
18,668 KB
testcase_20 AC 47 ms
20,704 KB
testcase_21 AC 46 ms
20,568 KB
testcase_22 AC 47 ms
20,572 KB
testcase_23 AC 47 ms
20,572 KB
testcase_24 AC 47 ms
22,620 KB
testcase_25 AC 49 ms
22,612 KB
testcase_26 AC 50 ms
20,680 KB
testcase_27 AC 49 ms
20,672 KB
testcase_28 AC 49 ms
20,668 KB
testcase_29 AC 48 ms
20,628 KB
testcase_30 AC 49 ms
20,564 KB
testcase_31 AC 50 ms
22,736 KB
testcase_32 AC 46 ms
20,568 KB
testcase_33 AC 47 ms
20,712 KB
testcase_34 AC 48 ms
20,676 KB
testcase_35 AC 247 ms
94,448 KB
testcase_36 AC 133 ms
52,404 KB
testcase_37 AC 147 ms
58,268 KB
testcase_38 AC 146 ms
57,596 KB
testcase_39 AC 134 ms
49,776 KB
testcase_40 AC 160 ms
65,260 KB
testcase_41 AC 227 ms
85,932 KB
testcase_42 AC 145 ms
53,852 KB
testcase_43 AC 118 ms
48,176 KB
testcase_44 AC 188 ms
73,164 KB
testcase_45 AC 202 ms
79,400 KB
testcase_46 AC 237 ms
92,880 KB
testcase_47 AC 81 ms
32,008 KB
testcase_48 AC 234 ms
90,816 KB
testcase_49 AC 213 ms
79,180 KB
testcase_50 AC 70 ms
28,000 KB
testcase_51 AC 119 ms
47,292 KB
testcase_52 AC 255 ms
98,128 KB
testcase_53 AC 253 ms
96,112 KB
testcase_54 AC 253 ms
99,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		long n = long.Parse(Console.ReadLine());
		long[,] dp = new long[n+1,10];//dp[左からn桁見たとき、最後に見た位以下の値]=何通りか
    long mod = 1000000007;

    for(int i = 0; i <= 9; i++) dp[1,i] = i+1;

    for(int i = 2; i <= n; i++)
    {
      for(int j = 0; j <= 9; j++)
      {
        if(j == 0) dp[i,j] = dp[i-1,j];
        else dp[i,j] = dp[i-1,j] + dp[i,j-1];
        dp[i,j] %= mod;
      }
    }
    
		Console.WriteLine(dp[n,9]);
	}
}
0