Closed morris821028 closed 7 years ago
Because of the integer division, variable d maybe not a correct solution.
In fact, we just check whether (s * 1000000) is a multiple of (p - 1000000) easily. Finally, using it to instead of full re-check is faster than old version.
It is fixed in commit https://github.com/morris821028/UVa/commit/7463e2ad548313a6ef4f7ada00e3dc4d07d85734 .
Content