結果

問題 No.523 LED
ユーザー treeonetreeone
提出日時 2017-06-02 22:33:58
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,683 ms / 2,000 ms
コード長 735 bytes
コンパイル時間 1,982 ms
コンパイル使用メモリ 160,284 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-29 15:46:20
合計ジャッジ時間 11,353 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 21 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 1,678 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 12 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 324 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 3 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 3 ms
6,676 KB
testcase_18 AC 1,683 ms
6,676 KB
testcase_19 AC 597 ms
6,676 KB
testcase_20 AC 531 ms
6,676 KB
testcase_21 AC 1,256 ms
6,676 KB
testcase_22 AC 1,408 ms
6,676 KB
testcase_23 AC 1,406 ms
6,676 KB
testcase_24 AC 32 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef pair<int, int> P;

const int mod = 1e9 + 7;

long long mod_pow(long long x, long long n){
    if(n == 0) return 1;
    long long res = mod_pow(x*x % mod, n / 2);
    if(n & 1) res = res*x % mod;
    return res;
}

signed main(){
    int n;
    cin >> n;
    int ans = 1;
    rep(i, 1, 2 * n + 1){
        ans = (ans * i) % mod;
    }
    // cout << ans << endl;
    rep(i, 0, n){
        ans = (ans * mod_pow(2, mod - 2)) % mod;
    }
    cout << ans << endl;
}
0