結果

問題 No.420 mod2漸化式
ユーザー mban
提出日時 2016-10-12 03:43:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 785 bytes
コンパイル時間 5,277 ms
コンパイル使用メモリ 102,656 KB
実行使用メモリ 17,536 KB
最終ジャッジ日時 2024-12-24 13:05:18
合計ジャッジ時間 5,341 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Threading.Tasks;

class Magatro
{
    static int x = int.Parse(Console.ReadLine());
   static void Main() {
        if (x >= 32)
        {
            Console.WriteLine("0 0");
            return;
        }
        long ko = nCm(31, x);
        Console.Write(ko+" ");
        long wa;
        wa = 2147483647 * nCm(30, x - 1);
        Console.Write(wa);
        Console.WriteLine();

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

}


0