結果

問題 No.727 仲介人moko
ユーザー とばりとばり
提出日時 2018-09-02 14:42:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 18 ms / 1,000 ms
コード長 2,282 bytes
コンパイル時間 2,427 ms
コンパイル使用メモリ 166,892 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 16:49:31
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 3 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 9 ms
6,676 KB
testcase_15 AC 14 ms
6,676 KB
testcase_16 AC 7 ms
6,676 KB
testcase_17 AC 10 ms
6,676 KB
testcase_18 AC 7 ms
6,676 KB
testcase_19 AC 16 ms
6,676 KB
testcase_20 AC 9 ms
6,676 KB
testcase_21 AC 6 ms
6,676 KB
testcase_22 AC 5 ms
6,676 KB
testcase_23 AC 17 ms
6,676 KB
testcase_24 AC 18 ms
6,676 KB
testcase_25 AC 12 ms
6,676 KB
testcase_26 AC 14 ms
6,676 KB
testcase_27 AC 12 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using int64 = long long;
using uint64 = unsigned long long;

#define repeat(i, x) for (int64 i = 0; (i) < (x); (i)++)
#define rev_repeat(i, x) for (int64 i = (x) - 1; (i) >= 0; (i)--)
#define countup(i, n) for (int64 i = 0; (i) <= (n); (i)++)
#define countdown(i, n) for (int64 i = (n); (i) >= 0; (i)--)
#define range(i, a, b) for (int64 i = (a); (i) < (b); (i)++)
#define traverse(it, ctn) for (auto it = begin(ctn); (it) != end(ctn); (it)++)
#define rev_traverse(it, ctn) for (auto it = rbegin(ctn); (it) != rend(ctn); (it)++)

template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec)
{
    os << "[";
    repeat (i, vec.size())
    {
        os << (i == 0 ? "" : ", ") << vec[i];
    }
    os << "]";
    return os;
}

template<typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& p)
{
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os, set<T>& s)
{
    os << "{";
    traverse (it, s)
    {
        if (it != s.begin()) os << ", ";
        os << *it;
    }
    os << "}";
    return os;
}

template<typename K, typename V>
ostream& operator<<(ostream& os, map<K, V>& m) 
{
    os << "{";
    traverse (it, m)
    {
        if (it != m.begin()) os << ", ";
        os << it->first << ": " << it->second;
    }
    os << "}";
    return os;
}

//
// _______  _____  _______  _____  _______ _______ _____ _______ _____ _    _ _______ 
// |       |     | |  |  | |_____] |______    |      |      |      |    \  /  |______ 
// |_____  |_____| |  |  | |       |______    |    __|__    |    __|__   \/   |______ 
//
//  _____   ______  _____   ______  ______ _______ _______ _______ _____ __   _  ______   /
// |_____] |_____/ |     | |  ____ |_____/ |_____| |  |  | |  |  |   |   | \  | |  ____  / 
// |       |    \_ |_____| |_____| |    \_ |     | |  |  | |  |  | __|__ |  \_| |_____| .  
//

constexpr int64 MOD = 1e9 + 7;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int64 N;
    cin >> N;

    int64 ans = 1;
    for (int64 n = 1; n <= N; n++)
    {
        ans = (ans * (2 * n - 1)) % MOD;
        ans = (ans * n) % MOD;
        ans = (ans * n) % MOD;
    }
    cout << ans << endl;

    return 0;
}
0