NeoAlgo icon indicating copy to clipboard operation
NeoAlgo copied to clipboard

AGGRESSIVE COWS

Open NEEHITGOYAL opened this issue 6 years ago • 12 comments

💥 Proposal

Not part of Contributor's Hack 2020

Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 <= xi <= 1,000,000,000).

His C (2 <= C <= N) cows don't like this barn layout and become aggressive towards each other once put into a stall. To prevent the cows from hurting each other, FJ wants to assign the cows to the stalls, such that the minimum distance between any two of them is as large as possible. What is the largest minimum distance?

Input Format First line contains N and C, separated by a single space, representing the total number of stalls and number of cows respectively. The next line contains N integers containing the indexes of stalls. Output Format Print one integer: the largest minimum distance.

example::

Sample Input 5 3 1 2 8 4 9 Sample Output 3 Problem Credits - (Spoj)[http://www.spoj.com/problems/AGGRCOW/]

Have you read the Contributing Guidelines on Pull Requests?

yes

Assignees

CPP: [@NEEHITGOYAL ] C: [@SangeetaMishra ] C#: Java: [@ritvij14 ] Python: Go: Javascript:

NEEHITGOYAL avatar Aug 31 '20 19:08 NEEHITGOYAL

i would like to work on this issue in c++ as part of hakin codes @SKAUL05 @Abhijit2505 @plazzy99 @Kajol-Kumari

NEEHITGOYAL avatar Aug 31 '20 19:08 NEEHITGOYAL

I would like to take this in Java for CH20.

ritvij14 avatar Aug 31 '20 20:08 ritvij14

The name of the problem LOL @NEEHITGOYAL Go ahead with C++ @SangeetaMishra Go ahead with C @ritvij14 Go ahead with Java

vgb-codes avatar Sep 01 '20 12:09 vgb-codes

I would like to work on this in python

salonishah01 avatar Sep 02 '20 03:09 salonishah01

will there be only one test case or multiple test cases such as

5 3 1 2 4 8 9

6 3 1 6 7 8 9 21

can i solve it in python/java

coolpydev avatar Sep 02 '20 14:09 coolpydev

@coolpydev I HAVE MADE ISSUE FOR SINGLE TEST CASE YOU MAY MAKE ANOTHER ISSUE IF U WANNA ADD MULTIPLE TEST CASES

NEEHITGOYAL avatar Sep 02 '20 17:09 NEEHITGOYAL

This issue is not the part of Contributor's Hack 2020

Reason: As this is a Problem set Question, not any Algorithm or Data Structure Implementation, we cannot add this issue as part of Hakincodes 2020

siddharth25pandey avatar Sep 06 '20 18:09 siddharth25pandey

@siddharth25pandey what is the folder cp for and also the folder others many issues as a problem statement were issues has been added as part of hakin codes kindly add it as part of hakin codes it is a good prob. for understanding binary search

NEEHITGOYAL avatar Sep 06 '20 19:09 NEEHITGOYAL

@NEEHITGOYAL There are plenty of Questions in CP which needs implementation of DS & Algo, which doesn't mean we can add each of them.

  • Conclusion This issue cannot be added as part of CH20 due to this reason. Instead of discussing here, better to search for other issues, Thanks!

siddharth25pandey avatar Sep 07 '20 05:09 siddharth25pandey

@NEEHITGOYAL can you assign me to complete this program in python. I've the repository ready in my profile for multiple inputs as it was in SPOJ.

coolpydev avatar Sep 07 '20 11:09 coolpydev

@coolpydev I m not mentor

NEEHITGOYAL avatar Sep 07 '20 11:09 NEEHITGOYAL

Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Telegram or ping one of the reviewers. Thank you for your contributions!

github-actions[bot] avatar Nov 08 '20 00:11 github-actions[bot]