PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#BS0000417. Bài toán cực đại hóa cực tiểu (Minimax Problem)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Bài toán cực đại hóa cực tiểu (Minimax Problem)
Minimax Problem
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given an by matrix, choose row indices , possibly equal. Define . Find a pair maximizing the smallest component of .
Input
The first line contains . Each of the next lines contains integers representing one row.
Output
Print any optimal pair of row indices (1-based). The indices may coincide.
Subtasks
- Subtask 1 (20 points): ; ; (, ).
- Subtask 2 (30 points): ; ; (, ).
- Subtask 3 (50 points): ; ; (, ).
Examples
Example 1
Input
6 5
5 0 3 1 2
1 8 9 1 3
1 2 3 4 5
9 1 0 3 7
2 3 0 6 3
6 4 1 7 0
Output
1 5
Explanation
Rows 1 and 5 yield and score 3. At threshold 4 only row 2 covers column 3; no row covers all its missing columns 1,4,5.