結果

問題 No.129 お年玉(2)
ユーザー nanophoto12nanophoto12
提出日時 2015-02-01 23:01:42
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 997 bytes
コンパイル時間 3,318 ms
コンパイル使用メモリ 104,684 KB
実行使用メモリ 676,168 KB
最終ジャッジ日時 2023-09-05 09:33:53
合計ジャッジ時間 22,080 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 873 ms
492,256 KB
testcase_02 AC 60 ms
19,792 KB
testcase_03 AC 60 ms
23,888 KB
testcase_04 AC 58 ms
21,960 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 WA -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 WA -
testcase_16 WA -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 WA -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 MLE -
testcase_29 AC 58 ms
21,876 KB
testcase_30 AC 56 ms
21,812 KB
testcase_31 AC 58 ms
23,804 KB
testcase_32 WA -
testcase_33 AC 58 ms
23,792 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 MLE -
testcase_45 WA -
testcase_46 WA -
testcase_47 MLE -
testcase_48 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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];
                }
            }
            Console.WriteLine(buffer[m,rest]);
        }
    }
}
0