結果

問題 No.523 LED
ユーザー xxxasdfghjk
提出日時 2018-08-17 21:28:05
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 689 bytes
コンパイル時間 1,081 ms
コンパイル使用メモリ 72,032 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-10 18:21:49
合計ジャッジ時間 2,637 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<map>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
ll bpow(ll a,ll x,ll mod){
  int res=1;
  while(x){
    if(x & 1)
      res = res*a % mod;
    a = a*a % mod;
    x >>= 1;
  }
  return res;
}

int main()
{
  ll res=1,N,MOD=10E8+7;
  cin >> N;
  for(int i=1;i<=2*N;i++){
    res = (res*i) % MOD;
  }
  res = res*bpow(bpow(2,N,MOD),MOD-2,MOD) % MOD;
  cout << res << endl;
  return 0;
}

0