結果

問題 No.741 AscNumber(Easy)
ユーザー suikameron1suikameron1
提出日時 2018-11-10 11:31:23
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 604 bytes
コンパイル時間 4,489 ms
コンパイル使用メモリ 108,676 KB
実行使用メモリ 104,932 KB
最終ジャッジ日時 2024-11-23 17:27:49
合計ジャッジ時間 7,522 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
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桁見たとき、最後に見た位以下の値]=何通りか

    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];
      }
    }
    
		Console.WriteLine(dp[n,9]);
	}
}
0