問題一覧 > 通常問題

No.1879 How many matchings?

レベル : / AI推定難易度 : 1700 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 55
作問者 : 37zigen / テスター : shotoyoo 👑 cologne
お気に入りにしたユーザー ProblemId : 7647 / 自分の提出
問題文最終更新日: 2022-03-19 02:08:49
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もしくは右上の雲マークをクリックしてアカウントを作成してください。