結果
| 問題 |
No.420 mod2漸化式
|
| コンテスト | |
| ユーザー |
bayashiko_r
|
| 提出日時 | 2019-01-08 02:38:33 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,107 bytes |
| コンパイル時間 | 2,765 ms |
| コンパイル使用メモリ | 112,740 KB |
| 実行使用メモリ | 25,672 KB |
| 最終ジャッジ日時 | 2024-11-24 00:33:34 |
| 合計ジャッジ時間 | 2,621 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 34 WA * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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));
}
}
bayashiko_r