結果

問題 No.727 仲介人moko
コンテスト
ユーザー merom686
提出日時 2018-08-24 22:11:14
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 10 ms / 1,000 ms
コード長 494 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 480 ms
コンパイル使用メモリ 93,156 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-07 23:29:57
合計ジャッジ時間 1,239 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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