criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

typedef long long LL;

#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define REP(i,n) FOR(i,0,n)
#define max(l,r) ((l)>(r)?l:r)
#define min(l,r) ((l)<(r)?l:r)

#define MAX  600000
#define LIM  100000000
const LL MOD = 1000000007;
const int INF = 2147483647/2;
const LL LINF = 9223372036854775807/3;

int ucmpii(const void *a, const void *b){return(*(int*)a==*(int*)b?0:(*(int*)a>*(int*)b?1:-1));}
int dcmpii(const void *a, const void *b){return(*(int*)a==*(int*)b?0:(*(int*)a<*(int*)b?1:-1));}

int ucmpll(const void *a, const void *b){return(*(LL*)a==*(LL*)b?0:(*(LL*)a>*(LL*)b?1:-1));}
int dcmpll(const void *a, const void *b){return(*(LL*)a==*(LL*)b?0:(*(LL*)a<*(LL*)b?1:-1));}

void SORT(int*a, int n){qsort(a,n,sizeof(int),ucmpii);}
void SORTR(int*a, int n){qsort(a,n,sizeof(int),dcmpii);}
void LSORT(LL*a, int n){qsort(a,n,sizeof(LL),ucmpll);}
void LSORTR(LL*a, int n){qsort(a,n,sizeof(LL),dcmpll);}

const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,1,0,-1,1,-1,1,-1};






int main(){
  
  int H,W,M;
  scanf("%d%d%d%d%d%d",&H,&W,&M);

  int hcnt[MAX]={0}, wcnt[MAX]={0};
  int hset[MAX]={0}, wset[MAX]={0};

  REP(i,M){
    int h,w;
    scanf("%d%d",&h,&w);
    h--;w--;
    hcnt[h]++;
    wcnt[w]++;
    hset[i] = h;
    wset[i] = w;
  }

  int hmax=0, wmax=0, bmax=0;

  REP(i,H) hmax = max(hmax,hcnt[i]);
  REP(i,W) wmax = max(wmax,wcnt[i]);
  REP(i,M) bmax = max(bmax,hcnt[hset[i]]+wcnt[wset[i]]);

  LL bmcnt=0,hmcnt=0,wmcnt=0;

  REP(i,H){
    if(hmax==hcnt[i]) hmcnt++;
  }
  REP(i,W){
    if(wmax==wcnt[i]) wmcnt++;
  }
  REP(i,M){
    if(bmax==hcnt[hset[i]]+wcnt[wset[i]]) bmcnt++;
  }

  int ans = hmax+wmax;

  if(bmax == hmax+wmax){
    if(bmcnt == hmcnt*wmcnt){
      ans--;
    }
  }

  prinf("%d\n",ans);

}

Compiler output:
main.c: In function 'main':
main.c:83:3: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   83 |   prinf("%d\n",ans);
      |   ^~~~~
      |   printf
Language: C

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
 
#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
#ifdef _MSC_VER
    freopen("e.in", "r", stdin);
#endif
    std::ios::sync_with_stdio(false);
    int n, m, c;
    cin >> n >> m >> c;
    vector<pair<int, int>> sx(n), sy(m);
    for (int i = 0; i < n; i++) {
        sx[i].second = i;
    }
    for (int i = 0; i < m; i++) {
        sy[i].second = i;
    }
    set<pair<int, int>> a;
    for (int i = 0; i < c; i++) {
        int x, y;
        cin >> x >> y;
        --x;
        --y;
        ++sx[x].first;
        ++sy[y].first;
        a.insert(make_pair(x, y));
    }
    sort(sx.rbegin(), sx.rend());
    sort(sy.rbegin(), sy.rend());
    int ret = 0;
    for (const auto& gx : sx) {
        for (const auto& gy : sy) {
            int d = a.count(make_pair(gx.second, gy.second));
            ret = max(ret, gx.first + gy.first - d);
            if (d == 0) {
                break;
            }
        }
    }
    cout << ret << endl;
    return 0;
}

Compiler output:
main.c:5:10: fatal error: bits/stdc++.h: No such file or directory
    5 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

using namespace std;

const int N = 300004;
int cnth[N], cntw[N], x[N], y[N];
map <int, bool> mp[N];

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int h, w, m;
    cin >> h >> w >> m;
    for (int i = 0; i < m; i++) {
        cin >> x[i] >> y[i];
        mp[x[i]][y[i]] = true;
        cnth[x[i]]++, cntw[y[i]]++;
    }
    int mxh = 0, mxw = 0;
    for (int i = 0; i < N; i++) {
        mxh = max(mxh, cnth[i]);
        mxw = max(mxw, cntw[i]);
    }
    vector <int> hall, wall;
    for (int i = 0; i < N; i++) {
        if (cnth[i] == mxh) {
            hall.push_back(i);
        }
        if (cntw[i] == mxw) {
            wall.push_back(i);
        }
    }
    int cnt = 0, mx = 0;
    for (int i = 0; i < hall.size(); i++) {
        for (int j = 0; j < wall.size(); j++) {
            cnt++;
            if (cnt > N * 2)
                break;
            mx = max(mx, mxh + mxw - mp[hall[i]][wall[j]]);
        }
        if (cnt > N * 2)
            break;
    }
    cout << mx;
}

Compiler output:
a.cc:5:1: error: 'map' does not name a type
    5 | map <int, bool> mp[N];
      | ^~~
a.cc:7:1: error: 'int32_t' does not name a type
    7 | int32_t main() {
      | ^~~~~~~
a.cc:1:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | using namespace std;
Language: Java

import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static final int MOD = 1000000007;

    public static int cnt = Integer.MAX_VALUE;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = Integer.parseInt(sc.next());
        int w = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        var hm = new HashMap<Integer, Long>();
        var wm = new HashMap<Integer, Long>();
        var hw = new boolean[h][w];
        for (int i = 0; i < h; i++) {
            hm.put(i, 0L);
        }
        for (int i = 0; i < w; i++) {
            wm.put(i, 0L);
        }
        for (int i = 0; i < m; i++) {
            int hh = Integer.parseInt(sc.next());
            int ww = Integer.parseInt(sc.next());
            hm.merge(hh - 1, 1L, Long::sum);
            wm.merge(ww - 1, 1L, Integer::sum);
            hw[hh - 1][ww - 1] = true;
        }
        long ans = 0;
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                long num = hm.get(i) + wm.get(j);
                if (hw[i][j]) {
                    num--;
                }
                ans = Math.max(ans, num);
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:28: error: incompatible types: invalid method reference
            wm.merge(ww - 1, 1L, Integer::sum);
                                 ^
    incompatible types: Long cannot be converted to int
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 3e5+23;

vector<pair<int, int>> v;
int H[N], W[N];

void solve() {
  int h, w, m; scanf("%d%d%d", &h, &w, &m);
  int a = 0, b = 0;
  for (int i = 0; i < m; ++i) {
    int x, y; scanf("%d%d", &x, &y);
    v.emplace_back(--x, --y);
    ++H[x];
    a = max(a, H[x]);
    ++W[y].first;
    b = max(b, W[y]);
  }
  int cnt = 0;
  for (const auto &e: s) {
    cnt += (H[e.first]+W[e.second]) == (a+b);
  }
  int cntH = 0, cntW = 0;
  for (int i = 0; i < h; ++i)
    cntH += (H[i] == a);
  for (int i = 0; i < w; ++i)
    cntW += (W[i] == b);
  if (1LL*cntH*cntW > cnt)
    printf("%d", a+b);
  else
    printf("%d", a+b-1);
}

int main() {
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:28:12: error: request for member 'first' in 'W[y]', which is of non-class type 'int'
   28 |     ++W[y].first;
      |            ^~~~~
a.cc:32:23: error: 's' was not declared in this scope
   32 |   for (const auto &e: s) {
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int n,m,i,a,b,nr,k,mx,maxk,row[300005],col[300005],mxrow,mxcol,MROW,MCOL;
vector < pair <int,int> > maxesR, maxesC;
vector <int> v[300005];

 
int main() 
{
    std::ios_base::sync_with_stdio(false);
    cin.tie(false);
    cin>>n>>m>>k;
    maxk = max(n,m);
    for (i=1; i<=k; i++)
    {
        cin>>a>>b;
        v[a].push_back(b);
        row[a]++;
        col[b]++;
        if (row[a]>mxrow) {
            maxesR.clear();
            maxesR.push_back({row[a],a});
            mxrow = row[a];
        } else if (row[a]==mxrow){
            maxesR.push_back({row[a],a});
        }
        if (col[b]>mxcol) {
            maxesC.clear();
            maxesC.push_back({col[b],b});
            mxcol = col[b];
        } else if (col[b]==mxcol){
            maxesC.push_back({col[b],b});
        }
    }
    
    for (i=0; i<maxesR.size(); i++)
        sort(v[maxesR[i].second].begin(),v[maxesR[i].second].end());
    
    mx = 0;
    for (int i=0; i<maxesR.size(); i++){
        for (int j=0; j<maxesC.size(); j++){
            mx = max(mx, maxesR[i].first + maxesC[j].first - binary_search(v[maxesR[i].second].begin(),v[maxesR[i].second].end(),maxesC[j].second));
        }
    }
    
    cout << mx;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: no matching function for call to 'std::basic_istream<char>::tie(bool)'
   12 |     cin.tie(false);
      |     ~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/istream:40,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_ios.h:299:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie() const [with _CharT = char; _Traits = std::char_traits<char>]'
  299 |       tie() const
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:299:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_ios.h:311:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie(std::basic_ostream<_CharT, _Traits>*) [with _CharT = char; _Traits = std::char_traits<char>]'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:311:43: note:   no known conversion for argument 1 from 'bool' to 'std::basic_ostream<char>*'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<math.h>
#include<string.h>
#define rep(i,l,r) for(ll i=l;i<r;i++)

typedef long long ll;

ll max(ll x, ll y) { return (x > y) ? x : y; }


int main() {
    ll H,W,M,h[30001],w[300001],w;
    scanf("%lld%lld%lld", &H,&W,&M);
    ll a[300001], b[300001];
    rep(i, 0, M) {
        scanf("%lld%lld", &h, &w);
        a[h[i]]++, b[w[i]]++;
    }
    ll ansH = 0, ansW=0,x,y;
    rep(i, 0, H) {
        ansH = max(ansH, a[i]);

    }
    rep(i, 0, W) {
        ansW = max(ansW, a[i]);
    }
    ll flag = 0;
    rep(i, 0, M) {
        if (h[i] == ansH && w[i] == ansW) {
            flag--;
        }
    }

    printf("%lld", ansH+ansW+flag);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:33: error: conflicting types for 'w'; have 'll' {aka 'long long int'}
   14 |     ll H,W,M,h[30001],w[300001],w;
      |                                 ^
main.c:14:23: note: previous declaration of 'w' with type 'll[300001]' {aka 'long long int[300001]'}
   14 |     ll H,W,M,h[30001],w[300001],w;
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
  
int main() {
    int H,W,M;;
    cin >> H >> W >> M;
  
    vector<int>A(M);
    vector<int>B(M);
    for (int i = 0; i < M; i++) {
      cin >> A.at(i) >> B.at(i);
    }
  
  vector<int>countH(H,0);
  vector<int>counth(H,0);
   for (int i = 0; i < M; i++) {
       countH.at(A.at(i)-1)++; 
   }
  
  for (int i = 0; i < H; i++) {
    counth.at(i) = countH.at(i);
  }
  
   vector<int>countW(W,0);
  vector<int>countw(W,0);
   for (int i = 0; i < M; i++) {
       countW.at(B.at(i)-1)++;
   }
  
  for (int i = 0; i < W; i++) {
    countw.at(i) = countW.at(i);
  }
  
   sort(countH.begin(), countH.end());
   reverse(countH.begin(), countH.end());
   sort(countW.begin(), countW.end());
   reverse(countW.begin(), countW.end());

   int maxH = countH.at(0);
   int maxW = countW.at(0);
  
  long long count1 = 0;;
  for (int i = 0; i < H; i++) {
    if (counth.at(i) == maxH){
      count1++;
    }
  }
  long long count2 = 0;
  for (int i = 0; i < W; i++) {
    if (countw.at(i) == maxW){
      count2++;
    }
  }
  
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  
  long long judge = 0;
  
  for (int i = 0; i < M; i++) {
    if (counth.at(A.at(i)-1) == maxH && countw.at(B.at(i)-1) == maxW){
      judge++;
    }
  }
  
  if (judge < count1*count2){
    cout << maxH + maxW << endl;
  }
  else {
    cout << maxH + maxW - 1 << endl;
  }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:55:8: error: 'a' was not declared in this scope
   55 |   sort(a.begin(), a.end());
      |        ^
a.cc:56:8: error: 'b' was not declared in this scope
   56 |   sort(b.begin(), b.end());
      |        ^
Language: Java

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main5 

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			int M = sc.nextInt();
			int[] h = new int[H];
			int[] w = new int[W];
			Set<Integer> hset = new HashSet<>();
			Set<Integer> wset = new HashSet<>();
			Set<Point> pset = new HashSet<>();
			for (int i = 0; i < M; i++) {
				int tmph = sc.nextInt() - 1;
				int tmpw = sc.nextInt() - 1;
				h[tmph]++;
				w[tmpw]++;
				hset.add(tmph);
				wset.add(tmpw);
				pset.add(new Point(tmph, tmpw));
			}
			Set<Integer> hmax = new HashSet<>();
			Set<Integer> wmax = new HashSet<>();
			int maxh = 0;
			int maxw = 0;
			for (int hh : hset) {
				int tmp = h[hh];
				if (tmp > maxh) {
					hmax.clear();
					hmax.add(hh);
					maxh = tmp;
				} else if (tmp == maxh) {
					hmax.add(hh);
				}
			}
			for (int ww : wset) {
				int tmp = w[ww];
				if (tmp > maxw) {
					wmax.clear();
					wmax.add(ww);
					maxw = tmp;
				} else if (tmp == maxw) {
					hmax.add(ww);
				}
			}
			boolean flg = false;
			for (int hhh : hmax) {
				for (int www : wmax) {
					if (!pset.contains(new Point(hhh, www))) {
						flg = true;
					}
				}
			}
			if (flg) {
				System.out.println(maxh + maxw);
			} else {
				System.out.println(maxh + maxw - 1);
			}
		}
	}

	static class Point {
		int h;
		int w;

		public Point(int h, int w) {
			this.h = h;
			this.w = w;
		}

		@Override
		public boolean equals(Object o) {
			Point p = (Point) o;
			return this.h == p.h && this.w == p.w;
		}

		@Override
		public int hashCode() {
			int val = 31;
			val = 31 * val + h;
			val = 31 * val + w;
			return val;
		}
	}
}

Compiler output:
Main.java:5: error: '{' expected
public class Main5 
                  ^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:89: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define ff first
#define ss second
#define SZ(x) (long long)x.size()
#define endl '\n'
#define FAST                                                                   \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define tc                                                                     \
  int tc;                                                                      \
  cin >> tc;                                                                   \
  while (tc--)
#define REP(i, a, b) for (int i = a; i < b; i++)
#define REPO(i, b, a) for (int i = b - 1; i >= a; i--)
#define REPI(i, a, b) for (int i = a; i <= b; i++)
#define MOD 1000000007
bool comp(pair<int, int> v, int val) { return v.ff < val; }
inline int read() {
  int t = 0;
  char c;
  while ((c = getchar_unlocked()) != '\n' && c != ' ' && c != EOF) {
    t = t * 10 + c - 48;
  }
  return t;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
bool checkValidity(int a, int b, int c) {
  if (a + b <= c || a + c <= b || b + c <= a)
    return false;
  else
    return true;
}

int32_t main() {
  FAST;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("output.txt", "w", stderr);
#endif

  int h, w, m;
  cin >> h >> w >> m;
  REP(i, 0, h) { REP(j, 0, w) arr[i][j] = 0; }
  vector<int> rows(h);
  vector<int> cols(w);
  map<pair<int, int>, int> mp;
  REP(i, 0, m) {
    int k, n;
    cin >> k >> n;
    rows[k - 1] += 1;
    cols[n - 1] += 1;
    mp[{k, n}] = 1;
  }
  int ans = 0;
  REP(i, 0, h) {
    REP(j, 0, w) {
      if (mp[{i + 1, j + 1}])
        ans = max(ans, rows[i] + cols[j] - 1);
      else
        ans = max(ans, rows[i] + cols[j]);
    }
  }
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:59:31: error: 'arr' was not declared in this scope
   59 |   REP(i, 0, h) { REP(j, 0, w) arr[i][j] = 0; }
      |                               ^~~
Language: C++

#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define range(i,l,h) for(int i=l;i<h;i++)
#define endl '\n'
#define I INT_MAX
#define L INT_MIN
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vi vector<int>
using namespace std;
using std::ios;
constexpr int MOD=1e9+7;
constexpr int mod=998244353;

int main()
{
  ll h,w,m;
  cin>>h>>w>>m;
  vector<ll> r(h+1),c(w+1);
  map<pair<int,int>,int> mp;
  range(i,0,m)
  {
    int x,y;
    cin>>x>>y;
    r[x]++,c[y]++;
    mp[make_pair(x,y)]++;
  }
  
  ll mxr=0,mxc=0,ans=0;
  vector<ll> row,col;
 
  for(int rr=1;rr<=h;rr++)
    if(r[rr]>mxr)
    {
      mxr=r[rr];
      rid=rr;
    }

  for(int cc=1;cc<=w;cc++)
    if(c[cc]>mxc)
    {
      mxc=c[cc];
      cid=cc;
    }

  for(int rr=1;rr<=h;rr++)
    if(r[rr]==mxr)
     row.pb(rr);

  for(int cc=1;cc<=w;cc++)
    if(c[cc]==mxc)
      col.pb(cc);
    
  bool ok=false;
  int id=0;
  for(ll R:row)
  {
    for(ll C:col)
    {
      ll temp=mxc+mxr;
      if(mp[{R,C}])temp--;
    
      if(id>0&&temp>ans)
      {
        ans=temp;
        ok=1;
        break;
      }else if(id>0&&temp<ans)
      {
        ok=1;
        break;
      }
      id++;
    }
    if(ok)break;
  }
  cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:7: error: 'rid' was not declared in this scope
   37 |       rid=rr;
      |       ^~~
a.cc:44:7: error: 'cid' was not declared in this scope
   44 |       cid=cc;
      |       ^~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>

using std::cout;
using std::cin;
using std::endl;
using std::pow;
using std::vector;
using std::string;

long h[90000000001];
long w[90000000001];
long hi[30001];
long wi[30001];



int main(){
    long n,res=0,i,j,k,H,W,M,x,y,a=0,b=0;
    vector<long> numx,numy;
    cin >> H >> W >> M;
    for(i=0;i<M;i++){
        cin >> hi[i] >> wi[i];
        h[hi[i]]++;
        w[wi[i]]++;
    }
    for(i=0;i<=H;i++) if(a < h[i]) a = h[i];
    for(i=0;i<=W;i++) if(b < w[i]) b = w[i];
    
    for(i=0;i<=H;i++) if(a == h[i]) numx.push_back(i);
    for(i=0;i<=W;i++) if(b == w[i]) numy.push_back(i);

    for(i=0;i<numx.size();i++){
        for(j=0;j<numy.size();j++){
            x = numx.at(i);
            y = numy.at(j);
            long count=0;
            for(k=0;k<M;k++) if(hi[k] == x || wi[k] == y) count++;
            res = std::max(count,res);
        }
    }
    cout << res;
}


Compiler output:
/tmp/ccr6mc5d.o: in function `main':
a.cc:(.text+0x95): relocation truncated to fit: R_X86_64_PC32 against symbol `hi' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0xc0): relocation truncated to fit: R_X86_64_PC32 against symbol `wi' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0xe1): relocation truncated to fit: R_X86_64_PC32 against symbol `hi' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0x122): relocation truncated to fit: R_X86_64_PC32 against symbol `wi' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0x135): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0x14c): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0x1e5): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0x293): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0x348): relocation truncated to fit: R_X86_64_PC32 against symbol `hi' defined in .bss section in /tmp/ccr6mc5d.o
a.cc:(.text+0x365): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    int H, W, m; cin >> H >> W >> m;
    vint sum_h(H,0), sum_w(W,0);
    set<P> st;
    rep(i,m) {
        int h, w; cin >> h >> w;
        h--; w--;
        st.insert(P(h,w));
        sum_h[h]++;
        sum_w[w]++;
    }
    int mx_h = *max_element(all(sum_h));
    int mx_w = *max_element(all(sum_w));
    bool ok = false;
    rep(i,h)rep(j,w) {
        if (sum_h[i] == mx_h && sum_w[i] == mx_w) {
            if (!st.count(P(i,j))) ok = true;
        }
    }
    int ans = mx_h + mx_w;
    if (ok) cout << ans << endl;
    else cout << ans - 1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:11: error: 'h' was not declared in this scope
   37 |     rep(i,h)rep(j,w) {
      |           ^
a.cc:2:44: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i = 0; i < (int)(n); i++)
      |                                            ^
a.cc:37:19: error: 'w' was not declared in this scope
   37 |     rep(i,h)rep(j,w) {
      |                   ^
a.cc:2:44: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i = 0; i < (int)(n); i++)
      |                                            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);++i)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
  
const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
int ddx[5] = {2,1,0,-1,-2};
int ddy[5] = {2,1,0,-1,-2};
 
const int MAX=510000;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
   
  int h,w,m;
  cin >> h >> w >> m;
  vector<int>a(h),b(w);
  map<P,int>mp;
  rep(i,m){
    int y,x;
    cin >> y >> x;
    y--;
    x--;
    a[y]++;
    b[x]++;
    mp[P(y,x)]++;
  }
  int ymax = *max_element(a.begin(),a.end());
  int xmax = *max_element(b.begin(),b.end());
  
  int cnty = 0, cntx = 0;
  rep(i,h) if(a[i] == ymax)cnty++;
  rep(i,w) if(b[i] == xmax)cntx++;
  
  int num = cnty*cntx;
  for(auto p:mp){
    if(a[p.first] == ymax && b[p.second] == xmax )num--;
  }
  int ans = ymax + xmax;
  if(num==0) ans--;
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: no match for 'operator[]' (operand types are 'std::vector<int>' and 'const std::pair<long long int, long long int>')
   45 |     if(a[p.first] == ymax && b[p.second] == xmax )num--;
      |         ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note:   no known conversion for argument 1 from 'const std::pair<long long int, long long int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note:   no known conversion for argument 1 from 'const std::pair<long long int, long long int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(void)
{   
    int H, W, M;
    cin >> H >> W >> M;

    vector<int> s(H, 0);
    int hc[1000000]={};
    int wc[1000000]={};

    int h, w, hmax, wmax;
    int hmax=0, wmax=0;
    for(int i = 0; i < M; ++i){
        cin >> h >> w;
        s[h] = w;
        hc[h]++;
        wc[w]++;
        if(hmax < hc[h]) hmax = hc[h];
        if(wmax < wc[w]) wmax = hc[w];
    }

    long long ans = hmax + wmax;
    if(s[hmax] == wmax) ans--;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: redeclaration of 'int hmax'
   14 |     int hmax=0, wmax=0;
      |         ^~~~
a.cc:13:15: note: 'int hmax' previously declared here
   13 |     int h, w, hmax, wmax;
      |               ^~~~
a.cc:14:17: error: redeclaration of 'int wmax'
   14 |     int hmax=0, wmax=0;
      |                 ^~~~
a.cc:13:21: note: 'int wmax' previously declared here
   13 |     int h, w, hmax, wmax;
      |                     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll,ll>;

int main() {
  int h,w,m;
  cin >> h >> w >> m;
  vector<ll> hc(h),wc(w);
  vector<P> v;
  map<P,int> ma;
  ll hmax=0,wmax=0;
  rep(i,m){
      int x,y;
      cin >> x >> y;
      x--; y--;
      ma[make_pair(x,y)]=1;
      hc[x]++;wc[y]++;
      hmax=max(hmax,hc[x]);
      wmax=max(wmax,wc[y]);
  }
  vector<int> vh,vw;
  rep(i,h){
      if(hc[i]==hmax) vh.push_back(i);
  }
  rep(i,w){
      if(wc[i]==wmax) vw.push_back(i);
  }
  ll max=vh.size()*vw.size();
  if(max>m)
      cout << hmax+wmax << endl;
  }
  else{
      ll cnt=0;
      for(int x:vh)for(int y:vw){
          if(ma[make_pair(x,y)]==1) cnt++;
      }
      if(cnt==max) cout << hmax+wmax-1 << endl;
      else cout << hmax+wmax << endl;
  }
}


Compiler output:
a.cc:35:3: error: expected unqualified-id before 'else'
   35 |   else{
      |   ^~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll,ll>;

int main() {
  int h,w,m;
  cin >> h >> w >> m;
  vector<ll> hc(h),wc(w);
  vector<P> v;
  map<P,int> ma;
  ll hmax=0,wmax=0;
  rep(i,m){
      int x,y;
      cin >> x >> y;
      x--; y--;
      ma[make_pair(x,y)]=1;
      hc[x]++;wc[y]++;
      hmax=max(hmax,hc[x]);
      wmax=max(wmax,wc[y]);
  }
  vector<int> vh,vw;
  rep(i,h){
      if(hc[i]==hmax) vh.push_back(i);
  }
  rep(i,w){
      if(wc[i]==wmax) vw.push_back(i);
  }
  ll max=vh.size()*vw.size()
  if(max>m)
      cout << hmax+wmax << endl;
  }
  else{
      ll cnt=0;
      for(int x:vh)for(int y:vw){
          if(ma[make_pair(x,y)]==1) cnt++;
      }
      if(cnt==max) cout << hmax+wmax-1 << endl;
      else cout << hmax+wmax << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:3: error: expected ',' or ';' before 'if'
   32 |   if(max>m)
      |   ^~
a.cc: At global scope:
a.cc:35:3: error: expected unqualified-id before 'else'
   35 |   else{
      |   ^~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll,ll>;

int main() {
  ll h,w,m;
  cin >> h >> w >> m;
  vector<ll> hc(h),wc(w);
  vector<P> v;
  map<P,int> ma;
  ll hmax=0,wmax=0;
  rep(i,m){
      int x,y;
      cin >> x >> y;
      x--; y--;
      ma[make_pair(x,y)]=1;
      hc[x]++;wc[y]++;
      hmax=max(hmax,hc[x]);
      wmax=max(wmax,wc[y]);
  }
  vector<int> vh,vw;
  rep(i,h){
      if(hc[i]==hmax) vh.push_back(i);
  }
  rep(i,w){
      if(wc[i]==wmax) vw.push_back(i);
  }
  if(vh.size()*vw.size()>m)
      cout << hmax+wmax << endl;
  }
  else{
      ll cnt=0;
      for(int x:vh)for(int y:vw){
          if(ma[make_pair(x,y)]==1) cnt++;
      }
      if(cnt==vh.size()*vw.size()) cout << hmax+wmax-1 << endl;
      else cout << hmax+wmax << endl;
  }
}

Compiler output:
a.cc:34:3: error: expected unqualified-id before 'else'
   34 |   else{
      |   ^~~~
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cassert>
#include <queue>
#include <set>
#include <vector>
#include <cmath>
#include <bitset>
#include <functional>
#include <limits>
#include <map>
using namespace std;

typedef long long ll;
#define rep1(i, n) for(ll i = 1; i <=(ll)(n); i++)
#define rep0(i, n) for(ll i = 0; i <=(ll)(n); i++)

ll pow(ll a, ll n) { //compute a^n with o(logn)
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a;
        a = a * a;
        n >>= 1;
    }
    return res;
}

ll pow(ll a, ll n, ll mod) { //compute a^n (mod mod) with o(logn)
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

const int MAX = 199;
const int MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

//順列計算
ll PER(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[n - k] % MOD) % MOD;
}

int main(){
    ll h,w,m;
    cin >> h >> w >> m;
    vector<vector<int> > bom(h+1, vector<int>(w+1));
    ll h_cnt[h+1];
    ll w_cnt[w+1];
    rep0(i, h) h_cnt[i] = 0;
    rep0(i, w) w_cnt[i] = 0;
    ll max_h_idx = 0;
    ll max_w_idx = 0;
    ll max_h = 0;
    ll max_w = 0;
    rep1(i, m){
        ll x,y;
        cin >> x >> y;
        bom[x][y] = -1;
        h_cnt[x]++;
        w_cnt[y]++;
    }
    rep1(i, h){
        if(max_h < h_cnt[i]){
            max_h = h_cnt[i];
            max_h_idx = i;
        }
    }
    rep1(i, w){
        if(max_w < w_cnt[i]){
            max_w = w_cnt[i];
            max_w_idx = i;
        }
    }
    ll ans = 0;
    
    rep1(i, w){
        if(bom[max_h_idx][i] != -1){
            if(ans < max_h + w_cnt[i]){
                ans = max_h + w_cnt[i]
            }
        }else{
            if(ans < max_h + w_cnt[i] - 1){
                ans = max_h + w_cnt[i] - 1;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:106:39: error: expected ';' before '}' token
  106 |                 ans = max_h + w_cnt[i]
      |                                       ^
      |                                       ;
  107 |             }
      |             ~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    int h,w,m;
    cin>>h>>w>>m;
    vector<vector<int>> bakudan (m,vector<int>(2));
    for(int i=0;i<m;i++){
        cin>>bakudan.at(i).at(0)>>bakudan.at(i).at(1);
    }   //入力

    vector<vector<int>> basyo (h,vector<int>(w));
    for(int i=0;i<m;i++){
        basyo.at(bakudan(i).at(0)).at(bakudan.at(i).at(1))=100;
    }

    vector<int> gyo (h);
    for(int i=0;i<m;i++){
        gyo.at(bakudan.at(i).at(0))++;
    }
    vector<int> retu (w);
    for(int i=0;i<m;i++){
        retu.at(bakudan.at(i).at(1))++;
    }

    int ookiigyo=0;
    int ookiiretu=0;

    for(int i=0;i<h-1;i++){
        if(gyo.at(i)<gyo.at(i+1)){
            ookiigyo=i+1;
        }
    }
    for(int i=0;i<w-1;i++){
        if(retu.at(i)<retu.at(i+1)){
            ookiiretu=i+1;
        }
    }

    if(basyo.at(ookiigyo).at(ookiiretu)!=100){
        cout<<gyo.at(ookiigyo)<<endl;
    }
    else{
        cout<<1<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: no match for call to '(std::vector<std::vector<int> >) (int&)'
   14 |         basyo.at(bakudan(i).at(0)).at(bakudan.at(i).at(1))=100;
      |                  ~~~~~~~^~~
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>

using namespace std;

struct
{
	bool operator()(const pair<int, int>& p1,
		const pair<int, int>& p2)
	{
		return p1.second > p2.second;
	}
} compare;

int main()
{
	int h, w;
	cin >> h >> w;
	vector<pair<int, int>> rows;
	vector<pair<int, int>> columns;
	vector<vector<int>> field(h, vector<int>(w, 0));
	/*for (int i = 0; i < h; i++)
		rows.push_back({ i, 0 });
	for (int j = 0; j < w; j++)
		columns.push_back({ j, 0 });*/
	int m;
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		int hi, wi;
		cin >> hi >> wi;
		hi -= 1;
		wi -= 1;
		/*rows[hi].second++;
		columns[wi].second++;
		field[hi][wi] = 1;*/
	//}
	/*sort(rows.begin(), rows.end(), compare);
	sort(columns.begin(), columns.end(), compare);

	int max_row_val = rows[0].second;
	int max_col_val = columns[0].second;*/

	/*for (int i = 0; ((i < rows.size()) && (rows[i].second == max_row_val)); i++)
		for (int j = 0; ((j < columns.size()) && (columns[j].second == max_col_val)); j++)
		{
			if (field[rows[i].first][columns[j].first] == 0)
			{
				cout << max_row_val + max_col_val << endl;
				return 0;
			}
		}*/
	/*cout << max_row_val + max_col_val - 1 << endl;*/
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:2: error: expected '}' at end of input
   57 | }
      |  ^
a.cc:18:1: note: to match this '{'
   18 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0; i<n; i++)
int main()
{
	ll H,W,M,max_numH,max_numW,inpH,inpW,num_banH,num_banW;
	max_numH = 0;
	max_numW = 0;
	cin >> H >> W >> M;
	vector<ll> numH(H,0);
	vector<ll> numW(W,0);
	vector<ll> banH;
	vector<ll> banW;
	vector<vector<int>> A(H, vector<int>(W, 0));

	for(int i = 0, i<M; i++){
		cin >> inpH >> inpW;
		numH[inpH-1]++;
		numW[inpW-1]++;
		A[inpH-1][inpW-1] = 1;
	}
	for(int i = 0, i<H; i++){
		if(max_numH<numH[i]){
			max_numH = numH[i];
			banH.clear();
			banH.push_back(i);
		}
		else if(max_numH==numH[i]){
			banH.push_back(i);
		}
	}
	for(int i = 0, i<W; i++){
		if(max_numW<numW[i]){
			max_numW = numW[i];
			banW.clear();
			banW.push_back(i);
		}
		else if(max_numW==numW[i]){
			banW.push_back(i);
		}
	}
	int judge = 0;

	num_banH = banH.size();
	num_banW = banW.size();

//	cout << num_banH << " " << num_banW << " ";

	for(int i = 0; i<num_banH; i++){
		for(int j = 0; j<num_banW; j++){
			if(A[banH[i]][banW[j]]==0){
				judge++;
				break;
			}
		}
	}

//	cout << judge << " ";


	if(judge == 1)
		cout << max_numH + max_numW;
	else
		cout << max_numH + max_numW - 1;

	cin >> H;
	


	return 0;	
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: expected ';' before '<' token
   17 |         for(int i = 0, i<M; i++){
      |                         ^
      |                         ;
a.cc:17:25: error: expected primary-expression before '<' token
a.cc:23:25: error: expected ';' before '<' token
   23 |         for(int i = 0, i<H; i++){
      |                         ^
      |                         ;
a.cc:23:25: error: expected primary-expression before '<' token
a.cc:33:25: error: expected ';' before '<' token
   33 |         for(int i = 0, i<W; i++){
      |                         ^
      |                         ;
a.cc:33:25: error: expected primary-expression before '<' token
Language: C++

#include <bits/stdc++.h>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)

using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;
const ll Lmax=ll(1e18);
const ll INF=1e15+4;
const int Nmax=2e5+1;
const int Nd=61;

int main(){
  int h,w,m; cin>>h>>w>>m;
  int th,tw;
  vector<int>nh(h,0),nw(w,0);
  vector<P> b(m);
  int maxh=0,maxw=0;
  int n_maxh=0,n_maxw=0;

  ans=0;
  rep(i,m){
    cin>>th; cin>>tw;
    th--; tw--;
    b[i].first=th; b[i].second=tw;
    nh[th]++;
    nw[tw]++;    

    if(maxh<nh[th]) n_maxh=0;
    if(maxw<nw[tw]) n_maxw=0;
    if(maxh==nh[th]) n_maxh++;
    if(maxw==nw[tw]) n_maxw++;
    maxh=max(maxh,nh[th]);
    maxw=max(maxw,nw[tw]);
  }
  
  /*
  rep(i,h){
    if(nh[i]==maxh) n_maxh++;
  }
  rep(i,w){
    if(nw[i]==maxw) n_maxw++;
  }
  */

  ll count_b=0;
  rep(i,m){
    if(nh[b[i].first]+nw[b[i].second]==maxh+maxw){
      count_b++;
    }
  }

  if(count_b<ll(n_maxh*n_maxw)){
    cout<<maxh+maxw<<endl;
  }else{
    cout<<maxh+maxw-1<<endl;
  }


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   ans=0;
      |   ^~~
      |   abs
Language: C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long; 
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
//constexpr long long MOD = 998244353LL;
template<class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true;} return false; }
template<class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true;} return false; }
const ll INF = (ll)1e18 + 1;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    
    ll h,w,m; cin >> h >> w >> m;
    ll gyoretu[h][w] = 0;
    for(ll i=0; i<h; i++) for(ll j=0; j<w; j++) gyoretu[i][j] = 0;
    for(ll i=0; i<m; i++){
        ll a,b;
        cin >> a >> b;
        gyoretu[a-1][b-1] = 1;
    }

    // 最大の行を求める
    ll gyo=0;
    ll max_row = 0;
    for(ll i=0; i<h; i++){
        ll temp_max_row = 0;
        for(ll j=0; j<w; j++){
            if(gyoretu[i][j] == 1) temp_max_row++;
        }
        if(max_row < temp_max_row){
            max_row = temp_max_row;
            gyo = i;
        }
    }

    // 最大の列を求める
    ll retu=0;
    ll max_col = 0;    
    for(ll j=0; j<w; j++){
        ll temp_max_col = 0;
        for(ll i=0; i<h; i++){
            if(gyoretu[i][j] == 1 && i!=gyo ) temp_max_col++;
        }
        if(max_col < temp_max_col){
            max_col = temp_max_col;
            retu = j;
        }
    }
    
    // gyoretu[gyo][retu]が最大
    ll total = 0;
    for(ll j=0; j<w; j++){
        if(gyoretu[gyo][j]==1) total++;
    }
    for(ll i=0; i<h; i++){
        if(gyoretu[i][retu]==1 && gyo != i) total++;
    }
    
    cout << total << ln;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: array must be initialized with a brace-enclosed initializer
   22 |     ll gyoretu[h][w] = 0;
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define INF 0x7fffffff
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<ld> vld;

#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()

struct pair_hash
{
	template <class T1, class T2>
	std::size_t operator () (std::pair<T1, T2> const &pair) const
	{
		std::size_t h1 = std::hash<T1>()(pair.first);
		std::size_t h2 = std::hash<T2>()(pair.second);

		return h1 ^ h2;
	}
};


int main()
{
	fastIO;
	int H, W, m; cin >> H >> W >> m;
	int maxi = 0, maxj = 0;
	vi h(m), w(m), x, y;
	vi hor(300001,0), ver(300001,0);
	unordered_map<pair<int,int>,bool> m;

	for(int i = 0; i < m; i++) 
	{
		cin >> h[i] >> w[i];
		hor[h[i]]++; if(maxi < hor[h[i]]) maxi = hor[h[i]];
		ver[w[i]]++; if(maxj < ver[w[i]]) maxj = ver[w[i]];
		m[{h[i],w[i]}] = true;
	}

	for(int i = 1; i <= 300000; i++)
	{
		if(hor[i] == maxi) x.pb(i);
		if(ver[i] == maxj) y.pb(i);
	}

	int ans = maxi + maxj;

	for(int i = 0; i < x.size(); i++)
	{
		for(int j = 0; j < y.size(); j++)
			if(m[{x[i],y[j]}] == false)
			{
				cout << ans - 1 << endl;
				return 0;
			}
	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:43: error: conflicting declaration 'std::unordered_map<std::pair<int, int>, bool> m'
   46 |         unordered_map<pair<int,int>,bool> m;
      |                                           ^
a.cc:42:19: note: previous declaration as 'int m'
   42 |         int H, W, m; cin >> H >> W >> m;
      |                   ^
a.cc:53:18: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   53 |                 m[{h[i],w[i]}] = true;
      |                  ^
a.cc:67:29: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   67 |                         if(m[{x[i],y[j]}] == false)
      |                             ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <set>
using namespace std;
#define ll long long 

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	int H, W, M;
	cin >> H >> W >> M;
	
	vector<vector<int>> m(H, vector<int> (W, 0));
	
	for(int i = 0; i < M; i++)
	{
		int h, w;
		cin >> h >> w;
		h--; w--;
		
		for(int k = 0; k < W; k++)
			m[h][k]++;
		for(int l = 0; l < H; l++)
			m[l][w]++;
		m[h][w]--;
	}
	
	int mx = INT_MIN;
	for(int i = 0; i < H; i++)
		for(int j = 0; j < W; j++)
			mx = max(mx, m[i][j]);
		
	cout << mx << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: 'INT_MIN' was not declared in this scope
   32 |         int mx = INT_MIN;
      |                  ^~~~~~~
a.cc:7:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <set>
  +++ |+#include <climits>
    7 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define ff first
#define ss second
#define all(v) (v).begin(), (v).end()
#define mod (int)(998244353)
#define PI 3.14159265358979323846264338327950L
// ------------------ Debugging ------------------
#define trace(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout << endl; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << "[ " << *it << " = " << a << " ] ";
    err(++it, args...);
}
template <typename Tk, typename Tv> ostream& operator<<(ostream& os, const pair<Tk, Tv> &p){os << "{" << p.first << ',' << p.second << "}";return os;}
template <typename T> ostream& operator<<(ostream& os, const vector<T> &p){os << "[ "; for (T x: p) os << x << " "; os << "]" << endl; return os;}
template <typename T> ostream& operator<<(ostream& os, const set<T> &p){os << "{ "; for (T x: p) os << x << " "; os << "}" << endl; return os;}
template <typename Tk, typename Tv> ostream& operator<<(ostream& os, const map<Tk, Tv> &p){os << "{ "; for (pair<Tk, Tv> x: p) os << x << " "; os << "}" << endl; return os;}
// -----------------------------------------------

signed main(){

    fastIO

    int n, m, k;
    cin >> n >> m >> k;
    set< pair<int, int> > v, con;
    for (int i = 0; i < k; i++) {
    	int a, b;
    	cin >> a >> b;
    	--a;
    	--b;
    	v.insert({a, b});
    }
    int ans = 0;
    for (auto it : v) {
    	int x = it.ff, y = it.ss;
    	if (con.find({x, y}) != con.end()) {
    		continue;
    	}
    	ans++;
    	for (int i = 0; i < 4; i++) {
    		int _x = x + dx[i];
    		int _y = y + dy[i];
    		while (_x >= 0 && _y >= 0 && _y < m && _x < n) {
    			if (v.find({_x, _y}) != v.end()) {
    				con.insert({_x, _y});
    			} else {
    				break;
    			}
    			_x += dx[i];
    			_y += dy[i];
    		}
    	}
    	con.insert({x, y});
    	// cout << "v: ";
    	// cout << v;
    	// cout << "con: " << con;
    }
	cout << ans << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:30: error: 'dx' was not declared in this scope; did you mean '_x'?
   48 |                 int _x = x + dx[i];
      |                              ^~
      |                              _x
a.cc:49:30: error: 'dy' was not declared in this scope; did you mean '_y'?
   49 |                 int _y = y + dy[i];
      |                              ^~
      |                              _y