Ayushrusiya47's blog

By Ayushrusiya47, history, 5 months ago, In English

Hi,
I recently watched a Veritasium video based on prisoner's dilemma, a Game Theory problem. In the video he mentioned that a scientist, Robert Axelrod, held a tournament where he invited programmers to submit programs for playing the game and he matched them against each other and scored and ranked them.

This type of tournament sounds really interesting, your programs will not run on fixed test cases but against each other! I tried to find platforms that have these type of contests and I found codingame.com. This website have games where you can submit your bot to play against others. I haven't explored it much yet but it looks interesting.

What is your view on this type of contest, can we get them on Codeforces maybe. Also if you know any other competitions or platforms that have this type of contests, please share.

Full text and comments »

  • Vote: I like it
  • +12
  • Vote: I do not like it

By Ayushrusiya47, history, 7 months ago, In English

You are given an array of arrays $$$A$$$ containing integers of the range $$$[1, N]$$$. Now you need to select one element from every array present in $$$A$$$ such that no two elements are same i.e. you need to make a permutation of length $$$N$$$ such that element at $$$i_{th}$$$ index is present in the array $$$A_i$$$. Also find the number of permutations that satisfy this condition.

For example:

A = [
     [1,2,5],
     [3],
     [2,4],
     [1,4,5],
     [1,3]
    ]

[2, 3, 4, 5, 1] will be a valid permutation for this case.

I think I have seen this problem as a subproblem in some questions, but I can not think of anything other than brute force.

Thanks.

Full text and comments »

  • Vote: I like it
  • +4
  • Vote: I do not like it