Problem Description
Loading...
Problem Analysis
This problem looks scary at first glance given the data range
but what it actually asks is simply
whether a is divisible by b
The solution still relies on the congruence theorem
simulate the big number with a string
then apply the congruence theorem
reading the digit information from the string one character at a time
while taking the remainder modulo b
using a long long to store the value
If it divides evenly in the end
that is sum==0
then it is divisible
otherwise it is not
cpp
| |
Problem link: 【Light】[1214]Large Division