結果
問題 |
No.790 ちきんの括弧並べ
|
ユーザー |
![]() |
提出日時 | 2019-09-10 22:47:29 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 23 ms / 2,000 ms |
コード長 | 338 bytes |
コンパイル時間 | 2,045 ms |
コンパイル使用メモリ | 102,528 KB |
実行使用メモリ | 17,664 KB |
最終ジャッジ日時 | 2024-07-02 16:26:27 |
合計ジャッジ時間 | 1,917 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; public class Yuki790 { public static void Main() { var n = int.Parse(Console.ReadLine()); var a = 1L; for(var i = 0; i < n - 1; ++i) a *= (2 * n - i); var b = Factorial(n); Console.WriteLine(a / b); } private static long Factorial(int n) { if(n == 0) return 1L; return n * Factorial(n - 1); } }