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

#include <bits/stdc++.h>
#define INF 2e9
#define MOD 1000000007
#define MOD9 998244353
#define intMAX 51000;
#define PI 3.14159265359
using namespace std;
typedef long long llong;
typedef long double ldouble;

using Graph = vector<vector<int>>;

int main(){
  typedef pair<int, int> pair;
  int H, W, M;
  cin >> H >> W >> M;
  map<pair, bool> exist;
  vector<int> Hnum(H, 0);
  vector<int> Wnum(W, 0);
  for(int l=0; l<M; ++l) {
    int h, w;
    cin >> h >> w;
    --h; --w;
    exist[{h, w}] = true;
    ++Hnum[h]; ++Wnum[w];
  }
  vector<pair> Hpair;
  for(int i=0; i<H; ++i) Hpair.push_back(pair(Hnum[i], i));
  delete Hnum;
  vector<pair> Wpair;
  for(int i=0; i<W; ++i) Wpair.push_back(pair(Wnum[i], i));
  delete Wnum;
  sort(Hpair.rbegin(), Hpair.rend());
  sort(Wpair.rbegin(), Wpair.rend());
  int Hmax = 0;
  int Wmax = 0;
  for(int i=0; i<H; ++i){
    if(i==0) Hmax = Hpair[i].first;
    if(Hmax != Hpair[i].first) break;
    else{
      for(int j=0; j<W; ++j){
        if(j==0) Wmax = Wpair[j].first;
        if(Wmax != Wpair[j].first) break;
        else{
          if(exist[{Hpair[i].second, Wpair[j].second}]){
            cout << Hmax + Wmax << endl;
            return 0;
          }
        }
      }
    }
  }
  cout << Hmax + Wmax - 1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:10: error: type 'class std::vector<int>' argument given to 'delete', expected pointer
   29 |   delete Hnum;
      |          ^~~~
a.cc:32:10: error: type 'class std::vector<int>' argument given to 'delete', expected pointer
   32 |   delete Wnum;
      |          ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int H,W,M;
  cin>>H>>W>>M;
  vector<int> r(H+1,0);
  vector<int> c(W+1,0);
  long long int maxr=0,maxc=0;
  vector<vector<int> > A(H+1,vector<int>(W+1,0));
  for(int i=0;i<M;i++){
    	int row,column;
    	cin>>row;
    	cin>>column;
    	A[row][column]=1;
    	r[row]++;
    	if(r[row]>maxr)	{
          maxr=r[row];
        }
    	c[column]++;
    	if(c[column]>maxc)	{
          maxc=c[column];
        }
    }
  	vector<int> a,b;
  	for(int i=1;i<=H;i++){
      if(r[i]==maxr){
        a.push_back(i);
      }
    }
  	for(int j=1;j<=W;j++){
      if(c[j]==maxc){
        b.push_back(j);
      }
    }
  	int ans;
  	for(int i=0;i<a.size();i++){
      for(int j=0;j<b.size();j++){
        if(A[a[i]b[j]])	ans=maxr+maxc-1;
      	else{
          ans=maxr+maxc;
          break;
        }
      }
    }
     cout<<ans;
  } 

Compiler output:
a.cc: In function 'int main()':
a.cc:38:18: error: expected ']' before 'b'
   38 |         if(A[a[i]b[j]]) ans=maxr+maxc-1;
      |                  ^
      |                  ]
a.cc:38:18: error: expected ')' before 'b'
   38 |         if(A[a[i]b[j]]) ans=maxr+maxc-1;
      |           ~      ^
      |                  )
a.cc:38:21: error: could not convert 'A.std::vector<std::vector<int> >::operator[](((std::vector<std::vector<int> >::size_type)a.std::vector<int>::operator[](((std::vector<int>::size_type)i))))' from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'bool'
   38 |         if(A[a[i]b[j]]) ans=maxr+maxc-1;
      |                     ^
      |                     |
      |                     __gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}
a.cc:38:22: error: expected primary-expression before ']' token
   38 |         if(A[a[i]b[j]]) ans=maxr+maxc-1;
      |                      ^
Language: Java

import java.io.*;
import java.util.*;

public class e {
    public static void main(final String[] args) {
        final FastReader s=new FastReader();
        int h = s.nextInt();
        int w = s.nextInt();
        int m = s.nextInt();
        
        Map<Integer, Integer> xc = new HashMap<Integer, Integer>();
        Map<Integer, Integer> yc = new HashMap<Integer, Integer>();
        // Set<String> b = new HashSet<>();
        int mx = 0;
        int my = 0;
        // boolean[][] b = new boolean[h][w];
        Map<Integer, Set<Integer>> b =  new HashMap<>();

        for(int i=0; i<m; i++) {
            int x = s.nextInt();
            int y = s.nextInt();
            if(!xc.containsKey(x)) xc.put(x, 0);
            if(!yc.containsKey(y)) yc.put(y, 0);
            xc.put(x, xc.get(x)+1);
            mx = Math.max(mx, xc.get(x));
            yc.put(y, yc.get(y)+1);
            my = Math.max(my, yc.get(y));
            // if(mx==xc.get(x) || my==yc.get(y))
            // b.add(getString(x, y));
            // b[x-1][y-1] = true;
            if(mx==xc.get(x) || my==yc.get(y)) {
                if(!b.containsKey(x)) b.put(x, new HashSet<>());
                b.get(x).add(y);
            }
        }


       
        for(int x : xc.keySet()) {
            if(xc.get(x)<mx) continue;
            for(int y : yc.keySet()) {
                if(yc.get(y)<my) continue;
                if(!b.containsKey(x) || !b.get(x).contains(y)) {
                    System.out.println(mx+my);
                    return;
                }                
            }
        }
        System.out.println(mx+my-1);
    }

    // private static String getString(int x, int y) {
    //     return Integer.toString(x) + "." + Integer.toString(y);
    // }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try { st = new StringTokenizer(br.readLine()); }
                catch (final IOException  e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() { return Long.parseLong(next()); }
        double nextDouble() { return Double.parseDouble(next()); }
        String nextLine() {
            String str = "";
            try { str = br.readLine(); }
            catch (final IOException e) { e.printStackTrace(); }
            return str;
        }
    }
}

Compiler output:
Main.java:4: error: class e is public, should be declared in a file named e.java
public class e {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include<math.h>
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main()
{
    int64_t H, W, M;
    cin >> H >> W >> M;
    map<int64_t, int64_t>H_count;
    map<int64_t, int64_t>W_count;
    vector<vector<bool>>vec(H+1, vector<bool>(W+1));
    for (int64_t i=0; i<M; i++) {
        int64_t h, w;
        cin >> h >> w;
        vec[h][w] = true;
        if (H_count.count(h) > 0) {
            H_count[h] = H_count[h] + 1;
        } else {
            H_count[h] = 1;
        }

        if (W_count.count(w) > 0) {
            W_count[w] = W_count[w] + 1;
        } else {
            W_count[w] = 1;
        }
    }

    int64_t max_ = INT64_MIN;
    for (int64_t i=1; i<=H; i++) {
        for (int64_t j=1; j<=W; j++) {
            int64_t bakuhakanou = H_count[i] + W_count[j];
            if (vec[h][w]) {
                bakuhakanou -= 1;
            }

            if (bakuhakanou > max_) {
                max_ = bakuhakanou;
            }
        }
    }

    cout << max_ << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: 'h' was not declared in this scope
   35 |             if (vec[h][w]) {
      |                     ^
a.cc:35:24: error: 'w' was not declared in this scope
   35 |             if (vec[h][w]) {
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int H,W,M;
  cin>>H>>W>>M;
  vector<int> r(H+1,0);
  vector<int> c(W+1,0);
  long long int maxr=0,maxc=0,R,C;
  vector<vector<int> > A(H+1,vector<int>(W+1,0));
  for(int i=0;i<M;i++){
    	int row,column;
    	cin>>row;
    	cin>>column;
    	A[row][column]=1;
    	r[row]++;
    	if(r[row]>maxr)	{
          maxr=r[row];
          R=row;
        }
    	c[column]++;
    	if(c[column]>maxc)	{
          maxc=c[column];
          C=column;
        }
    }
  	vector<int> a,b;
  	for(int i=1;i<=H;i++){
      if(r[i]==maxr){
        a.push_back(i);
      }
    }
  	for(int j=1;j<=W;j++){
      if(c[j]==maxc){
        b.push_back(j);
      }
    }
  	int ans;
  	for(int i=0;i<a.size();i++){
      for(int j=0;j<b.size();j++){
        if(A[a[i]][b[j]])	ans=maxr+maxc-1;
      	else{
          ans=maxr+maxc;
          break;
        }
    }
     cout<<ans;
  } 

Compiler output:
a.cc: In function 'int main()':
a.cc:47:4: error: expected '}' at end of input
   47 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

int main(){
    int h,w,m;cin>>h>>w>>m;
    vector<int> kaburi[w];
    int A[h],B[w];
    rep(i,h)A[i]=0;
    rep(i,w)B[i]=0;
    rep(i,m){
        int a,b;
        cin>>a>>b;
        a--;b--;
        A[a]++;B[b]++;
        kaburi[b].__emplace_back(a);
    }
    rep(i,w)sort(kaburi[i].begin(),kaburi[i].end());
    int max1,max2;
    max1=0;max2=0;
    rep(i,h){
        if(max1<A[i]){
            max1=A[i];
        }
    }
    vector<int> candidate;
    rep(i,h){
        if(A[i]==max1)candidate.__emplace_back(i);
    }
    rep(i,w){
        if(max2<B[i])max2=B[i];
    }
    int dou=1;
    rep(i,w){
        if(B[i]==max2){
            rep(j,candidate.size()){
                int sj=candidate[j];
                int l=kaburi[i].size();
                int left=0,right=l,mid;
                int ans=0;
                while(left<right){
                    mid=(left+right)/2;
                    if(kaburi[i][mid]==sj){ans=1;break;}
                    else if(kaburi[i][mid]>sj)right=mid;
                    else left=mid+1;
                }
                if(ans==0)dou=0;
            }
            if(dou==0)break;
        }
    }
    if(dou!=0)max1--;
    cout<<max1<<max2<<endl;
    cout<<max1+max2<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: 'class std::vector<int>' has no member named '__emplace_back'; did you mean 'emplace_back'?
   17 |         kaburi[b].__emplace_back(a);
      |                   ^~~~~~~~~~~~~~
      |                   emplace_back
a.cc:29:33: error: 'class std::vector<int>' has no member named '__emplace_back'; did you mean 'emplace_back'?
   29 |         if(A[i]==max1)candidate.__emplace_back(i);
      |                                 ^~~~~~~~~~~~~~
      |                                 emplace_back
Language: C++

//




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


#define spdio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pp pop_back()
#define pf push_front
#define ppf pop_front()
#define ff first
#define ss second
#define mp make_pair
#define fr(i,j,n) for(ll i=j; i<n; i++)
#define rfr(i,j,n) for(ll i=n-1; i>=j; i--)
#define pll pair<ll,ll>
#define plb pair<ll,bool>
#define psl pair<string,ll>
#define psb pair<string,bool>
#define srt(v) sort((v).begin(),(v).end())
#define ub(v,val) upper_bound((v).begin(),(v).end(),(val))-(v).begin()
#define lb(v,val) lower_bound((v).begin(),(v).end(),(val))-(v).begin()


typedef long double ld;
typedef long long int ll;


//getline(cin,string);
const ll inf = (ll) 1e18 + 19;
const ll mod = (ll) 1e9  +  7;




ll ncr(ll n,ll r) {
    ll val=1,i,j,p=2;
    rfr(i,n-r+1,n+1) {
        val*=i;
        while(val%p==0 && p<=r) {
            val/=p;
            p+=1;
        }
    }
    if(p<r) {
        fr(i,p,r+1) val/=i;
    }
    return val;
}




void cazz() {
    ll t=1,i=0,j,n;
    //cin>>t;
    while(t--) {
        ll m,q;
        cin>>n>>m>>q;
        ll a,b,mxr=0,mxc=0,cntr=0,cntc=0;
        map <ll,vector <ll> > mpp1,mpp2;
        map <pll,bool> mpp3;
        ll yup;
        while(q--) {
            cin>>a>>b;
            mpp1[a].pb(b);
            mpp2[b].pb(a);
            mpp3[{a,b}]=true;
            if(mxr==mpp1[a].size()) cntr+=1;
            if(mxc==mpp2[b].size()) cntc+=1;
            if(mxr<mpp1[a].size()) {
                mxr=mpp1[a].size();
                cntr=1;
                yup=a;
            }
            if(mxc<mpp2[b].size()) {
                mxc=mpp2[b].size();
                cntc=1;
            }
        }
        ll ans=mxr+mxc-1;
        for(i=0; i<mpp1[yup].size(); i++) {
            b=mpp1[yup][i];
            if(mpp2[b].size()==mxc) cntc-=1;
            if(cntc<0) break;
        }
        if(cntc>=) ans+=1;
        cout<<ans<<"\n";
    }
}




int main() {
    spdio;
	cazz();
	return 0;
}


Compiler output:
a.cc: In function 'void cazz()':
a.cc:91:18: error: expected primary-expression before ')' token
   91 |         if(cntc>=) ans+=1;
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int H,W,M;
  cin>>H>>W>>M;
  vector<int> r(H+1,0);
  vector<int> c(W+1,0);
  long long int maxr=0,maxc=0,R,C;
  vector<vector<int> > A(H+1,vector<int>(W+1,0));
  for(int i=0;i<M;i++){
    	int row,column;
    	cin>>row;
    	cin>>column;
    	A[row][column]=1;
    	r[row]++;
    	if(r[row]>maxr)	{
          maxr=r[row];
          R=row;
        }
    	c[column]++;
    	if(c[column]>maxc)	{
          maxc=c[column];
          C=column;
        }
    }
  	vector<int> a,b;
  	for(int i=1;i<=H;i++){
      if(r[i]==maxr){
        a.push_back(i);
      }
    }
  	for(int j=1;i<=W;i++){
      if(c[j]==maxc){
        b.push_back(j);
      }
    }
  	int ans;
  	for(int i=0;i<a.size();i++){
      for(int j=0;j<b.size();j++){
        if(A[a[i]b[j]])	ans=maxr+maxc-1;
      	else{
          ans=maxr+maxc;
          break;
        }
    }
     cout<<ans;
  } 

Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: 'i' was not declared in this scope
   32 |         for(int j=1;i<=W;i++){
      |                     ^
a.cc:40:18: error: expected ']' before 'b'
   40 |         if(A[a[i]b[j]]) ans=maxr+maxc-1;
      |                  ^
      |                  ]
a.cc:40:18: error: expected ')' before 'b'
   40 |         if(A[a[i]b[j]]) ans=maxr+maxc-1;
      |           ~      ^
      |                  )
a.cc:40:21: error: could not convert 'A.std::vector<std::vector<int> >::operator[](((std::vector<std::vector<int> >::size_type)a.std::vector<int>::operator[](((std::vector<int>::size_type)i))))' from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'bool'
   40 |         if(A[a[i]b[j]]) ans=maxr+maxc-1;
      |                     ^
      |                     |
      |                     __gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}
a.cc:40:22: error: expected primary-expression before ']' token
   40 |         if(A[a[i]b[j]]) ans=maxr+maxc-1;
      |                      ^
a.cc:47:4: error: expected '}' at end of input
   47 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

    int hc[1000000]={};
    int wc[1000000]={};

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

    sort(hc,hc+H, greater<int>() );
    sort(wc,wc + W,greater<int>() );

    long long ans = wc[0] + hc[0];
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> H >> W >> M;
      |     ^~~
a.cc:16:19: error: 'greater' was not declared in this scope
   16 |     sort(hc,hc+H, greater<int>() );
      |                   ^~~~~~~
a.cc:16:27: error: expected primary-expression before 'int'
   16 |     sort(hc,hc+H, greater<int>() );
      |                           ^~~
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |     sort(hc,hc+H, greater<int>() );
      |     ^~~~
      |     short
a.cc:17:28: error: expected primary-expression before 'int'
   17 |     sort(wc,wc + W,greater<int>() );
      |                            ^~~
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << ans << endl;
      |     ^~~~
a.cc:20:20: error: 'endl' was not declared in this scope
   20 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
 {
	//code
  	long long int n,m,q;
  	cin>>n>>m>>q;
  	map<long long int,long long int> mx;
  	map<long long int,long long int> my;
  	map<pair<long long int,long long int>,bool> bombs;
  int max_x=0,max_y=0,a,b;
  	while(q--){
  	    long long int h,w;
  	    cin>>h>>w;
  	    bombs[{h,w}]=true;
  	    mx[h]++;
      if(mx[h]>max_x){ max_x=mx[h]; a=h;}
      
  	    my[w]++;
      if(my[w]>max_y){ max_y=my[w]; b=w;}
  	}
  ans=max_x+max_y;
  if(bombs[{a,b}]){
              ans--;
            }
  
  	cout<<ans;
    return 0;
}


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

/*Author : Harsh AKA Codula*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inp freopen("input.txt","r",stdin)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
 
//main class

class Solution
{
	public:
		void run()
		{
			ll t=1;//cin>>t;
			while(t--)
			{
				ll ans=0;
				ll ans2=0;
				ll r,c,t;
				cin>>r>>c>>t;
				vector<pair<ll,ll>> dp(t,pair<ll,ll>(0,0));
				map<ll,ll> mp;
				for(ll i=0;i<t;++i)
				{
					cin>>dp[i].first>>dp[i].second;
					mp[dp[i].first]++;
					mp[dp[i].second]++;
				}
				for(ll i=0;i<t;i++)
				{
					ll ans=0;
					if(mp[dp[i].first]>1)
					{
						ans+=mp[dp[i].first];
						if(mp[dp[i].second>1])
						{
							ans+=mp[dp[i].second];
						}
						ans2=max(ans2,ans);
					}
					
					}
				}
				cout<<ans2;
				cout<<"\n";
			}
		}	
};
//driver func

int main()
{
	//fast;
	//inp;
	Solution MAIN1;
	MAIN1.run();
	return 0;
}


Compiler output:
a.cc:49:24: error: expected ';' after class definition
   49 |                 }
      |                  ^      
      |                        ;
a.cc: In member function 'void Solution::run()':
a.cc:46:39: error: 'ans2' was not declared in this scope
   46 |                                 cout<<ans2;
      |                                       ^~~~
a.cc: At global scope:
a.cc:50:1: error: expected declaration before '}' token
   50 | };
      | ^
Language: C++

#include <bits/stdc++.h>
#define INF 2e9
#define MOD 1000000007
#define MOD9 998244353
#define intMAX 51000;
#define PI 3.14159265359
using namespace std;
typedef long long llong;
typedef long double ldouble;

using Graph = vector<vector<int>>;

int main(){
  int H, W, M;
  cin >> H >> W >> M;
  vector<vector<bool>> exist(H, vector<bool> (W, false));
  vector<int> Hnum(H, 0);
  vector<int> Wnum(W, 0);
  for(int l=0; l<M; ++l) {
    int h, w;
    cin >> h >> w;
    --h; --w;
    exist[h][w] = true;
    ++Hnum[h]; ++Wnum[w];
  }
  typedef pair<int, int> pair;
  vector<pair> Hpair;
  for(int i=0; i<H; ++i) Hpair.push_back(pair(Hnum[i], i));
  delete Hnum;
  vector<pair> Wpair;
  for(int i=0; i<W; ++i) Wpair.push_back(pair(Wnum[i], i));
  delete Wnum;
  sort(Hpair.rbegin(), Hpair.rend());
  sort(Wpair.rbegin(), Wpair.rend());
  int Hmax = 0;
  int Wmax = 0;
  for(int i=0; i<H; ++i){
    if(i==0) Hmax = Hpair[i].first;
    if(Hmax != Hpair[i].first) break;
    else{
      for(int j=0; j<W; ++j){
        if(j==0) Wmax = Wpair[j].first;
        if(Wmax != Wpair[j].first) break;
        else{
          if(exist[Hpair[i].second][Wpair[j].second]){
            cout << Hmax + Wmax << endl;
            return 0;
          }
        }
      }
    }
  }
  cout << Hmax + Wmax - 1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:10: error: type 'class std::vector<int>' argument given to 'delete', expected pointer
   29 |   delete Hnum;
      |          ^~~~
a.cc:32:10: error: type 'class std::vector<int>' argument given to 'delete', expected pointer
   32 |   delete Wnum;
      |          ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long;

template <typename T>
void print_vec(const vector<T>& v, bool is_reverse=false, ll num=0){
  if(num == 0) num = (ll)v.size();
  if(is_reverse) for(ll i=num-1; i>=0; i--){ cout<<v[i]; if(i!=0) cout<<" ";}
  else for(ll i=0; i<num; i++){ cout<<v[i]; if(i!=num-1) cout<<" ";}
  cout << endl;
}

template <typename T>
void print_pairvec(const vector<T> &v, ll num=0){
  if(num == 0) num = (ll)v.size();
  cout << endl;
  for(ll i=0; i<num; i++){ cout << v[i].first << " " << v[i].second << endl;}
}

template <typename T>
void print_vec2(const vector<vector<T>>& v){
  cout << endl; cout << "       ";
  for(ll i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(ll i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(ll j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}
  const ll ADD = 0;
vector<vector<bool>> is_bomb(H+ADD, vector<bool>(W+ADD, false));
  vector<ll> num_h(H+ADD, 0), num_w(W+ADD, 0);
vector<ll> maxs_h, maxs_w;
ll h_num_max = 0, w_num_max = 0;
using P = pair<ll, ll>;
using LP = pair<ll, P>;
int main(){
  ll H, W;
  cin >> H >> W;
  ll M;
  cin >> M;


  
  for(ll i=0; i<M; i++){
    ll h, w;
    cin >> h >> w;
    h--; w--;
    is_bomb[h][w] = true;
    num_h[h]++;
    num_w[w]++;
  }

  
  
  // for(ll i=0; i<H; i++){
  //   if(h_num_max < num_h[i]){
  //     h_num_max = num_h[i];
  //   }
  // }
  // for(ll i=0; i<W; i++){
  //   if(w_num_max < num_w[i]){
  //     w_num_max = num_w[i];
  //   }
  // }
  for(ll i=0; i<H; i++) h_num_max = max(h_num_max, num_h[i]);
  for(ll i=0; i<W; i++) w_num_max = max(w_num_max, num_w[i]);

  
  for(ll i=0; i<H; i++) if(num_h[i] == h_num_max) maxs_h.push_back(i);
  for(ll i=0; i<W; i++) if(num_w[i] == w_num_max) maxs_w.push_back(i);

//  cout << " num_h : "  ; print_vec(num_h);
//   cout << " num_w : "  ; print_vec(num_w);
//   cout << " maxs_h : "  ; print_vec(maxs_h);
//   cout << " maxs_w : "  ; print_vec(maxs_w);
  ll ans = 0;
  for(ll i=0; i<(ll)maxs_h.size(); i++){
    for(ll j=0; j<(ll)maxs_w.size(); j++){
        ll tmp = num_h[maxs_h[i]] + num_w[maxs_w[j]];
        if(is_bomb[maxs_h[i]][maxs_w[j]] == true) tmp--;
        else{
          cout << tmp << endl;
          return 0;
        }
        ans = max(ans, tmp);
    }
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc:35:30: error: 'H' was not declared in this scope
   35 | vector<vector<bool>> is_bomb(H+ADD, vector<bool>(W+ADD, false));
      |                              ^
a.cc:35:50: error: 'W' was not declared in this scope
   35 | vector<vector<bool>> is_bomb(H+ADD, vector<bool>(W+ADD, false));
      |                                                  ^
a.cc:36:20: error: 'H' was not declared in this scope
   36 |   vector<ll> num_h(H+ADD, 0), num_w(W+ADD, 0);
      |                    ^
a.cc:36:37: error: 'W' was not declared in this scope
   36 |   vector<ll> num_h(H+ADD, 0), num_w(W+ADD, 0);
      |                                     ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n)   for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(long long i=(a);((a)<(b)?i<=(b):i>=(b));((a)<(b)?++i:--i))
#define ALL(v)     (v).begin(),(v).end()
#define debug(x)   cerr<<#x<<": "<<(x)<<endl
using namespace std;
using llong = long long;
using vi    = vector<int>;
using vvi   = vector<vi >;
using vvvi  = vector<vvi >;
using pii   = pair<int,int>;
constexpr int    INF=1e9;
constexpr double EPS=1e-9;
constexpr int    MOD=1e9+7;
template<class Type>
void line(const Type &a){int cnt=0;for(const auto &elem:a){cerr<<(cnt++?' ':'>');cerr<<elem;}cerr<<endl;}

template<class Type_a,class Type_b> inline bool chmax(Type_a &a,const Type_b &b){if(a<b){a=b;return true;}return false;}
template<class Type_a,class Type_b> inline bool chmin(Type_a &a,const Type_b &b){if(a>b){a=b;return true;}return false;}

int main(){
	int h,w,m;
	cin>>h>>w>>m;
	
	map<pii,int> mp;
	vi cnt(h,0),cntt(w,0);
	REP(i,m){
		int y,x;
		cin>>y>>x;
		y--,x--;
		
		mp[pii(y,x)]=1;
		cnt[y]++;
		cntt[x]++;
	}
	line(cnt);
	line(cntt);
	
	vector<pii > yy(h),xx(w);
	REP(i,h) yy[i]=pii(cnt[i],i);
	REP(i,w) xx[i]=pii(cntt[i],i);
	sort(ALL(yy),greater<pii >());
	sort(ALL(xx),greater<pii >());
	
	int ans=-INF;
	REP(i,h) chmax(ans,xx[0].first+yy[i].first-mp[pii(i,xx.second)]);
	REP(i,w) chmax(ans,yy[0].first+xx[i].first-mp[pii(yy.second,i)]);
	
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:64: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   46 |         REP(i,h) chmax(ans,xx[0].first+yy[i].first-mp[pii(i,xx.second)]);
      |                                                                ^~~~~~
a.cc:47:62: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   47 |         REP(i,w) chmax(ans,yy[0].first+xx[i].first-mp[pii(yy.second,i)]);
      |                                                              ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
 {
	//code
  	long long int n,m,q;
  	cin>>n>>m>>q;
  	map<long long int,long long int> mx;
  	map<long long int,long long int> my;
  	map<pair<long long int,long long int>,bool> bombs;
  int max_x=0,max_y=0,a,b;
  	while(q--){
  	    long long int h,w;
  	    cin>>h>>w;
  	    bombs[{h,w}]=true;
  	    mx[h]++;
      if(mx[h]>max_x){ max_h=mx[h]; a=h;}
      
  	    my[w]++;
      if(my[w]>max_y){ max_y=my[w]; b=w;}
  	}
  ans=max_x+max_y;
  if(bombs[{a,b}]){
              ans--;
            }
  
  	cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: 'max_h' was not declared in this scope; did you mean 'max_y'?
   17 |       if(mx[h]>max_x){ max_h=mx[h]; a=h;}
      |                        ^~~~~
      |                        max_y
a.cc:22:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |   ans=max_x+max_y;
      |   ^~~
      |   abs
Language: C++

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


int main() {
int64_t h,w,m;
  cin>>h>>w>>m;
   vector<vector<int64_t>> data(m, vector<int64_t>(2));
  
  
  
  //vector<vector<int>> data(3, vector<int>(4));
 
  
  
  
  for(int64_t i=0;i<m;i++){
  cin>>data.at(i).at(0)>>data.at(i).at(1);
  }
  vector<int64_t> one(h);
  vector<int64_t> two(w);
  for(int64_t i=0;i<m;i++){
  one.at(data.at(i).at(0)-1)++;
  }
  for(int64_t i=0;i<m;i++){
  two.at(data.at(i).at(1)-1)++;
  }
   vector<int64_t> oc(m);
  vector<int64_t> tc(m);
  for(int64_t i=0;i<m;i++){
  oc.at(i)=data.at(i).at(0);
  }
   for(int64_t i=0;i<m;i++){
  tc.at(i)=data.at(i).at(1);
  }
   sort(oc.begin(), oc.end());
   sort(tc.begin(), tc.end());
  int64_t aq=oc.at(m-1);
   int64_t bq=tc.at(m-1);
  vector<int64_t> os;
  vector<int64_t> ts;
  for(int64_t i=0;i<m;i++){
  if(aq==data.at(i).at(0)){os.push_back(i); }
  }
  for(int64_t i=0;i<m;i++){
  if(bq==data.at(i).at(1)){ts.push_back(i); }
  }
  int64_t o=os.size();
  int64_t t=ts.size();
  sort(os.begin(), os.end());
  sort(ts.begin(), ts.end());
  int64_t qq;
  for(int64_t i=0;i<m;i++){
int64_t x=data.at(i).at(0);
int64_t b=o;
  int64_t ans1=0;
   int64_t n=b;
  int64_t lb=-1, ub=n;
  while(ub-lb>1){
  int64_t mid=(lb+ub)/2;
    if(os[mid]==x)
    {ans1=1;
    break;}
    if(os[mid]>x)
    {ub=mid;}
     if(os[mid]<x)
    {lb=mid;}
  }

int64_t xw=data.at(i).at(1);
int64_t bw=t;
  int64_t ans2=0;
   int64_t nw=b;
  int64_t lbw=-1, ubw=n;
  while(ubw-lbw>1){
  int64_t midw=(lbw+ubw)/2;
    if(ts[midw]==x)
    {ans2=1;
    break;}
    if(ts[midw]>x)
    {ubw=midw;}
     if(ts[midw]<x)
    {lbw=midw;}
  }
   if((ans1==1)&&(ans2==1)){qq++;}
  }
  if(qq==o*t){cout<<a+b-1<<endl;}
  else{cout<<aq+bq<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:21: error: 'a' was not declared in this scope
   88 |   if(qq==o*t){cout<<a+b-1<<endl;}
      |                     ^
a.cc:88:23: error: 'b' was not declared in this scope
   88 |   if(qq==o*t){cout<<a+b-1<<endl;}
      |                       ^
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <algorithm>
using namespace std; //std::の省略のため
using ll = long long;

ll MOD = 1000000007;

int main()
{
    ll h, w, m;
    cin >> h >> w >> m;

    ll cnt_x[w] = {};
    ll cnt_y[h] = {};
    ll memory[h][w] = {};

    ll x, y;

    ll max_x = 0, max_y = 0;
    ll same_x[m] = {};
    ll same_y[m] = {};
    ll tmp_x = -1, tmp_y = -1;

    for (ll i = 0; i < m; i++)
    {
        cin >> y >> x;
        memory[x - 1][y - 1] = 1;

        cnt_x[x - 1]++;

        if (cnt_x[max_x] < cnt_x[x - 1])
        {
            max_x = x - 1;
            tmp_x = -1;
        }
        else if (cnt_x[max_x] == cnt_x[x - 1])
        {
            if (tmp_x == -1)
            {
                tmp_x = 0;
                same_x[tmp_x] = x - 1;
                tmp_x++;
            }
            else
            {
                same_x[tmp_x] = x - 1;
                tmp_x++;
            }
        }

        cnt_y[y - 1]++;

        if (cnt_y[max_y] < cnt_y[y - 1])
        {
            max_y = y - 1;
        }
        else if (cnt_y[max_y] == cnt_y[y - 1])
        {

            if (tmp_y == -1)
            {
                same_y[tmp_y] = y - 1;
                tmp_y++;
            }
        }
    }

    cout << max_x << max_y << endl;
    cout << cnt_x[max_x] << cnt_y[max_y] << endl;

    ll ans = cnt_x[max_x] + cnt_y[max_y] - 1;

    if (memory[max_x][max_y] == 0)
    {
        ans = cnt_x[max_x] + cnt_y[max_y];
    }
    else if (tmp_x != -1 && tmp_y != -1)
    {
        for (ll i = 0; i < tmp_x; i++)
        {
            for (ll j = 0; j < tmp_y; j++)
            {
                if (memory[same_x[i]][same_y[i]] == 0)
                {
                    ans = cnt_x[same_x[i]] + cnt_y[same_y[j]];
                    break;
                }
            }
        }
    }
    else if (tmp_x != -1)
    {
        for (ll i = 0; i < tmp_x; i++)
        {
            if (memory[same_x[i]][same_y[i]] == 0)
            {
                ans = cnt_x[same_x[i]] + cnt_y[max_y];
                break;
            }
        }
    }
    else if (tmp_y != -1)
    {
        for (ll j = 0; j < tmp_y; j++)
        {
            if (memory[max_x[i]][same_y[j]] == 0)
            {
                ans = cnt_x[max_x] + cnt_y[same_y[j]];
                break;
            }
        }
    }

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:107:30: error: 'i' was not declared in this scope
  107 |             if (memory[max_x[i]][same_y[j]] == 0)
      |                              ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<queue>
#include <cmath>
#include<algorithm>
#include<stack>
#include<map>
#include<ctime>
//#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

int main(){
    int  H,W,M;
    cin>>H>>W>>M;
    int h[M],w[M];
    vector<int> x(H),y(W);
    vector<vector<bool> > A(H,vector<bool>(W,false));
    for (int i=0;i<M;i++){
        cin>>h[i]>>w[i];
        h[i]--;
        w[i]--;
        A[h[i]][w[i]]=true;
        x[h[i]]++;
        y[w[i]]++;

    }
    int n=0;
    for (int i=1;i<H;i++){
        if (x[i]>x[i-1]) n=i;
    }
    vector<int> vx;
    for (int i=0;i<H;i++){
        if (x[i]==x[n]) vx.push_back(i);
    }
    int m=0;
    for (int i=1;i<W;i++){
        if (y[i]>y[i-1]) m=i;
    }
    vector<int> vy;
    for (int i=0;i<W;i++){
        if (y[i]==y[m]) vy.push_back(i);
    }
    int lx=vx.size();
    int ly=vy.size();
    long int ans=0;
    for (int i=0;i<lx;i++){
        for (int j=0;j<ly;j++){
            if (A[vx[i]vy[j]]==false){
                ans--;
                break;
            }
        }
    }
    ans+=x[n]+y[m];
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:24: error: expected ']' before 'vy'
   51 |             if (A[vx[i]vy[j]]==false){
      |                        ^~
      |                        ]
a.cc:51:24: error: expected ')' before 'vy'
   51 |             if (A[vx[i]vy[j]]==false){
      |                ~       ^~
      |                        )
a.cc:51:28: error: could not convert 'A.std::vector<std::vector<bool> >::operator[](((std::vector<std::vector<bool> >::size_type)vx.std::vector<int>::operator[](((std::vector<int>::size_type)i))))' from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<bool> >, std::vector<bool> >::value_type' {aka 'std::vector<bool>'} to 'bool'
   51 |             if (A[vx[i]vy[j]]==false){
      |                            ^
      |                            |
      |                            __gnu_cxx::__alloc_traits<std::allocator<std::vector<bool> >, std::vector<bool> >::value_type {aka std::vector<bool>}
a.cc:51:29: error: expected primary-expression before ']' token
   51 |             if (A[vx[i]vy[j]]==false){
      |                             ^
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i < b; i++)
#define VREP(it, v) for (vector<int>::iterator it = v.begin(); it != v.end(); it++)
typedef pair<ll,ll> pi;
typedef vector<ll> vi;

template <typename T>
using pbds_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename K, typename V>
using pbds_map = tree<K, V, less<K>, rb_tree_tag, tree_order_statistics_node_update>;
ll h, w, m;
ll a, b;
ll rr[300005];
ll hh[300005];
vector<pi> rrr, hhh;
map<pi, ll> ma;
pi arr[300005];
int dx[] = {0, 1, -1, 0, 0};
int dy[] = {0, 0, 0, 1, -1};
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> h >> w >> m;
	REP(i, 0, m){
		cin >> a >> b;
		a--;
		b--;
		arr[i] = MP(a, b);
		hh[a]++;
		rr[b]++;
		if (ma.find(MP(a, b)) == ma.end()){
			ma[MP(a, b)] = 1;
		} else {
			ma[MP(a, b)] += 1;
		}
	}
	ll answer = 0;
	REP(i, 0, m){
		REP(j, 0, 5){
			ll newx = arr[i].first + dx[i];
			ll newy = arr[i].second + dy[i];
			if (newx < 0 || newx >= h) continue;
			if (newy < 0 || newy >= w) continue;
			answer = max(answer, hh[newx] + rr[newy] - m[MP(newx, newy)]);
		}
	}
	cout << answer << endl;


}

//cout.flush()
//cout << fixed << setprecision(9) << x << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:54:69: error: no match for 'operator[]' (operand types are 'long long int' and 'std::pair<long long int, long long int>')
   54 |                         answer = max(answer, hh[newx] + rr[newy] - m[MP(newx, newy)]);
      |                                                                     ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 1010101010101010;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(){
  int h,w; cin>>h>>w;
  int m; cin>>m;
  vi yoko(h),tate(w);
  //bool b[h+10][w+10];
  multimap<ll> r;
  /*rep(i,h)rep(j,w){
    b[i][j]=false;
  }*/
  rep(i,m){
    int x,y; cin>>x>>y;
    x--;y--;
    yoko[x]++;tate[y]++;
    //b[x][y]=true;
    r.insert(x*300000+y);
  }
  int max_h=0,max_w=0;
  vi k,l;
  rep(i,h){
    if(max_h<yoko[i]){
      max_h=yoko[i];
      k.clear();
      k.push_back(i);
    }else if(max_h==yoko[i]){
      k.push_back(i);
    }
  }
  rep(i,w){
    if(max_w<tate[i]){
      max_w=tate[i];
      l.clear();
      l.push_back(i);
    }else if(max_w=tate[i]){
      l.push_back(i);
    }
  }
  int ans=max_h+max_w;
  bool judge=false;
  for(auto x:k)for(auto y:l){
    if(r.count(x*300000+y)) judge=true;
  }
  if(!judge) ans--;
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: wrong number of template arguments (1, should be at least 2)
   30 |   multimap<ll> r;
      |              ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:72:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::multimap'
   72 |     class multimap;
      |           ^~~~~~~~
a.cc:39:7: error: request for member 'insert' in 'r', which is of non-class type 'int'
   39 |     r.insert(x*300000+y);
      |       ^~~~~~
a.cc:64:10: error: request for member 'count' in 'r', which is of non-class type 'int'
   64 |     if(r.count(x*300000+y)) judge=true;
      |          ^~~~~
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;
ll dfs[3003][3003][4];
ll  s[1003][1003];
vector<int> di={1,-1,0,0};
vector<int> dj={0,0,1,-1};

int main(){
  int h,w,m; cin>>h>>w>>m;
  int th,tw;
  vector<int>nh(h,0),nw(w,0);
  vector<vector<bool>> pt(h,vector<bool>(w,false));
  int maxh=0,maxw=0;
  rep(i,m){
    cin>>th; cin>>tw;
    th--; tw--;
    nh[th]++;
    nw[tw]++;
    pt[th][tw]=true;
    maxh=max(maxh,nh[th]);
    maxw=max(maxw,nw[tw]);
  }
  vector<int> ph,pw;
  
  rep(i,h){
    if(nh[i]==maxh){
      ph.push_back(i);
    }
  }
  rep(i,w){
    if(nw[i]==maxw){
      pw.push_back(i);
    }
  }
  for(int i :ph){
    for(int j:pw){
      if(pt[i][j]==false){//i,jにbombがない
        now=nh[i]+nw[j];
      }else{
        now=nh[i]+nw[j]-1;//重複がある
      }
      ans=max(ans,now);
    }
  }
  
  

  cout<<ans<<endl;













  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:9: error: 'now' was not declared in this scope; did you mean 'nw'?
   50 |         now=nh[i]+nw[j];
      |         ^~~
      |         nw
a.cc:52:9: error: 'now' was not declared in this scope; did you mean 'nw'?
   52 |         now=nh[i]+nw[j]-1;//重複がある
      |         ^~~
      |         nw
a.cc:54:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |       ans=max(ans,now);
      |       ^~~
      |       abs
a.cc:54:19: error: 'now' was not declared in this scope; did you mean 'nw'?
   54 |       ans=max(ans,now);
      |                   ^~~
      |                   nw
a.cc:60:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   60 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {

	int H,W,M;
	cin >> H >> W >> M;
	int a[H][W]={};
	for(int i=0; i<M; i++){
		int x,y;
		cin >> x >> y;
		a[x-1][y-1]=1;
	}
	int max=0;
	for(int i=0; i<H; i++){
		for(int j=0; j<W; j++)
		int sum=0;
		for(int k=0; k<H; k++){
			if(a[k][j]==1){
				sum++;
			}
		}
		for(int k=0; k<W; k++){
			if(a[i][k]==1) sum++;
		}
		if(a[i][j]==1) sum--;
		if(max<sum) max=sum;
	}
	cout << max << endl



  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: 'j' was not declared in this scope
   19 |                         if(a[k][j]==1){
      |                                 ^
a.cc:20:33: error: 'sum' was not declared in this scope
   20 |                                 sum++;
      |                                 ^~~
a.cc:24:40: error: 'sum' was not declared in this scope
   24 |                         if(a[i][k]==1) sum++;
      |                                        ^~~
a.cc:26:25: error: 'j' was not declared in this scope
   26 |                 if(a[i][j]==1) sum--;
      |                         ^
a.cc:26:32: error: 'sum' was not declared in this scope
   26 |                 if(a[i][j]==1) sum--;
      |                                ^~~
a.cc:27:24: error: 'sum' was not declared in this scope
   27 |                 if(max<sum) max=sum;
      |                        ^~~
a.cc:29:28: error: expected ';' before 'return'
   29 |         cout << max << endl
      |                            ^
      |                            ;
......
   33 |   return 0;
      |   ~~~~~~
Language: C

#include<stdio.h>
#include <math.h>

typedef long long ll;

#define IMAX (300005)

int bombh[IMAX]; // h[i]: h = i なる爆弾数, 0初期化
int bombw[IMAX];
int bomb[IMAX][IMAX]; // 0初期化
int hmax_hi[IMAX], nexthi = 0; // 1位タイの行番号リスト
int wmax_wi[IMAX], nextwi = 0;

int main() {
	int h, w, m;
	scanf("%d %d %d", &h, &w, &m);
	
	for (int i = 0; i <= h; i++) {
		for (int j = 0; j <= w; j++) {
			bomb[i][j] = 0;
		}
	}
	
	for (int i = 0; i < m; i++)
	{
		int hi, wi;
		scanf("%d %d", &hi, &wi);
		hi--;
		wi--;
		bombh[hi]++;
		bombw[wi]++;
		bomb[hi][wi] = 1;
	}
	
	// hの1位探し
	int hmax = -1, tophi;
	for (int i = 0; i < h; i++) {
		if (bombh[i] > hmax) {
			hmax = bombh[i];
			// tophi = i;
			hmax_hi[0] = i;
			nexthi = 1;
		} else if (bombh[i] == hmax) {
			hmax_hi[nexthi] = i;
			nexthi++;
		}
	}
	
	// wの1位探し
	int wmax = -1, topwi;
	for (int i = 0; i < w; i++) {
		if (bombw[i] > wmax) {
			// printf("[%d > %d]", bombw[i], wmax);
			wmax = bombw[i];
			// topwi = i;
			wmax_wi[0] = i;
			nextwi = 1;
		} else if (bombw[i] == wmax) {
			wmax_wi[nextwi] = i;
			nextwi++;
		}
	}
	
	// (hmax_hi[*], wmax_wi[*])に爆弾がないと嬉しい
	int cross = 1;
	for (int i = 0; i < nexthi && cross; i++) {
		for (int j = 0; j < nextwi; j++) {
			if (bomb[i][j] == 0) {
				cross = 0;
				break;
			}
		}
	}
	for (int i = 0; i < nexthi; i++) {
		printf("%d ", hmax_hi[i]);
	}
	printf("\n");
	for (int i = 0; i < nextwi; i++) {
		printf("%d ", wmax_wi[i]);
	}
	printf("\n");
	printf("\n");
	int ans = hmax + wmax - cross;
	printf("%d", ans); 
	
	return 0;
}


Compiler output:
/tmp/cc9smP5o.o: in function `main':
main.c:(.text+0x1a4): relocation truncated to fit: R_X86_64_PC32 against symbol `hmax_hi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x1aa): relocation truncated to fit: R_X86_64_PC32 against symbol `nexthi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x1d2): relocation truncated to fit: R_X86_64_PC32 against symbol `nexthi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x1e3): relocation truncated to fit: R_X86_64_PC32 against symbol `hmax_hi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x1ef): relocation truncated to fit: R_X86_64_PC32 against symbol `nexthi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x1f8): relocation truncated to fit: R_X86_64_PC32 against symbol `nexthi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x25a): relocation truncated to fit: R_X86_64_PC32 against symbol `wmax_wi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x260): relocation truncated to fit: R_X86_64_PC32 against symbol `nextwi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x288): relocation truncated to fit: R_X86_64_PC32 against symbol `nextwi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x299): relocation truncated to fit: R_X86_64_PC32 against symbol `wmax_wi' defined in .bss section in /tmp/cc9smP5o.o
main.c:(.text+0x2a5): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using  namespace std;
typedef long long ll;
#define MOD (long long)(1e9+7)
#define _(i,a,n) for(int i=a;i<n;i++)
#define zero(a) a[0]=0
int a[300005];
int b[300005];
int c[300005];
int d[300005];
int mm[300005][2];
int main()
{
    int h,w,m;
    cin>>h>>w>>m;
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));memset(c,0,sizeof(c));memset(d,0,sizeof(d));
    _(i,0,m)
    {
        int x,y;
        cin>>x>>y;
        mm[i][0]=x;
        mm[i][1]=y;
        a[x]++;
        b[y]++;
    }
    ll ans=0;
    int maxx=-1;
    
    _(i,0,300005)
    {
        if(a[i]>maxx)
        {
            maxx=a[i];
        }
    }
    int o=0;
    _(i,0,300005)
    {
        if(a[i]==maxx)
            c[o]=i,o++;
    }
    ans+=maxx;
    maxx=-1;
    _(i,0,300005)
    {
        maxx=max(b[i],maxx);
    }
    ans+=maxx;
    //cout<<maxx<<endl;
    int oo=0;
     _(i,0,300005)
    {
        if(a[i]==maxx)
            d[oo]=i,oo++;
    }
    int f=0;
   _(i,0,o)
   {
       //cout<<c[i]<<endl;
           _(k,0,m)
           {
           if(c[i]==mm[k][0]-1)
           {
               //cout<<c[i]<<k<<endl;
               if(d[i]!=mm[k][1]-1)
               {
                   //cout<<c[i]<<d[j]<<endl;
                   f=1;break;
               }
           }
           }
       }
   }
   if(f)
    cout<<ans<<endl;
    else 
        cout<<ans-1<<endl;
}


Compiler output:
a.cc:75:4: error: expected unqualified-id before 'if'
   75 |    if(f)
      |    ^~
a.cc:77:5: error: expected unqualified-id before 'else'
   77 |     else
      |     ^~~~
a.cc:79:1: error: expected declaration before '}' token
   79 | }
      | ^
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<int,int>;

int main() {
  ll h,w,m;
  cin >> h >> w >> m;
  vector<ll> hc(h),wc(w);
  ll hmax=0,wmax=0;
  rep(i,m){
      int x,y;
      cin >> x >> y;
      x--; y--;
      v[x][y]++;
      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);
  }
  
  cout << hmax+wmax-1 << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: 'v' was not declared in this scope
   17 |       v[x][y]++;
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std ;
int main(){
    long long int H,W;
    cin >> H >> W;
    long long int M;
    cin >> M;
    pair<long long int,long long int> h[H],w[W];
    long long int bom[H][W]={0};
    for(long long int i=0;i<M;i++){
        long long int a,b;
        cin >> a >> b;
        h[a-1].first++;
        h[a-1].second=a;
        w[b-1].first++;
        w[b-1].second=b;
        bom[a-1][b-1]++;
    }
    sort(h,h+H,);
    sort(w,w+W);
    cout << h[H-1].first+w[H-1].first-bom[h[W-1].second-1][w[W-1].second-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: expected primary-expression before ')' token
   19 |     sort(h,h+H,);
      |                ^
Language: C++

#include <bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define ll long long int
#define pii pair<int,int>
#define N 300005
using namespace std;
vector<pii>v,ro,co;
vector<int>r,c;
int row[N],col[N];
bool vis_row[N],vis_col[N];
map<pii,int>mp;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,bombs;
    cin>>n>>m>>bombs;
    for(int i=0;i<bombs;i++){
        int x,y;
        cin>>x>>y;
        v.push_back({x,y});
        mp[{x,y}]++;
        if(!vis_row[x]) r.push_back(x);
        if(!vis_col[y]) c.push_back(y);
        vis_row[x]=1;
        vis_col[y]=1;
        row[x]++;
        col[y]++;
    }
    for(int i=0;i<r.size();i++) ro.push_back({row[r[i]],r[i]});
    for(int i=0;i<c.size();i++) co.push_back({col[c[i]],c[i]});
    sort(all(ro),greater<pii>());
    sort(all(co),greater<pii>());
    int ans=0;
    for(int i=0;i<ro.size();i++){
        if(row[x]<ro[0].first) break;
        for(int j=0;j<co.size();j++){
            int x=ro[i].second;
            int y=co[j].second;
            if(col[y]<co[0].first) break;
            ans=max(ans,row[x]+col[y]-mp[{x,y}]);
            if(ans==bombs) break;
        }
        if(ans==bombs) break;
    }
    cout<<ans;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:16: error: 'x' was not declared in this scope
   36 |         if(row[x]<ro[0].first) break;
      |                ^