結果

問題 No.741 AscNumber(Easy)
ユーザー suikameron1suikameron1
提出日時 2018-11-10 11:32:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 237 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 2,623 ms
コンパイル使用メモリ 107,756 KB
実行使用メモリ 97,040 KB
最終ジャッジ日時 2024-05-02 22:25:24
合計ジャッジ時間 5,994 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
23,852 KB
testcase_01 AC 21 ms
25,684 KB
testcase_02 AC 21 ms
23,368 KB
testcase_03 AC 21 ms
23,632 KB
testcase_04 AC 21 ms
23,728 KB
testcase_05 AC 21 ms
25,684 KB
testcase_06 AC 20 ms
25,420 KB
testcase_07 AC 19 ms
25,684 KB
testcase_08 AC 20 ms
23,764 KB
testcase_09 AC 19 ms
21,816 KB
testcase_10 AC 19 ms
23,388 KB
testcase_11 AC 20 ms
23,724 KB
testcase_12 AC 21 ms
25,672 KB
testcase_13 AC 20 ms
25,544 KB
testcase_14 AC 20 ms
25,564 KB
testcase_15 AC 20 ms
25,804 KB
testcase_16 AC 20 ms
23,900 KB
testcase_17 AC 21 ms
23,280 KB
testcase_18 AC 20 ms
23,772 KB
testcase_19 AC 21 ms
23,648 KB
testcase_20 AC 21 ms
23,388 KB
testcase_21 AC 21 ms
25,816 KB
testcase_22 AC 20 ms
23,984 KB
testcase_23 AC 21 ms
25,724 KB
testcase_24 AC 20 ms
25,312 KB
testcase_25 AC 21 ms
25,564 KB
testcase_26 AC 21 ms
23,600 KB
testcase_27 AC 20 ms
23,728 KB
testcase_28 AC 21 ms
23,512 KB
testcase_29 AC 22 ms
25,696 KB
testcase_30 AC 22 ms
23,520 KB
testcase_31 AC 23 ms
21,424 KB
testcase_32 AC 22 ms
23,248 KB
testcase_33 AC 21 ms
25,720 KB
testcase_34 AC 21 ms
25,556 KB
testcase_35 AC 223 ms
97,040 KB
testcase_36 AC 108 ms
49,152 KB
testcase_37 AC 127 ms
54,912 KB
testcase_38 AC 123 ms
54,400 KB
testcase_39 AC 106 ms
48,768 KB
testcase_40 AC 141 ms
59,776 KB
testcase_41 AC 209 ms
84,608 KB
testcase_42 AC 125 ms
52,608 KB
testcase_43 AC 95 ms
42,624 KB
testcase_44 AC 169 ms
69,888 KB
testcase_45 AC 181 ms
73,984 KB
testcase_46 AC 218 ms
87,552 KB
testcase_47 AC 56 ms
28,672 KB
testcase_48 AC 218 ms
87,680 KB
testcase_49 AC 186 ms
76,032 KB
testcase_50 AC 42 ms
24,832 KB
testcase_51 AC 95 ms
43,904 KB
testcase_52 AC 232 ms
94,848 KB
testcase_53 AC 237 ms
94,976 KB
testcase_54 AC 229 ms
94,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

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