結果
問題 | No.523 LED |
ユーザー |
![]() |
提出日時 | 2017-06-03 12:23:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 354 ms / 2,000 ms |
コード長 | 2,022 bytes |
コンパイル時間 | 916 ms |
コンパイル使用メモリ | 112,696 KB |
実行使用メモリ | 26,440 KB |
最終ジャッジ日時 | 2024-09-22 04:26:32 |
合計ジャッジ時間 | 4,064 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Competitive_Programming { class MainClass { Scanner sc; const long MOD = (int)1e9 + 7; static void Main(string[] args) { new MainClass().solve(); } long PowMod(long a, long p) { if (p == 0) return 1; if (p % 2 == 1) { return a * PowMod(a, p - 1) % MOD; } long t = PowMod(a, p / 2); return t * t % MOD; } void solve() { sc = new Scanner(); StringBuilder res = new StringBuilder(); long N = sc.NextInt(); long ans = 1; for (int i = 1; i <= N * 2; i++) { ans = ans * i % MOD; } ans = ans * PowMod(PowMod(2, N), MOD - 2) % MOD; res.Append(ans); Console.WriteLine(res); } } class Scanner { Queue<string> buf; public Scanner() { buf = new Queue<string>(); } private void GetBuf() { while (buf.Count == 0) { string[] stringArray = Console.ReadLine().Split(' '); if (stringArray.Length == 0 || stringArray[0] == "") { continue; } foreach (string e in stringArray) { buf.Enqueue(e); } } } public int NextInt() { return int.Parse(this.Next()); } public long NextLong() { return long.Parse(this.Next()); } public double NextDouble() { return double.Parse(this.Next()); } public string Next() { this.GetBuf(); return buf.Dequeue(); } } }