What does bitwise and (&) mean?I had come across a code which had a line: [code]i += i & -i[/code]. I know that & compares two bin...
Reposted: Is there a better algorithm to solve this problem?@ne555 Yes I understood why!! Its because the array test[] isnt sorted. Rollie's solution is similar...
Reposted: Is there a better algorithm to solve this problem?@helios I didn't understand your post, i always get confused when it comes to trees. So i always try...
Reposted: Is there a better algorithm to solve this problem?@JLBorges and @Cire I will have a look at your codes, thank you. Meanwhile here's what happened, usi...
Reposted: Is there a better algorithm to solve this problem?@Duaos vector::erase is linear but i call it N times and N<=4000. So it is becoming very slow.