結果
| 問題 |
No.741 AscNumber(Easy)
|
| コンテスト | |
| ユーザー |
suikameron1
|
| 提出日時 | 2018-11-10 11:32:30 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 274 ms / 2,000 ms |
| コード長 | 655 bytes |
| コンパイル時間 | 853 ms |
| コンパイル使用メモリ | 103,680 KB |
| 実行使用メモリ | 94,976 KB |
| 最終ジャッジ日時 | 2024-11-23 17:28:03 |
| 合計ジャッジ時間 | 6,881 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 55 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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]);
}
}
suikameron1