結果

問題 No.129 お年玉(2)
ユーザー しらゆきしらゆき
提出日時 2016-01-05 20:31:36
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,687 bytes
コンパイル時間 2,927 ms
コンパイル使用メモリ 104,528 KB
実行使用メモリ 789,104 KB
最終ジャッジ日時 2023-08-18 17:31:53
合計ジャッジ時間 39,565 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
57,428 KB
testcase_01 MLE -
testcase_02 AC 54 ms
22,692 KB
testcase_03 AC 53 ms
20,704 KB
testcase_04 AC 54 ms
20,588 KB
testcase_05 AC 598 ms
339,616 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 AC 775 ms
442,080 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 AC 746 ms
423,680 KB
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 AC 804 ms
458,408 KB
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 782 ms
446,128 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 756 ms
423,676 KB
testcase_26 AC 769 ms
435,836 KB
testcase_27 AC 751 ms
423,560 KB
testcase_28 MLE -
testcase_29 AC 53 ms
20,672 KB
testcase_30 AC 54 ms
20,692 KB
testcase_31 AC 54 ms
20,604 KB
testcase_32 AC 54 ms
20,784 KB
testcase_33 AC 62 ms
24,168 KB
testcase_34 AC 57 ms
23,484 KB
testcase_35 AC 62 ms
21,856 KB
testcase_36 AC 63 ms
24,624 KB
testcase_37 AC 65 ms
25,992 KB
testcase_38 AC 197 ms
104,220 KB
testcase_39 AC 275 ms
151,108 KB
testcase_40 AC 698 ms
396,928 KB
testcase_41 AC 444 ms
247,360 KB
testcase_42 AC 218 ms
116,416 KB
testcase_43 AC 216 ms
112,556 KB
testcase_44 MLE -
testcase_45 AC 142 ms
69,532 KB
testcase_46 AC 304 ms
163,604 KB
testcase_47 MLE -
testcase_48 AC 815 ms
464,708 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;

class Program
{
    static void Main()
    {
        var n = rl();
        var m = rl();
        var mod = 1000000000;

        n /= 1000;
        n = n % m;

        var pas = new long[m + 1, m + 1];
        for(int i = 0; i < m + 1; i++)
        {
            for(int j = 0; j < m + 1; j++)
            {
                if (j == 0 || i == j)
                {
                    pas[i, j] = 1;
                    continue;
                }
                if (j > i) continue;
                pas[i, j] = pas[i, j] = (pas[i - 1, j - 1] + pas[i - 1, j]) % mod;
            }
        }

        Console.WriteLine(pas[m, n]);
    }

    #region Scan
    static int ri() { return int.Parse(Console.ReadLine()); }
    static long rl() { return long.Parse(Console.ReadLine()); }
    static double rd() { return double.Parse(Console.ReadLine()); }
    static string rs() { return Console.ReadLine(); }
    static int[] ria() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); }
    static long[] rla() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); }
    static double[] rda() { return Console.ReadLine().Trim().Split().Select(double.Parse).ToArray(); }
    static string[] rsa() { return Console.ReadLine().Trim().Split(); }
    static void mul(out int a, out int b) { var arr = ria(); a = arr[0]; b = arr[1]; }
    public void mul(out int a, out int b, out int c) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; }
    public void mul(out int a, out int b, out int c, out int d) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    #endregion
}
0