|
|
back to boardBrute Force after rejudge I got an error on #8 after rejudging the problem. First i got AC. This time I tried a brute force approach. first i generated al binary digits from 0 to 2^N. then i counted sum of the stones where the bit was 1. The difference total-2*sum had to be minimal. AC in 0.2 sec Re: Brute Force after rejudge Posted by retNAN 27 May 2013 09:49 I tried this approach but got TLE for test 3. Question i keep asking myself is, "Must you check all the 2^N combinations. if "No" how should you set your break point? Re: Brute Force after rejudge Try to write more effective code, don't use string and set at all! Re: Brute Force after rejudge Posted by retNAN 11 Jun 2013 19:57 Try to write more effective code, don't use string and set at all! Thank You. Just nailed it. |
|
|