my code fails the tests
Ten towers are given. You need to compare them. exponentiation occurs from right to left a ^ (a ^ (a ^ a)). At the end, print their indexes in ascending order. Here is my code but it is incorrect.
input
10 // number of towers
4 2 2 2 2 2 // 4 The first number in a line is not an element of the tower, it is the //number of elements in it minus one.
1 2 2
1 3 2
1 2 3
3...
User Profile
Collapse
Profile Sidebar
Collapse
aleksandr421
Last Activity: Jun 17 '18, 10:34 PM
Joined: Jun 2 '18
Location:
-
Finalize the program
input with this test is true
10 # the number of digits in the bottom
4 2 2 2 2 2 # first digit number of degrees in this row -1
1 2 2
1 3 2
1 2 3
3 2 2 2 2
2 2 2 2
1 3 3
3 3 3 3 3
2 4 3 3
2 2 3 4
output
2 4 3 6 7 5 9 10 1 8
Here the task is to raise to a power and then compare their numbers to derive the index in the order of increasing numbers
... -
Is there any algorithm for comparing large numbers?
input
4 # how many of those pieces at the bottom
4 2 2 2 2 2 # first number of numbers in this range -1
3 3 3 3 3
2 2 3 4
5 9 9 9 9 9 9
OUTPUT(index output in ascending order)
3 1 2 4
as here is raised to the power of 2 2 3 4
first 3 ^ 4 = 81 then 2 ^ 81 = 241785163922925 8349412352
The question is how can you compare these numbers if you raise them...
No activity results to display
Show More