Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Parameters are string which is a huge number, divisor which can be long but can fit in long long
- /// and loop initializer because string can start with negative sign
- int bigmod(string num,ll divisor,int i)
- {
- ll res = 0;
- for(int j=i;j<num.size();j++)
- res = (res*10+(int)num[j]-'0')%divisor;
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment