結果

問題 No.523 LED
ユーザー mbanmban
提出日時 2017-06-03 14:12:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 352 ms / 2,000 ms
コード長 952 bytes
コンパイル時間 911 ms
コンパイル使用メモリ 109,388 KB
実行使用メモリ 23,760 KB
最終ジャッジ日時 2023-10-22 02:57:25
合計ジャッジ時間 4,121 ms
ジャッジサーバーID
(参考情報)
judge9 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
23,760 KB
testcase_01 AC 24 ms
23,760 KB
testcase_02 AC 28 ms
23,760 KB
testcase_03 AC 23 ms
23,760 KB
testcase_04 AC 23 ms
23,760 KB
testcase_05 AC 352 ms
23,760 KB
testcase_06 AC 23 ms
23,760 KB
testcase_07 AC 23 ms
23,760 KB
testcase_08 AC 23 ms
23,760 KB
testcase_09 AC 26 ms
23,760 KB
testcase_10 AC 24 ms
23,760 KB
testcase_11 AC 24 ms
23,760 KB
testcase_12 AC 24 ms
23,760 KB
testcase_13 AC 87 ms
23,760 KB
testcase_14 AC 24 ms
23,760 KB
testcase_15 AC 24 ms
23,760 KB
testcase_16 AC 24 ms
23,760 KB
testcase_17 AC 24 ms
23,760 KB
testcase_18 AC 351 ms
23,760 KB
testcase_19 AC 140 ms
23,760 KB
testcase_20 AC 128 ms
23,760 KB
testcase_21 AC 270 ms
23,760 KB
testcase_22 AC 298 ms
23,760 KB
testcase_23 AC 299 ms
23,760 KB
testcase_24 AC 30 ms
23,760 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        new Magatro().Solve();
    }
}

class Magatro
{
    private int N;
    private const int Mod = 1000000007;

    private long Pow(long a,long b,int mod)
    {
        long res = 1;
        while (b > 0)
        {
            if(b%2 == 1)
            {
                res *= a;
                res %= mod;
            }
            a *= a;
            a %= mod;
            b /= 2;
        }
        return res;
    }

    public void Solve()
    {
        N = int.Parse(Console.ReadLine());
        long ans = 1;
        for(int i = 1; i <= N * 2; i++)
        {
            ans *= i;
            ans %= Mod;
        }
        long a = Pow(2, N,Mod);
        long b = Pow(a, Mod - 2, Mod);
        ans *= b;
        ans %= Mod;
        Console.WriteLine(ans);
    }
}

0