Submission #627937


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;

class Program {
    static string ReadLine() { return Console.ReadLine(); }
    static int ReadInt() { return int.Parse(ReadLine()); }
    static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return ReadLine().Split(); }

    const int MOD = (int)1e9 + 7;

    static int CalcNaive(int n, int k) {
       var dp = new int[n+1, k]; // [駅, 連続して停止した駅数]
       dp[0, 0] = 1;
       return dp[0, 0];


       /*
       dp[1, 1] = 1;
       for (int i = 2; i <= n; i++) { // i 番目の駅

           // i 番目の駅で停車する
           for (int j = 0; j < k-1; j++) {
               dp[i, j+1] = (dp[i, j+1] + dp[i-1, j]) % MOD;
           }

           // i 番目の駅で停車しない
           for (int j = 0; j < k; j++) {
               dp[i, 0] = (dp[i, 0] + dp[i-1, j]) % MOD;
           }
       }

       int ans = 0;
       for (int i = 1; i < k; i++) {
           ans = (ans + dp[n, i]) % MOD;
       }

       return ans;
       */
    }

    static void Main() {
        var nk = ReadInts();
        int n = nk[0], k = nk[1];

        Console.WriteLine(CalcNaive(n, k));
    }
}

Submission Info

Submission Time
Task F - 準急
User noriok
Language C# (Mono 2.10.8.1)
Score 0
Code Size 1305 Byte
Status WA
Exec Time 298 ms
Memory 84952 KB

Judge Result

Set Name All
Score / Max Score 0 / 4
Status
WA × 4
RE × 3
Set Name Test Cases
All 00, 01, 02, 03, 04, 90, 91
Case Name Status Exec Time Memory
00 WA 152 ms 16760 KB
01 RE 131 ms 8876 KB
02 RE 130 ms 8876 KB
03 RE 133 ms 8832 KB
04 WA 298 ms 84952 KB
90 WA 126 ms 8852 KB
91 WA 129 ms 8892 KB