#K82382. Total Nodes in a Complete Binary Tree
Total Nodes in a Complete Binary Tree
Total Nodes in a Complete Binary Tree
In a complete binary tree of level (N), the total number of nodes is given by the formula (2^{(N+1)} - 1). In this problem, you are given an integer (N) (where (0 \le N \le 50)) which represents the level of the binary tree (with level 0 corresponding to a tree with a single node). Your task is to compute and output the total number of nodes in the tree.
For example, when (N = 0), the tree consists of only one node, and when (N = 1), the tree has (2^{(1+1)} - 1 = 3) nodes.
inputFormat
The input is read from standard input and consists of a single integer (N) ((0 \le N \le 50)), representing the level of the complete binary tree.
outputFormat
Output a single integer to standard output, representing the total number of nodes in the complete binary tree computed using the formula (2^{(N+1)} - 1).## sample
0
1
</p>