結果

問題 No.129 お年玉(2)
ユーザー nanophoto12nanophoto12
提出日時 2015-02-01 23:18:53
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,045 bytes
コンパイル時間 4,160 ms
コンパイル使用メモリ 103,532 KB
実行使用メモリ 767,408 KB
最終ジャッジ日時 2023-08-03 11:53:43
合計ジャッジ時間 36,001 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
44,416 KB
testcase_01 MLE -
testcase_02 AC 85 ms
23,864 KB
testcase_03 AC 61 ms
21,836 KB
testcase_04 AC 63 ms
23,996 KB
testcase_05 AC 668 ms
289,056 KB
testcase_06 AC 901 ms
478,600 KB
testcase_07 MLE -
testcase_08 AC 750 ms
438,928 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 AC 649 ms
424,672 KB
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 AC 692 ms
457,424 KB
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 712 ms
449,148 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 645 ms
426,684 KB
testcase_26 AC 659 ms
436,952 KB
testcase_27 AC 645 ms
426,628 KB
testcase_28 MLE -
testcase_29 AC 75 ms
21,648 KB
testcase_30 AC 61 ms
21,576 KB
testcase_31 AC 61 ms
21,796 KB
testcase_32 AC 61 ms
23,696 KB
testcase_33 AC 59 ms
19,600 KB
testcase_34 AC 64 ms
24,472 KB
testcase_35 AC 67 ms
24,816 KB
testcase_36 AC 69 ms
25,456 KB
testcase_37 AC 71 ms
26,728 KB
testcase_38 AC 184 ms
103,156 KB
testcase_39 AC 247 ms
150,056 KB
testcase_40 AC 603 ms
402,000 KB
testcase_41 AC 386 ms
248,396 KB
testcase_42 AC 196 ms
115,544 KB
testcase_43 AC 194 ms
113,416 KB
testcase_44 MLE -
testcase_45 AC 135 ms
70,608 KB
testcase_46 AC 267 ms
164,764 KB
testcase_47 MLE -
testcase_48 AC 705 ms
465,660 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.Collections.Generic;
using System.Linq;
using System.Text;

namespace YukiCoder2
{
    class Program
    {

        static void Main(string[] args)
        {
            ulong n = Console.ReadLine().Split(' ').Select(ulong.Parse).ToArray()[0];
            ulong m = Console.ReadLine().Split(' ').Select(ulong.Parse).ToArray()[0];
            ulong rest = (n /1000L) % m;
            if (rest == 0)
            {
                Console.WriteLine("1");
                return;
            }
            var buffer = new ulong[m+1,m+1];
            for (ulong i = 0; i < m+1; i++)
            {
                buffer[i, 0] = 1;
                buffer[i, i] = 1;
            }
            for (ulong i = 1; i < m+1; i++)
            {
                for (ulong k = 1; k < i; k++)
                {
                    buffer[i, k] = buffer[i - 1, k - 1] + buffer[i - 1, k];
                    buffer[i, k] %= 1000000000;
                }
            }
            Console.WriteLine(buffer[m,rest]);
        }
    }
}
0