|
|
back to boardShow all messages Hide all messagesI 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 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? Try to write more effective code, don't use string and set at all! Try to write more effective code, don't use string and set at all! Thank You. Just nailed it. |
|
|