mardi 24 mars 2015

Maximum number of Bishops that can be placed on a NxN Chessboard - SPOJ

Using the Constant time formula for Maximum bishops on a chessboard, which is:



int maxBishops(N) return 2*(N-1);


Implemented for the value of N lesser than 10^100, as follows: http://ift.tt/1N4wdOc


Verified using Wolfram|Alpha but getting wrong answer on SPOJ's BISHOPS submission.


Am I missing something in the algorithm or is it an implementation issue?


Aucun commentaire:

Enregistrer un commentaire