結果

問題 No.523 LED
ユーザー maesoramaesora
提出日時 2017-06-02 22:59:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 661 bytes
コンパイル時間 737 ms
コンパイル使用メモリ 85,756 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 22:26:02
合計ジャッジ時間 2,268 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 3 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 144 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 28 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 148 ms
4,348 KB
testcase_19 AC 53 ms
4,348 KB
testcase_20 AC 45 ms
4,348 KB
testcase_21 AC 107 ms
4,348 KB
testcase_22 AC 120 ms
4,348 KB
testcase_23 AC 119 ms
4,348 KB
testcase_24 AC 5 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>
#include <climits>
#include <functional>

#define REP(i,n) for(int i = 0;i < n;i++)

using namespace std;
typedef long long ll;
const int INF = INT_MAX / 4;
const int p = 1e9 + 7;

const ll inv_elem_2 = 500000004;


int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  ll res = 1;
  for(int i = 2;i <= N * 2;i++) {
    res = (res * i) % p;
  }
  REP(i, N) res = (res * inv_elem_2) % p;

  cout << res << "\n";
  return 0;
}
0