pretending's blog

By pretending, history, 2 months ago, In English

These problems were asked in Google Online Challenge a few weeks ago. For first one, I tried to put alternating levels into separate groups (forming only two groups) but that didn't worked for me :(. For second one, I have no idea. I will greatly appreciate any help. Thanks in advance.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By pretending, history, 2 months ago, In English

I am stuck at this problem currently.

Problem link

I have tried a O(n^2) approach but the accepted solution is supposedly O(log(n)*n) or less. How do solve this?

Read more »

 
 
 
 
  • Vote: I like it
  • +2
  • Vote: I do not like it