Multiply
Time limit2sMemory limit128 MB
Multiply two non-negative integers given as decimal strings of up to 50,000 digits each and print the product without leading zeros.
- Level
Medium6 of 10
- Topics
- Math, Implementation, Array, String matching
- Solved
- No attempts yet
Problem
Write a program that computes the product of two non-negative integers A and B. The integers are given in decimal notation and have N and M digits, respectively.
Input
The first line contains the lengths N and M, separated by a space. A is given on the second line and B on the third line. The numbers do not have leading zeros.
Output
Output the product of A and B without leading zeros.
Constraints
- 1 ≤ N, M ≤ 50 000