結果

問題 No.129 お年玉(2)
ユーザー しらゆき
提出日時 2015-11-23 22:27:28
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 1,033 ms
コンパイル使用メモリ 108,892 KB
実行使用メモリ 27,840 KB
最終ジャッジ日時 2024-09-13 17:19:39
合計ジャッジ時間 3,340 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 42
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    static void Main()
    {
        long n = long.Parse(Console.ReadLine());
        long m = long.Parse(Console.ReadLine());

        long a = (n / 1000) % m;
        long ans = 1;

        for (long i = 1; i <= a; i++)
        {
            ans = ans * (m - i + 1) / i;
            ans %= 1000000000;
        }

        Console.WriteLine(ans);
    }
}
0