CSES - Bit Strings
Xem dạng PDF
Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
512M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Your task is to calculate the number of bit strings of length ~n~.
For example, if ~n=3~, the correct answer is ~8~, because the possible bit strings are 000, 001, 010, 011, 100, 101, 110, and 111.
Input
- The only input line has an integer ~n~.
Output
- Print the result modulo ~10^9+7~.
Constraints
- ~1 \le n \le 10^6~
Example Input
3
Example Output
8
Bình luận