Thursday, August 21, 2014

COJ 1683. DPA

The constraints are very low (N<=500) which means that the simplest brute force solution will pass 100%. Just loop over all  the numbers uptp N-1 and check for divisibility and add to sum, then compare the sum with N and output the answer accordingly.


       FULL SOURCE CODE

No comments:

Post a Comment