Submission #19681

#TimeUsernameProblemLanguageResultExecution timeMemory
19681algoshipda괄호 (kriii4_R)C++14
0 / 100
65 ms1720 KiB
#include <bits/stdc++.h> using namespace std; typedef long long lld; const int MOD = 1e9 + 7; int fpow(int n, int k) { if(k == 0) return 1; if(k % 2){ return 1ll * n * fpow(n, k - 1) % MOD; } int h = fpow(n, k / 2); return 1ll * h * h % MOD; } inline int inv(int n) { return 1ll * fpow(n, MOD - 2) % MOD; } inline void mult(int& a, int b) { a = 1ll * a * b % MOD; } inline int mult2(int a, int b) { return 1ll * a * b % MOD; } inline void sub(int& a, int b) { a = ((a - b) % MOD + MOD) % MOD; } inline int rational(int a, int b) { return 1ll * a * inv(b) % MOD; } inline void add(int &a, int b) { a = ((a + b) % MOD + MOD) % MOD; } int main() { int n, k; cin >> n >> k; if(n%2){ cout << 0 << '\n'; return 0; } int ans = 1; for(int i = 0; i < n / 2; ++i){ mult(ans, n - i); mult(ans, inv(i + 1)); } mult(ans, inv(n/2 + 1)); cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...