|
|
вернуться в форумCould somebody who solved this problem send some examples of tests and solutions? I thought that I wrote a correct algorithm, that summarise number of stones of each type, then sort it and then check how many permutations of the last one that makes it equal to K, there is and calculate a number of possibilities. But I get error on Test 3. Or may be I did not understood the task, I found the bug, but now I get wrong answer for test 26 Finally solved it. The last bug was to find a function that calculates factorial coefficients (ncr) without going to big numbers. What is the principle of this function? |
|
|