+ 2
How to do sum of very big integer?
If I am doing it with python execution time is greater than 5 seconds.In c i know we can use long long int. But is there any other way to do it? Please help
6 odpowiedzi
+ 2
Rohit kumar Thank you very much!!! and I saw its implementation but do U know how much time does it take (Big O)?. Although I implement it in java using Big Integer class but it takes more time for large number.I will soon post that solution in java.
https://code.sololearn.com/c2pZ3v8DQVuD/?ref=app
+ 2
visph THANK YOU! ! I found the right algorithm(I wanted to calculate Fibonacci series of modulo m of very big integer.The algorithm for that is using pisano period ).I got your point.
https://code.sololearn.com/c3IupR9r7IXj/?ref=app
+ 1
You can do by using bit operations store the two numbers in binary format in arrays and then add by basic bit operations i.e. using carry and sum counter.
+ 1
C is a compiled language.
Python is an interpreted one.
Execution time will ever be in favour of former (with equivalent algorithm), but ease of use of later will ever win ^^
+ 1
Simple by adding them into each other 😉🤣
0
CiPher I think u can hack NASA with Ur logic 😂😂😂.