結果

問題 No.727 仲介人moko
ユーザー merom686
提出日時 2018-08-24 22:11:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 13 ms / 1,000 ms
コード長 494 bytes
コンパイル時間 629 ms
コンパイル使用メモリ 73,584 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 07:38:59
合計ジャッジ時間 1,550 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 1000000007;

int main() {
    int n;
    cin >> n;

    ll r = 1;

    for (int i = 1; i <= n; i++) {
        r *= i;
        r %= P;
    }

    for (int i = 0; i < n; i++) {
        ll k = i * 2;
        r *= ((k + 1) * (k + 2) / 2) % P;
        r %= P;
    }

    cout << r << endl;

    return 0;
}
0