Sort 24 Discussions, By:
Please Login in order to post a comment
I am always getting wrong answer except 1st test case. Is there any other method other than modular exponentiation and modular addition and multiplication? I have submitted my code in both Python and C++.
Output exactly one line containing exactly 12 digits - the last 12 digits of the sum of all results.
Incredibly easy in Python!
Sovled in Java 8 using BigInteger.modPow(BigInteger exponent, BigInteger m). Optimize the input, multiply/add/mod, use primitive long.
BigInteger.modPow(BigInteger exponent, BigInteger m)
Who knows solution for A=B=C=D=999999999?