結果
| 問題 |
No.8048 Order and Harmony
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-01 23:50:05 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,138 bytes |
| コンパイル時間 | 2,117 ms |
| コンパイル使用メモリ | 193,924 KB |
| 最終ジャッジ日時 | 2025-01-07 01:15:03 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 50 TLE * 11 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define dom 998244353
#define all(c) begin(c),end(c)
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template <typename T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }
#define long long long
#define List vector
#define var auto
#define Count size()
#define Length size()
int dd[] = { 0, 1, 0, -1, 0 }; //→↓←↑
long powmod(long a, long b, long p)
{
if (b == 0) return 1;
if (b % 2 == 0)
{
long d = powmod(a, b / 2, p);
return d * d % p;
}
else
{
return a * powmod(a, b - 1, p) % p;
}
}
void solve()
{
int K;
cin >> K;
if (K % 2 == 1)
{
cout << 0 << endl;
return;
}
K >>= 1;
long bunshi = 1;
long bunbo = 1;
for (int i = 1; i <= K; i++)
{
bunshi = bunshi * (i + K) % mod;
bunbo = bunbo * i % mod;
}
cout << (bunshi * powmod(bunbo, mod - 2, mod) % mod) << endl;
}
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
solve();
return 0;
}