Здравейте,
Имам проблем с въпросната задача, на която последните 2 теста ми гърмят и не проумявам защо. Ще се радвам да подадете ръка.
Грешни кейсове + Output:
Test case #30: Wrong Answer [0.007 s, 7.68 MB]
Your output (clipped)
96076791513699680
Test case #31: Wrong Answer [0.007 s, 7.68 MB]
Your output (clipped)
384307167128540540
Код:
Условие:
Above the Main Diagonal
You are given a square matrix of numbers, formed by powers of 2. See example
Example : N = 4
1 2 4 8
2 4 8 16
4 8 16 32
8 16 32 64
You task is to find the sum above the main diagonal.
The result is: 2 + 4 + 8 + 8 + 16 + 32 = 70
Input
Read from the standard input
- On the first line, read the number N
- The number of rows and columns
Output
Print to the standard output
- On the first line, print the sum of the numbers above the main diagonal except the diagonal
Sample tests
Input
4
Output
70