THEATRE - Editorial

You must have written a combination wrongly… :sweat_smile:…I saw your code, lot of F word.:joy::joy: When you code with lot of frustration, it comes out :crazy_face: @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 :sweat_smile: , 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

https://www.codechef.com/viewsolution/29390712
I WROTE 207 LINES OF CODE

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. :yum:

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.

@roha2 Why you don’t use nested loop?

@tmwilliamlin Could you put links to similar problems?

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
1 Like

Can someone help me understand why my code didn’t pass subtask 2?

https://www.codechef.com/viewsolution/29535268

Impressive approach. Can you please elaborate your soln?

This was basically N rooks problem for N=4.

GOD

1 Like

really glad to know, thanks for your time

1 Like

https://www.codechef.com/viewsolution/29713499
my code solves problem in O(n) , and only 70 lines of code.
but it was partially accepted.