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

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

Suppose we have given a permutation of length n. Can we find the count of a specific binary string of length n-1. Such that for each permutation p we increment the count of binary string b, where b[i]=='1' if p[i+1]>p[i] else '0' for each i from 0...n-2. For n=5 I have runned the bruteforce code

Code

Getting the output

result

Полный текст и комментарии »

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

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

My grandfather ask me this puzzle problem.

Three friends were traveling together and one night they made some "littis" and went to sleep without eating any "littis". During the night, one of the friends woke up and divided the "littis" into three equal parts, with one extra "litti" left over. He gave the extra "litti" to the dog and ate his one out of three part and he went back to sleep. After some time, another friend woke up and he also divided the "littis" into three equal parts, with one "litti" left over. He gave the extra "litti" to the dog, ate his one part, and went back to sleep. The third friend woke up and did the same thing. In the morning, all three friends woke up and divided the remaining "littis" into three equal parts, with one left over. They ate their parts, and gave the extra "litti" to the dog. Finally, no "littis" were left. Can you guess how many "littis" there were originally?

Litti

I have tried bruteforce on number of littis and found the number as sequence of 79,160,241…

Can someone proof how this patterns of number is following ??

Полный текст и комментарии »

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

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

Which college courses do you find very helpful for CP ??. For me it was Number theory and cryptography . Plz comment below.

Полный текст и комментарии »

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