結果

問題 No.8048 Order and Harmony
ユーザー claw88
提出日時 2019-04-01 23:46:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,128 bytes
コンパイル時間 2,169 ms
コンパイル使用メモリ 193,556 KB
最終ジャッジ日時 2025-01-07 01:14:07
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 24 WA * 20 TLE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
	}

	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;
}
0