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

Автор Naaz, история, 3 года назад, По-английски

Hello, I most fail to solve a specific type of question in all platforms. Like 1840B - Binary Cafe. or this codechef question

It's not with the tags that i am concerned with rather the type of questions where we are required to output values in straight forward (O(1)) type computation. Like deriving a formulate and few base cases. So please if you have some suggestions for these type of questions please help me out.

Happy Coding.

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

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

For the Binary Cafe -> I solved using bitmasks. My other friends solved in different ways.

For 2nd one I solved it using brute force O(N*M) iterating over all possible of N*M pairs.

If you have an idea of over bit mask then you can solve the first one. There are other ways too to solve Binary Cafe problem.

For 2nd Codechef problem, once you write equations in your notebook you will get an idea how it can be solved.