結果

問題 No.129 お年玉(2)
ユーザー bluemeganebluemegane
提出日時 2020-09-07 20:30:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 363 ms / 5,000 ms
コード長 602 bytes
コンパイル時間 1,627 ms
コンパイル使用メモリ 65,156 KB
実行使用メモリ 51,144 KB
最終ジャッジ日時 2023-08-19 17:08:44
合計ジャッジ時間 9,234 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
20,728 KB
testcase_01 AC 363 ms
46,784 KB
testcase_02 AC 59 ms
20,904 KB
testcase_03 AC 59 ms
18,824 KB
testcase_04 AC 58 ms
20,904 KB
testcase_05 AC 104 ms
25,044 KB
testcase_06 AC 83 ms
26,976 KB
testcase_07 AC 122 ms
38,776 KB
testcase_08 AC 165 ms
51,144 KB
testcase_09 AC 77 ms
24,980 KB
testcase_10 AC 158 ms
49,120 KB
testcase_11 AC 93 ms
26,984 KB
testcase_12 AC 62 ms
20,736 KB
testcase_13 AC 62 ms
20,736 KB
testcase_14 AC 84 ms
27,036 KB
testcase_15 AC 80 ms
27,092 KB
testcase_16 AC 90 ms
27,088 KB
testcase_17 AC 72 ms
25,016 KB
testcase_18 AC 130 ms
47,156 KB
testcase_19 AC 223 ms
46,988 KB
testcase_20 AC 99 ms
24,980 KB
testcase_21 AC 76 ms
26,996 KB
testcase_22 AC 96 ms
25,000 KB
testcase_23 AC 147 ms
45,400 KB
testcase_24 AC 265 ms
49,016 KB
testcase_25 AC 86 ms
24,992 KB
testcase_26 AC 112 ms
31,884 KB
testcase_27 AC 104 ms
25,000 KB
testcase_28 AC 94 ms
25,008 KB
testcase_29 AC 58 ms
21,000 KB
testcase_30 AC 59 ms
20,940 KB
testcase_31 AC 58 ms
20,752 KB
testcase_32 AC 61 ms
22,876 KB
testcase_33 AC 58 ms
18,872 KB
testcase_34 AC 61 ms
22,892 KB
testcase_35 AC 60 ms
20,756 KB
testcase_36 AC 62 ms
22,900 KB
testcase_37 AC 62 ms
18,976 KB
testcase_38 AC 66 ms
25,016 KB
testcase_39 AC 63 ms
20,748 KB
testcase_40 AC 70 ms
27,100 KB
testcase_41 AC 79 ms
24,904 KB
testcase_42 AC 71 ms
24,848 KB
testcase_43 AC 67 ms
20,868 KB
testcase_44 AC 271 ms
48,884 KB
testcase_45 AC 67 ms
25,024 KB
testcase_46 AC 62 ms
22,788 KB
testcase_47 AC 214 ms
46,856 KB
testcase_48 AC 167 ms
49,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System.Numerics;
using System;

public class Hello
{
    static void Main()
    {
        var n = long.Parse(Console.ReadLine().Trim());
        var m = int.Parse(Console.ReadLine().Trim());
        var t = (n / m / 1000) * 1000;
        var a = (n - t * m) / 1000;
        getAns(m, a);
    }
    static void getAns (int m, long a)
    {
        BigInteger x = 1;
        BigInteger x2 = 1;
        var y2 = a;
        for (int i = 0; i < a; i++)
        {
            x *= m--;
            x2 *= y2--;
        }
        var ans = (x / x2) % 1000000000;
        Console.WriteLine(ans) ;
    }
}
0