Блог пользователя shelby70

Автор shelby70, история, 12 месяцев назад, По-английски

Problem Link: B. Petr and a Combination Lock

Solution Link: Click Here...

Here, Instead of following bitmasks method, I used itertools.combinations() module of Python and got accepted. Can someone please help to find its space and time complexity in worst case scenario? Thank you...

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится

»
12 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

I don't know much about python, but to me it looks like combinations was used to make all possible bitmasks of size N to determine which rotation is clockwise and which counterclockwise. Complexity of the solution is $$$O(2^N N).$$$