1097B — Petr and a Combination Lock

Revision en2, by ayush29azad, 2021-08-11 09:40:12

How to solve this problem using bitmask or bit manuplation ??

Problem Link :https://codeforces.net/problemset/problem/1097/B Editorial Link :https://codeforces.net/blog/entry/64310

I am not able to understand the editorial which says that clockwise rotation will be done if ith bit is set to 0 and vive versa ?? Can someone explain in detail ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English ayush29azad 2021-08-11 09:40:51 9 Reverted to en1
en2 English ayush29azad 2021-08-11 09:40:12 9 Tiny change: 'm/1097/B\n**Editor' -> 'm/1097/B\n[cut]\n**Editor'
en1 English ayush29azad 2021-08-11 09:39:40 397 Initial revision (published)