結果

問題 No.420 mod2漸化式
ユーザー bayashiko_rbayashiko_r
提出日時 2019-01-08 02:38:33
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,107 bytes
コンパイル時間 2,535 ms
コンパイル使用メモリ 99,988 KB
実行使用メモリ 22,744 KB
最終ジャッジ日時 2023-08-15 16:37:09
合計ジャッジ時間 5,397 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
20,588 KB
testcase_01 AC 46 ms
22,632 KB
testcase_02 AC 47 ms
20,740 KB
testcase_03 AC 47 ms
20,516 KB
testcase_04 AC 47 ms
20,708 KB
testcase_05 AC 48 ms
22,668 KB
testcase_06 WA -
testcase_07 AC 48 ms
18,548 KB
testcase_08 AC 46 ms
22,680 KB
testcase_09 AC 49 ms
22,736 KB
testcase_10 AC 46 ms
20,600 KB
testcase_11 AC 47 ms
20,688 KB
testcase_12 AC 46 ms
20,748 KB
testcase_13 AC 46 ms
20,696 KB
testcase_14 AC 46 ms
20,664 KB
testcase_15 AC 46 ms
20,704 KB
testcase_16 AC 45 ms
20,600 KB
testcase_17 AC 47 ms
22,644 KB
testcase_18 AC 46 ms
20,664 KB
testcase_19 AC 47 ms
20,584 KB
testcase_20 AC 47 ms
20,592 KB
testcase_21 AC 47 ms
22,744 KB
testcase_22 AC 48 ms
20,676 KB
testcase_23 AC 46 ms
20,628 KB
testcase_24 AC 46 ms
20,672 KB
testcase_25 AC 47 ms
20,696 KB
testcase_26 AC 46 ms
20,516 KB
testcase_27 AC 45 ms
20,652 KB
testcase_28 AC 46 ms
18,612 KB
testcase_29 AC 47 ms
22,668 KB
testcase_30 AC 48 ms
20,708 KB
testcase_31 AC 47 ms
20,760 KB
testcase_32 AC 48 ms
22,644 KB
testcase_33 AC 50 ms
20,636 KB
testcase_34 AC 49 ms
20,596 KB
testcase_35 AC 48 ms
20,800 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(string[] args) {
        //入力
        int x = int.Parse(Console.ReadLine());

        //出力
        if (x == 0) {
            Console.WriteLine(1);
            Console.WriteLine(0);
        } else {
            //Console.WriteLine(Factorial_(31, 31 - x));
            //Console.WriteLine(Factorial(x));
            Console.Write(nCm(31, x));
            Console.Write(" ");
            Console.WriteLine(2147483647 * nCm(30, x - 1));
        }

        //ulong Factorial(ulong n) {
        //    if (n == 0)
        //        return 1;
        //    return n * Factorial(n - 1);
        //}

        //ulong Factorial_(ulong a, ulong b) {
        //    if (a == b)
        //        return 1;
        //    return a * Factorial_(a - 1, b);
        //}

        long nCm(int n, int m) {
            if (m == 0) return 1;
            if (n == 0) return 0;
            return n * nCm(n - 1, m - 1) / m;
        }

        //Console.WriteLine(Factorial(31));
        //Console.WriteLine(Factorial(2));
        //Console.WriteLine(Factorial(3));
    }
}
0