## A Times B

View as PDF

Points:30 (partial)
Time limit:2.0s
Memory limit:256M
Author:

Problem type

Allowed languages
C, C++, Pascal, Rust

For a while now, FatalEagle has been thinking about fast multiplication. He found the problem on SPOJ, MUL, and solved it without too much trouble. Then he found VFMUL on the same site, but the same code for MUL didn't pass as the SPOJ servers were really slow. Frustrated and desperate to show off demonstrate his fast multiplication code, FatalEagle has created a problem that really tests the accuracy and speed of your fast multiplication code.

#### Input Specification

The first line of input will have .

The second line of input will have .

Both and will be non-negative integers strictly less than .

#### Output Specification

Output the product .

#### Sample Input

123456123456123456123456123456123456
987987876876765765654654543543432432321321


#### Sample Output

121973153300851295215956247283945278187966162014464020099359068031370037005376


• SnowSR
commented on Dec. 6, 2015, 9:52 p.m.
JAVA unavailable?

Why not JAVA? Isn't BigInteger capable of processing numbers of any range?

• Kirito
commented on June 12, 2016, 10:35 p.m.

Funny thing; I was reading the Java BigInteger documentation, and the fastest multiplication method would take 6 seconds on a worst case.

• arock
commented on Dec. 6, 2015, 9:59 p.m.

That is precisely why Java is disallowed.

• bobhob314
commented on Dec. 7, 2015, 10:31 a.m.

Don't even think you're going to win...

Fite me ᕦ(ò_óˇ)ᕤ)

• arock
commented on Dec. 7, 2015, 11:43 a.m.

̿̿ ̿̿ ̿̿ ̿'̿'\̵͇̿̿\з= ( ▀ ͜͞ʖ▀) =ε/̵͇̿̿/’̿’̿ ̿ ̿̿ ̿̿ ̿̿

hob plz

• FatalEagle
commented on Jan. 15, 2015, 10:15 a.m.
Time Limit Changed

Time limit lowered to 2s. Karatsuba shall not pass!

• bobhob314
commented on Jan. 7, 2015, 9:12 a.m.
Karatsuba?

Any recommended algorithms?