結果

問題 No.129 お年玉(2)
ユーザー ebicochinealebicochineal
提出日時 2017-04-05 01:31:34
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 591 bytes
コンパイル時間 2,903 ms
コンパイル使用メモリ 104,360 KB
実行使用メモリ 27,116 KB
最終ジャッジ日時 2023-08-18 17:51:21
合計ジャッジ時間 7,507 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
22,836 KB
testcase_01 AC 111 ms
27,008 KB
testcase_02 AC 60 ms
22,876 KB
testcase_03 AC 59 ms
20,860 KB
testcase_04 AC 58 ms
18,880 KB
testcase_05 AC 83 ms
27,076 KB
testcase_06 AC 76 ms
27,112 KB
testcase_07 AC 89 ms
24,884 KB
testcase_08 AC 89 ms
26,940 KB
testcase_09 AC 73 ms
26,948 KB
testcase_10 AC 93 ms
27,116 KB
testcase_11 AC 76 ms
23,044 KB
testcase_12 AC 61 ms
20,760 KB
testcase_13 AC 59 ms
20,864 KB
testcase_14 AC 74 ms
26,856 KB
testcase_15 AC 74 ms
22,936 KB
testcase_16 AC 84 ms
26,936 KB
testcase_17 AC 67 ms
25,080 KB
testcase_18 AC 90 ms
24,960 KB
testcase_19 AC 100 ms
26,968 KB
testcase_20 AC 81 ms
24,968 KB
testcase_21 AC 72 ms
27,012 KB
testcase_22 AC 83 ms
27,036 KB
testcase_23 AC 93 ms
24,880 KB
testcase_24 AC 106 ms
26,972 KB
testcase_25 AC 78 ms
25,088 KB
testcase_26 AC 86 ms
27,024 KB
testcase_27 AC 85 ms
24,996 KB
testcase_28 AC 83 ms
24,960 KB
testcase_29 AC 57 ms
20,752 KB
testcase_30 AC 58 ms
20,832 KB
testcase_31 AC 59 ms
22,904 KB
testcase_32 AC 59 ms
22,896 KB
testcase_33 AC 56 ms
20,868 KB
testcase_34 AC 65 ms
20,880 KB
testcase_35 AC 62 ms
20,928 KB
testcase_36 AC 59 ms
22,760 KB
testcase_37 AC 60 ms
20,772 KB
testcase_38 AC 63 ms
20,784 KB
testcase_39 AC 61 ms
20,984 KB
testcase_40 AC 65 ms
25,040 KB
testcase_41 AC 70 ms
24,956 KB
testcase_42 AC 65 ms
24,964 KB
testcase_43 AC 59 ms
22,900 KB
testcase_44 AC 114 ms
26,908 KB
testcase_45 AC 68 ms
20,812 KB
testcase_46 AC 60 ms
20,888 KB
testcase_47 AC 106 ms
24,972 KB
testcase_48 AC 91 ms
26,976 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.Text;
using System.Numerics;
using System.Collections;
using System.Collections.Generic;

public class Program {
    static BigInteger ncm(long n, long m) {
        BigInteger r = 1;
        for (long i = 1; i < m+1; ++i, --n) {
            r *= n;
            r /= i;
        }
        return r;
    }
    
    static void Main(string[] args) {
        long N = long.Parse(Console.ReadLine());
        long M = long.Parse(Console.ReadLine());
        long m = (N % (M * 1000)) / 1000;
        Console.WriteLine(ncm(M, m) % 1000000000);
    }
}
0