Sandy and Nuts (332 E)

Revision en1, by lmn0x4F, 2015-12-16 10:18:26

Hey, I was upsolving some problems and one of them was this one: 599E - Сэнди и Орешки

I liked the problem and after reading the editorial and some silly mistakes in the implementation I got accepted and feel that I learned something, but there's something I don't understand in the editorial, the time complexity.

I understand how to check the fulfillment of the conditions before a transition in O(N3) or O(N·Q) but I don't understand where does the O(3N) come from.

Could anyone give me an explanation or at least some hints about the 3N? ;)

Here's my solution btw 14830356

Thanks :)

Tags dp, bitmask, time complexity

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English lmn0x4F 2015-12-16 10:19:39 16
en1 English lmn0x4F 2015-12-16 10:18:26 640 Initial revision (published)