You must have written a combination wrongly… …I saw your code, lot of F word. When you code with lot of frustration, it comes out @sunny_52525
You have to check all possible pairs in order to solve the question … it is similar to N queen backtracking question
https://www.codechef.com/viewsolution/29440801
a kinda diff way of pushing data to 2d array , shorter than some of brute force soln. btw fetched me just 30 points lol.
I did the same way as you, to get correct output for input 0 we have to initialize profit to -400. check out my solution here.
https://www.codechef.com/viewsolution/29538571
Yes, my farraatedaar code also worked for every input problem setter threw on it. I was sad that day and this particular AC in 1 go made me a little happy and helped me survive the day.
I’m going crazy…can’t figure out why my soln isn’t working. Someone please check my solution and tell me what is wrong with it. I used all permutations of movies with all permutations for prices. Takes 4! * 4! iterations.
https://www.codechef.com/viewsolution/29534099
what is the time complexity of this one??
What you are doing is different from what is asked. You are trying to fit each person in a (possibly?) different permutation.
We need to find single arrangement that would be followed by all.
I tried solving this problem with Hungarian Algorithm, with 300+ lines of code.
146 times to be precise:joy:
Try
Test case
1
2
C 12
C 9
Can someone help me understand why my code didn’t pass subtask 2?
Impressive approach. Can you please elaborate your soln?
This was basically N rooks problem for N=4.
GOD
really glad to know, thanks for your time
https://www.codechef.com/viewsolution/29713499
my code solves problem in O(n) , and only 70 lines of code.
but it was partially accepted.