For numbers n
and m
I need to evaluate n % m
.
The catch is n
can be as big as 10^100000
, m
maxes out at 10^18
.
unsigned long long
is about 2^64
(please correct me if I'm wrong) which won't do,
then I thought I could read it in array of characters, but how to calculate remainder of character.
Is there any way to reduce that number to a smaller number so it could be transferred from char array to unsigned long long
(like atol
but for long long
instead of long
).
Also I think I would be needing a faster way to do %, because time limit is 0.1s
Any help is appreciated.