位串

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

翻译自 CSES-1617 题。

题目描述

你的任务是计算长度为 nn 的二进制串的数目。例如,当 n=3n=3 时,有 88 个二进制串,分别为 000,001,010,011,100,101,110,111000,001,010,011,100,101,110,111

输入格式

输入一个正整数 nn

输出格式

输出一行一个整数,表示答案 mod109+7\bmod 10^9+7 的结果。

样例

3
8

说明/提示

1n1061\le n \le 10^6

CSES练习一 枚举、模拟、数学

Not Claimed
Status
Done
Problem
19
Open Since
2025-5-1 0:00
Deadline
2025-6-2 23:59
Extension
24 hour(s)