Need help creating an algorithm
The reason for this is because I'm having a bit of trouble coming up with an algorithm i need in order to solve the problem. This problem i'm talking about is from the 2016/2017 ACM international collegiate programming contest.
Here is the prompt.
Here is my progrss.
As you can see in my code, although works for 70% of inputs, it's by no means the utmost ideal solution. Makeshift/spaghetti code to say the least. And for such reason, I call for your help. I am thinking about creating the algorithm around the for loop with maybe some iteration based matrices where i set all possible option into 1's and 0's and thus find the best matching accommodation. The only problem is that i don't even know where to start……..would this even work?
Please help. Any suggestions/comments would be greatly appreciated. Thank you in advance and good day. Cheers! 🙂
Submitted July 14, 2017 at 12:17AM by SpaceMonkeyClan
via reddit http://ift.tt/2uY5joa