Language: C++

include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("-1"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
#define bn(x) ((1<<x)-1)
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,const vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
 
 
 
int main() {
  int n,m;
  scanf("%d%d",&n,&m);
  vvi a(n,vi(m));
  rep(i,n)rep(j,m) a[i][j] = in()-1;
  int ans = INF;
  vi used(m);
  vi s(n);
  rep(mi,m) {
    vi cnt(m);
    rep(i,n) {
      while (used[a[i][s[i]]]) ++s[i];
      cnt[a[i][s[i]]]++;
    }
    P p(0,0);
    rep(i,m) maxs(p,P(cnt[i],i));
    mins(ans,p.fi);
    used[p.se] = 1;
  }
  cout<<ans<<endl;
  return 0;
}
 
 
 
 

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:28:9: error: 'pair' does not name a type
   28 | typedef pair<int,int> P;
      |         ^~~~
a.cc:29:9: error: 'vector' does not name a type
   29 | typedef vector<int> vi;
      |         ^~~~~~
a.cc:30:9: error: 'vector' does not name a type
   30 | typedef vector<vi> vvi;
      |         ^~~~~~
a.cc:31:9: error: 'vector' does not name a type
   31 | typedef vector<ll> vl;
      |         ^~~~~~
a.cc:32:9: error: 'vector' does not name a type
   32 | typedef vector<P> vp;
      |         ^~~~~~
a.cc: In function 'int in()':
a.cc:33:26: error: 'scanf' was not declared in this scope
   33 | inline int in() { int x; scanf("%d",&x); return x;}
      |                          ^~~~~
a.cc: At global scope:
a.cc:34:13: error: variable or field 'priv' declared void
   34 | inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
      |             ^~~~
a.cc:34:18: error: 'vi' was not declared in this scope; did you mean 'v'?
   34 | inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
      |                  ^~
      |                  v
a.cc:35:21: error: 'istream' does not name a type
   35 | template<typename T>istream& operator>>(istream&i,vector<T>&v)
      |                     ^~~~~~~
a.cc:37:21: error: 'string' does not name a type
   37 | template<typename T>string join(const vector<T>&v)
      |                     ^~~~~~
a.cc:39:21: error: 'ostream' does not name a type
   39 | template<typename T>ostream& operator<<(ostream&o,const vector<T>&v)
      |                     ^~~~~~~
a.cc:41:34: error: 'istream' does not name a type
   41 | template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
      |                                  ^~~~~~~
a.cc:43:34: error: 'ostream' does not name a type
   43 | template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v)
      |                                  ^~~~~~~
a.cc: In function 'int main()':
a.cc:53:3: error: 'scanf' was not declared in this scope
   53 |   scanf("%d%d",&n,&m);
      |   ^~~~~
a.cc:54:3: error: 'vvi' was not declared in this scope; did you mean 'vv'?
   54 |   vvi a(n,vi(m));
      |   ^~~
      |   vv
a.cc:55:20: error: 'a' was not declared in this scope
   55 |   rep(i,n)rep(j,m) a[i][j] = in()-1;
      |                    ^
a.cc:57:3: error: 'vi' was not declared in this scope; did you mean 'v'?
   57 |   vi used(m);
      |   ^~
      |   v
a.cc:58:5: error: expected ';' before 's'
   58 |   vi s(n);
      |     ^~
      |     ;
a.cc:60:7: error: expected ';' before 'cnt'
   60 |     vi cnt(m);
      |       ^~~~
      |       ;
a.cc:62:14: error: 'used' was not declared in this scope
   62 |       while (used[a[i][s[i]]]) ++s[i];
      |              ^~~~
a.cc:62:19: error: 'a' was not declared in this scope
   62 |       while (used[a[i][s[i]]]) ++s[i];
      |                   ^
a.cc:62:24: error: 's' was not declared in this scope
   62 |       while (used[a[i][s[i]]]) ++s[i];
      |                        ^
a.cc:63:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   63 |       cnt[a[i][s[i]]]++;
      |       ^~~
      |       int
a.cc:63:11: error: 'a' was not declared in this scope
   63 |       cnt[a[i][s[i]]]++;
      |           ^
a.cc:63:16: error: 's' was not declared in this scope
   63 |       cnt[a[i][s[i]]]++;
      |                ^
a.cc:65:5: error: 'P' was not declared in this scope
   65 |     P p(0,0);
      |     ^
a.cc:66:19: error: 'p' was not declared in this scope
   66 |     rep(i,m) maxs(p,P(cnt[i],i));
      |                   ^
a.cc:9:19: note: in definition of macro 'maxs'
    9 | #define maxs(x,y) x = max(x,y)
      |                   ^
a.cc:66:23: error: 'cnt' was not declared in this scope; did you mean 'int'?
   66 |     rep(i,m) maxs(p,P(cnt[i],i));
      |                       ^~~
a.cc:9:29: note: in definition of macro 'maxs'
    9 | #define maxs(x,y) x = max(x,y)
      |                             ^
a.cc:9:23: error: 'max' was not declared in this scope; did you mean 'maxs'?
    9 | #define maxs(x,y) x = max(x,y)
      |                       ^~~
a.cc:66:14: note: in expansion of macro 'maxs'
   66 |     rep(i,m) maxs(p,P(cnt[i],i));
      |              ^~~~
a.cc:67:14: error: 'p' was not declared in this scope
   67 |     mins(ans,p.fi);
      |              ^
a.cc:10:29: note: in definition of macro 'mins'
   10 | #define mins(x,y) x = min(x,y)
      |                             ^
a.cc:10:23: error: 'min' was not declared in this scope; did you mean 'mi'?
   10 | #define mins(x,y) x = min(x,y)
      |                       ^~~
a.cc:67:5: note: in expansion of macro 'mins'
   67 |     mins(ans,p.fi);
      |     ^~~~
a.cc:68:5: error: 'used' was not declared in this scope
   68 |     used[p.se] = 1;
      |     ^~~~
a.cc:70:3: error: 'cout' was not declared in this scope
   70 |   cout<<ans<<endl;
      |   ^~~~
a.cc:70:14: error: 'endl' was not declared in this scope
   70 |   cout<<ans<<endl;
      |              ^~~~