Language: C++

int N, M, res, A[300][300], c[300];
bool b[300];


int main() {
	cin >> N >> M;
	res = 0xE869120;
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < M; ++j) {
			cin >> A[i][j];
		}
	}
	for (int i = 0; i < M; ++i) {
		b[i] = true;
	}
	for (int i = 0; i < M; ++i) {
		for (int j = 0; j < M; ++j) {
			c[j] = 0;
		}
		for (int j = 0; j < N; ++j) {
			pair<int, int>p = mkp(-1, -1);
			for (int k = 0; k < M; ++k) {
				if (b[k]) {
					p = max(p, mkp(A[j][k], k));
				}
			}
			++c[p.second];
		}
		pair<int, int> MAX = mkp(-1, -1);
		for (int j = 0; j < M; ++j) {
			MAX = max(MAX, mkp(c[j], j));
		}
		res = min(res, MAX.first);
		b[MAX.second] = false;
	}
	cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> N >> M;
      |         ^~~
a.cc:21:25: error: 'pair' was not declared in this scope
   21 |                         pair<int, int>p = mkp(-1, -1);
      |                         ^~~~
a.cc:21:30: error: expected primary-expression before 'int'
   21 |                         pair<int, int>p = mkp(-1, -1);
      |                              ^~~
a.cc:24:41: error: 'p' was not declared in this scope
   24 |                                         p = max(p, mkp(A[j][k], k));
      |                                         ^
a.cc:24:52: error: 'mkp' was not declared in this scope
   24 |                                         p = max(p, mkp(A[j][k], k));
      |                                                    ^~~
a.cc:24:45: error: 'max' was not declared in this scope
   24 |                                         p = max(p, mkp(A[j][k], k));
      |                                             ^~~
a.cc:27:29: error: 'p' was not declared in this scope
   27 |                         ++c[p.second];
      |                             ^
a.cc:29:17: error: 'pair' was not declared in this scope
   29 |                 pair<int, int> MAX = mkp(-1, -1);
      |                 ^~~~
a.cc:29:22: error: expected primary-expression before 'int'
   29 |                 pair<int, int> MAX = mkp(-1, -1);
      |                      ^~~
a.cc:31:25: error: 'MAX' was not declared in this scope
   31 |                         MAX = max(MAX, mkp(c[j], j));
      |                         ^~~
a.cc:31:40: error: 'mkp' was not declared in this scope
   31 |                         MAX = max(MAX, mkp(c[j], j));
      |                                        ^~~
a.cc:31:31: error: 'max' was not declared in this scope
   31 |                         MAX = max(MAX, mkp(c[j], j));
      |                               ^~~
a.cc:33:32: error: 'MAX' was not declared in this scope
   33 |                 res = min(res, MAX.first);
      |                                ^~~
a.cc:33:23: error: 'min' was not declared in this scope; did you mean 'main'?
   33 |                 res = min(res, MAX.first);
      |                       ^~~
      |                       main
a.cc:36:9: error: 'cout' was not declared in this scope
   36 |         cout << res << endl;
      |         ^~~~
a.cc:36:24: error: 'endl' was not declared in this scope
   36 |         cout << res << endl;
      |                        ^~~~