Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

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

Hello, I most fail to solve a specific type of question in all platforms. Like 1840B - Бинарная кофейня. 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
  • Проголосовать: не нравится

»
16 месяцев назад, # |
  Проголосовать: нравится 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.

  • »
    »
    16 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    In the second problem, you can just output YES if difference is even and NO otherwise.

  • »
    »
    16 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Yeah Thats so true. I solved both of them in contest eventually. But can you suggest which tag or filter should i apply to find questions like these.