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

Автор rifat1234, 11 лет назад, По-английски

Can anyone help me on learning combinatorics by giving some tutorials and nice implementation in c++ ? I have seen the topcoder tutorial , but have not understand it well :( if you give me an implementation in c++ with some comment . it will be great.. :) Thanx in Advance.. :)

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

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

There are lot of different formula for combination because there are lot of different type of it. I will say you 2 type. First, Loto.
Where number N is number in basket, and k number how many I will get out. N! means 1*2*3..*N Second, little bit easier. I have 1 bacteria. After 1 min, 1 bacteria is going to separate to two bacteria. How many bacteria you will have after 5 min. Answer is 2^5=32

Ok, if you understand that up here think about this question. How many different number can we get if you have N different digits and the number can have less then M digits. Answer N^(M+1)

»
11 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Look here. You may try some easy problems from this category, it should help you a lot.

First of all, you should try to solve problem by yourself, if you can not — do it with editorial. After that — read implementations of some skilled users (searching for some useful tricks or realy nice implementation).

  • »
    »
    11 лет назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится

    Thanks for your kind advice

    I am really confused about when to see the editorial. How much time and effort I should spend trying to solve the problem before seeing the editorial in the worst cases ?

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

      It is realy hard question. In my opinion, 10 minutes is enough. All that easy problems are based on well-known facts and ideas, and wasting your time for finding out that things (instead of simply reading about them in editorial) is not a very good idea.

      But some people say that you need to spend at least an hour on easy problems, and spending even whole evening on some more complicated problems is not a time wasting, especially if you finaly managed to solve the task — it should significantly improve your skill of "solving creativity" and finding out interesting ideas.

      • »
        »
        »
        »
        11 лет назад, # ^ |
        Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

        What really matters is whether you understand for sure the idea or not. If you can solve other similar problem without reading the solution or any editorial, then you got the main idea of that problem.