Algorithm of getting minimum sum for contiguous integer array
$10-30 USD
Abgeschlossen
Veröffentlicht vor mehr als 2 Jahren
$10-30 USD
Bezahlt bei Lieferung
1. Problem Description. The creator of Squid Game decided to add one more game for the players. The players are required to form a team of k members to cover a land separated into fields of different areas. Each player must be assigned a number of contiguous fields in the land where he/she have to go through the entire field to collect hidden coins. Assuming that each field can be assigned to only one player, all players must be assigned to at least one field, and that it takes a player 1 unit of time to cover 1 m2 of land, you are required to find an assignment for the players to the fields such that the maximum time it takes a player in the team to cover his/her assigned fields is minimized. The land is represented by an array of integers representing the areas of its fields in m2.
For example, if k = 2 and l = [100, 100, 100, 100], then the optimal solution is to assign Player 1 to the first two fields and to assign Player 2 to the last two fields making the maximum time a player needs 200 units of time. However, if k = 2 and l = [10, 20, 30, 40], then the best solution is to assign Player 1 to the first three fields requiring 60 units of time and to assign Player 2 to the last field requiring 40 units of time making the maximum time a player needs 60 units of time.
2. Deliverables. You are required to submit one Java file named with your ID (example [login to view URL]) containing the following two methods.
a) public static String naive (int k, int[] l) that implements a naive brute force solution for the problem.
b) public static String efficient (int k, int[] l) that implements the most efficient solution you can think of for the problem.
Both methods return a string encoding of the solution represented as follows:
maxTime;P1 fields;P2 fields;...;Pk fields
where maxT ime is the minimized maximum time for a player and Pi f ields for 1 ≤ i ≤ k
are the areas of the fields assigned to Player i separated by commas.
3. Sample Input/Output
k=2, l=[100,100,100,100]
Output: 200;100,100;100,100
k=2, l=[10,20,30,40]
Output: 60;10,20,30;40
Hi there,
I checked your requirements and guarantee you it's gonna be done within the next few hours.
Let's contact via chat so that I can start work immediately.
Wish you the best.
Hello, I am a software and Web Developer. I hava also lot of experience in Designing.
I have some rules and regulations before start of project:
1. Provide 100% work within deadline.
2. Provide unlimited revisions until employee satisfy 100%
The area of experties are:
1. Java, JavaFX, JAVA( SWing), J2EE
2. PHP, HTML, CSS, BootStrap
3. MVC, C#, .NET
4. C/C++ Programming
5. Android Applications Developmet
My main target is provide you a 100% work within your deadline and low budget. You get a good result after
hiring me.
So click award button for more discussion. Thanks
lsmd
Hello I just saw your requirements and after checking it I believe it is something which I can handle easily
I'll provide you quality work with perfection as needed with guaranteed best rates
you can sent me a message to discuss more details
waiting for a response with your good name
Thanks
Algorithm expert.
Hi Client, I'll provid you with clear and quick result.
I'm Ihor.K algorithm expert with 5 years of experience in C/C++/C#/Python.
I have a strong grip on algorithms and data structure as I not only took part but won many programming contests.
You can check my certificate in my portfolio here:
www.freelancer.com./u/ihorkostiuchenko
I'm interested to hear more about the project.
When do you need this finished?
If you award me the project, I'd pleased to discuss this further and get started for you as soon as possible.
I'll show you my ability and I'm looking forward to working with you for a long time.
Please contact me.
Thanks! Ihor
I have more than 10 years experience in programming. I will guarentee you a good quality of work on time and unlimited number of revisions until your satisfaction. Please feel free to contact me in order to discuss your request.