Language: C++

#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
#define SORTPairSecond(v, n) sort(v, v+n, pairCompareSecond);
// #define int long long    // %d=>%lld, 1<<n  => 1LL<<n
#define pb push_back

using namespace std;
typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
bool pairCompareSecond(const pii& firstEl, const pii& secondEl) {
    return firstEl.second > secondEl.second;
}

const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
// const ll LLINF = 1LL << 50;
const double PI = acos(-1);
const double EPS = 0.000000001;


const int MAX_n = 300;
const int MAX_m = 300;
int n, m, a[MAX_n][MAX_m];

int tmp;

freq[MAX_m+1];

queue a[MAX_n];

signed main(){


    cin >> n >> m;
    for(int i = 0;i < n;i++){
        for(int j = 0;j < m;j++){
            cin >> tmp;
            a[i].push(tmp)
        }
    }

    int ans = INF;
    for(int i = 0;i < m-1;i++){
        int ans_t=0;
        fill(freq,0);
        for(int j = 0;j < n;j++){
            freq[que[j].front()]++;
        }
        int f_n =  * max_elememt(freq,freq+301);
        for(int j = 0;j < n;j++){
            ans_t++;
            if(que[j].front() == f_n){
                que[j].pop();
            }
        }
        ans = min(ans, ans_t);
    }


    int ans_t=0;
    fill(freq,0);
    for(int j = 0;j < n;j++){
        freq[que[j].front()]++;
    }
    int f_n =  * max_elememt(freq,freq+301);
    for(int j = 0;j < n;j++){
        ans_t++;
    }
    ans = min(ans, ans_t);


    cout<< ans<< endl;



    return 0;
}

Compiler output:
a.cc:35:1: error: 'freq' does not name a type
   35 | freq[MAX_m+1];
      | ^~~~
a.cc:37:1: error: missing template argument list after 'std::queue'; for deduction, template placeholder must be followed by a simple declarator-id
   37 | queue a[MAX_n];
      | ^~~~~
      |      <>
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:96:11: note: 'template<class _Tp, class _Sequence> class std::queue' declared here
   96 |     class queue
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:46:18: error: request for member 'push' in 'a[i]', which is of non-class type 'int [300]'
   46 |             a[i].push(tmp)
      |                  ^~~~
a.cc:53:14: error: 'freq' was not declared in this scope; did you mean 'free'?
   53 |         fill(freq,0);
      |              ^~~~
      |              free
a.cc:55:18: error: 'que' was not declared in this scope
   55 |             freq[que[j].front()]++;
      |                  ^~~
a.cc:57:22: error: 'max_elememt' was not declared in this scope
   57 |         int f_n =  * max_elememt(freq,freq+301);
      |                      ^~~~~~~~~~~
a.cc:60:16: error: 'que' was not declared in this scope
   60 |             if(que[j].front() == f_n){
      |                ^~~
a.cc:69:10: error: 'freq' was not declared in this scope; did you mean 'free'?
   69 |     fill(freq,0);
      |          ^~~~
      |          free
a.cc:71:14: error: 'que' was not declared in this scope
   71 |         freq[que[j].front()]++;
      |              ^~~
a.cc:73:18: error: 'max_elememt' was not declared in this scope
   73 |     int f_n =  * max_elememt(freq,freq+301);
      |                  ^~~~~~~~~~~