473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 = 2417851639229258349412352

The question is how can you compare these numbers if you raise them to a power and then compare it is not possible? (or rather, but what resources are needed?)))


n = int(input())
h = {}
for i in range(n):
args = list(map(int, input().split()))
args.pop(0)
c = 1
for p in args[::-1]:
c = p ** c
h[i] = c
print(*[x[0] + 1 for x in sorted(h.items(), key=lambda x: x[1])])

https://math.stackexchange.com/questions/101138/complexity-class-of-comparison-of-power-towers
Jun 2 '18 #1
0 1184

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: koray | last post by:
hi, i need to show large numbers seperated by commas. since i'm using variables from speedscript, i cannot know their values, since the user should enter them. how should i code to show these...
3
by: Alex Vinokur | last post by:
Dann Corbit has implemented function int ilog2 (unsigned long) at http://groups.google.com/groups?selm=lkPa4.2165%24I41.1498%40client Is exist a similar C++-function for very large numbers,...
10
by: Tuvas | last post by:
I've been thinking about writing a program to generate the world's largest prime numbers, just for the fun of it. This would require being able to hold an 8000000 digit number into memory (25...
1
by: Jonathan | last post by:
My app is trying to multiply and add some very large numbers. Here is the line that I am am having problems with: Seconds = CDbl(PartB) * CDbl(16777216) Seconds is a double and PartB is a...
22
by: Frinton | last post by:
Hi, I am trying to do some calculations on large numbers (ie 7,768,489,957,892,578,474,792,094 / 12,280) and no matter what I do it doesn't get it quite right. Its always somewhere between 10...
3
by: CFonville | last post by:
I was wondering if there is any way to store large numbers in a variable? With this simple script: var bigpi = 1234567890123456789012345678901234567890123456789012345678901234567890;...
24
by: Frank Swarbrick | last post by:
We have a batch process that inserts large numbers (100,000 - 1,000,000) of records into a database each day. (DL/I database.) We're considering converting it to a DB2 table. Currently we have...
2
by: Todd.Branchflower | last post by:
Hey everyone, I am new to c++ and the group and would appreciate your help. I was doing a problem on projecteuler.net in which you had to find the largest factor of an extremely large number. ...
3
by: rangerSkip | last post by:
I'm looking to find the sums and differences of large numbers inputed by the user. all numbers must by positive and whole and the first number must be larger than the second. I'm having a couple...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.