No.1879 How many matchings?
問題文最終更新日: 2022-03-19 02:08:49
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 336
(順位表)
の他の問題:
Problem Statement
Let $G$ be the undirected graph with vertices vertex $1$, vertex $2$, ..., vertex $n$, in which any distinct vertices $a, b$ satisfying $|a-b| \leq 2$ are connected by one edge. There are no other edges.
How many maximum matchings does $G$ have? Find the count modulo $10^9+7$.
Input
$n$
$1 \leq n \leq 10^{18}$
Output
Output the number of maximum matchings modulo $10^9+7$. Print a newline at the end.
Sample
Sample 1
Input
1
Output
1
Sample 2
Input
2
Output
1
Sample 3
Input
10
Output
8
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
37zigen