Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

Автор sahilPict_26, история, 4 часа назад, По-английски

Recently, while upsolving Problem 4 from the Div 2 Contest 959, I encountered an intriguing concept called the Pigeonhole Principle. Although initially unfamiliar with this principle, I found it fascinating and wanted to share my newfound knowledge with the community.

Pigeonhole Principle states that, If we have n pigeons and m holes, and if n>m, then there will be at least one hole where more than one pigeons will be present.

While this statement might appear straightforward, its can be used in many of the complex problems.

Here are some problems which uses Pigeonhole Principle:-

1) https://www.codechef.com/problems/GRAYSC

2) https://www.geeksforgeeks.org/discrete-mathematics-the-pigeonhole-principle/

You must try this!

Happy coding!

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

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

I too found this interesting sahilPict_26

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

and if m>n, then there will be at least one hole where more than one pigeons will be present.

No. the correct condition is n>m.

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

I think you should say n>m. Pardon me if I am wrong.

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

Auto comment: topic has been updated by sahilPict_26 (previous revision, new revision, compare).