This repository contains a solution to the "Maximum Minimization" problem. The problem involves selecting two arrays from a set of arrays and forming a new array such that the minimum element of each position in the new array is maximized. The problem statement is as follows:
You are given n arrays, each consisting of m integers. You need to choose two arrays, ai
and aj
, such that the value of min_k=1^m bk
is maximized, where bk=max(ai,k,aj,k)
.
For detailed problem description and examples, refer to the problem statement.
The solution to this problem uses a binary search algorithm to find the maximum possible minimum value. The code is implemented in C++ for efficiency.
-
Clone this repository:
git clone https://github.com/your-username/maximum-minimization.git
-
Compile the C++ code:
g++ -o max_minimization max_minimization.cpp
-
Create an input file (e.g., input.txt) with the input data.
-
Run the program with the input file:
./max_minimization < input.txt
-
The program will output the indices of the two selected arrays, i and j.
Contributing
Contributions are welcome! If you have any improvements or suggestions, please open an issue or create a pull request.
The End!