CSES Problemset/Introductory Problems
Bit Strings
#1617Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude DesktopYour task is to calculate the number of bit strings of length .
For example, if , the correct answer is , because the possible bit strings are 000, 001, 010, 011, 100, 101, 110, and 111.
Input
The only input line has an integer .
Output
Print the result modulo .
Constraints
Sample Test Cases (1)
Example 1ID: sample-1
Input
3
Expected Output
8
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|1 line, 0 charsTest Bench
Input (stdin)
3
Expected Output
8