結果

問題 No.523 LED
ユーザー nanophoto12nanophoto12
提出日時 2017-07-17 22:58:14
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 839 bytes
コンパイル時間 645 ms
コンパイル使用メモリ 89,764 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 00:02:55
合計ジャッジ時間 2,473 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>

using namespace std;

#define ll long long int
#define pii pair<int,int>

const ll mod = 1000000007;

long long qpow(long long a, long long b)
{
    long long ret=1;
    while(b)
    {
        if(b&1)ret=(ret*a)%mod;
        b>>=1;
        a=(a*a)%mod;
    }
    return ret;
}
int main()
{
    ll n;
    cin >> n;
    ll sum = 1;
    for(ll i = 2 * n; i >= 1;i--)
    {
        sum *= i;
        sum %= mod;
    }
    ll div = qpow(2, mod-2);
    for(int i = 0;i < n;i++)
    {
        sum *= div;
        sum %= mod;
    }
    cout << sum << endl;
}
0