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

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
  
using namespace std;
 
#define endl "\n"
#define JAM(x) cout<< #x <<" = "<<x<<"\n"
#define II() ( { int a ; read(a) ; a; } )
#define LL() ( { ll a ; read(a) ; a; } )
#define DD() ({double a; scanf("%lf", &a); a;})
 
 
//Fast Reader
template<class T>inline bool read(T &x){
    int c=getchar();int sgn=1;
    while(~c&&c<'0'||c>'9'){if(c=='-')sgn=-1;c=getchar();}
    for(x=0;~c&&'0'<=c&&c<='9';c=getchar())x=x*10+c-'0'; 
    x*=sgn; return ~c;
}
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
typedef vector<PII> VPI;
 
const int INF=2e9;
const int MX=100005;
const int MOD=1000000007;
const double PI=acos(-1.0);

vector<int> sieve(100001);


long long int power(long long int a,long long int b)
{
    a %= MOD;
    long long int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}
bool isprime(int n)
{
    if(n==1)
    return 0;
    int i;
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        return false;
    }
    return true;
}

void SIEVE()
{
    int i,j;
    for(i=0;i<=100000;i++)
    sieve[i]=i;
    for(i=2;i*i<=100000;i++)
    {
        if(sieve[i]!=i)
        continue;
        for(j=i*i;j<=100000;j=j+i)
        {
            if(sieve[j]==j)
            sieve[j]=i;
        }
    }
}


/*_______________________________________________*/
int n,m;
int dx[]={1,-1,0,0};
int dy[]={0,0,-1,1};
bool isvalid(int x,int y)
{
    if(x<0 || x>=n || y<0 || y>=m)
    return false;
    return true;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n>>m;
    vector<vector<int>> times(n,vector<int>(m,INT_MAX));
    vector<vector<char>> grid(n,vector<char>(m));
    int i,j;
    int sx,sy,ex,ey;
    cin>>sx>>sy;
    cin>>ex>>ey;
    for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++)
        cin>>grid[i][j];
    }
    times[sx-1][sy-1]=0;
    while(!q.empty())
    {
        pair<int,int> cur=q.front();
        q.pop();
        for(i=0;i<4;i++)
        {
            int x=cur.first+dx[i];
            int y=cur.second+dy[i];
            if(isvalid(x,y) && times[x][y]>times[cur.first][cur.second] && grid[x][y]=='.')
            {
                times[x][y]=times[cur.first][cur.second];
                q.push({x,y});
            }
        }
        for(i=-2;i<=2;i++)
        {
            for(j=-2;j<=2;j++)
            {
                int x=cur.first+i;
                int y=cur.second+j;
                if(isvalid(x,y) && times[x][y]>(times[cur.first][cur.second]+1) && grid[x][y]=='.')
                {
                    times[x][y]=times[cur.first][cur.second]+1;
                    q.push({x,y});
                }
            }
        }
    }
    if(times[ex-1][ey-1]!=INT_MAX)
    cout<<times[ex-1][ey-1];
    else
    {
        cout<<"-1";
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:107:12: error: 'q' was not declared in this scope
  107 |     while(!q.empty())
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define mp make_pair
#define ll long long
#define pb push_back


void solve()
{

   int h,w;
   cin>>h>>w;

   int a,b;
   int c,d;

   cin>>a>>b;

   cin>>c>>d;

   a--;c--;b--;d--;

   int i,j;

   vector<string>v(h);

   for(i=0;i<h;i++)
   {
       cin>>v[i];
   }

   queue<pair<int,int> >q;

   q.push(mp(a,b));

   vector<int>temp(w,0);
   vector<int>temp2(w,100000000);
   vector<vector<int> >visited(h, temp);
   vector<vector<int> >dist(h,temp2);
   dist[a][b] = 0;

   visited[a][b] = 1;

   while(!q.empty())
   {
       pair<int,int>p = q.front();
       q.pop();

       int x = p.first;
       int y =p.second;
       int level = dist[x][y];
       visited[x][y] = 1;
      //cout<<x<<" "<<y<<" "<<dist[x][y]<<endl;


       for(i=-2;i<=2;i++)
       {
           for(j=-2;j<=2;j++)
           {
               if(i==0 && j==0)
                continue;

               int x1 = x+i;
               int y1 = y+j;

               if(x1>=0 && x1<h && y1>=0 && y1<w)
               {
                   if(v[x1][y1]=='.')
                   {
                       int distance = abs(x1-x) + abs(y1-y);
                       int val;
                       if(distance==1)
                       {
                           val = 0;
                       }
                       else
                        val = 1;
                      if(dist[x1][y1] > level+val)
                      {
                         q.push(mp(x1,y1));
                         dist[x1][y1] = level+val;
                      }

                   }
               }
           }
       }

   }

   if(visited[x][y] ==0)
   {
       cout<<-1;
   }
   else
    cout<<dist[c][d];


}

int main()
{

  int t = 1;
  //cin>>t;

  while(t--)
    solve();

  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:92:15: error: 'x' was not declared in this scope
   92 |    if(visited[x][y] ==0)
      |               ^
a.cc:92:18: error: 'y' was not declared in this scope
   92 |    if(visited[x][y] ==0)
      |                  ^
Language: C++

#include "bits/stdc++.h"

using namespace std;

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

const int ddx[] = { -1,0,1,0,0,0,0,0,2.1,-1,-2,2,2,2,2,-2,-2,-2,-2,1,-1,1,1 };
const int ddy[] = { 0,-1,0,1,2,1,-1,-2,0,0,0,0,-2,-1,1,2,-2,-1,1,2,2,2,-2,2 };


int main() {
	int H, W;
	cin >> H >> W;
	int ch, cw, dh, dw;
	cin >> ch >> cw >> dh >> dw;
	ch--; cw--; dh--; dw--;
	vector<string> S(H);
	for (int n = 0; n < H; ++n) {
		cin >> S[n];
	}

	vector<vector<int>> D(H, vector<int>(W, 1e9));//回数
	queue<pair<int, int>> q;
	q.push(make_pair(ch, cw));
	D[ch][cw] = 0;

	while (!q.empty()) {
		int x = q.front().first;
		int y = q.front().second;
		q.pop();
		if ((x == dh) && (y == dw)) {
			cout << D[dh][dw] << endl;
			return 0;
		}
		//範囲内かつ0を4セット
		for (int l = 0; l < 4; ++l) {
			int x1 = x + dx[l];
			int y1 = y + dy[l];
			if ((0 <= x1) && (H > x1) && (0 <= y1) && (W > y1) && ('.' == S[x1][y1])) {
				if (D[x1][y1] > D[x][y]) {
					D[x1][y1] = D[x][y];
					q.emplace(x1, y1);
				}
			}
		}
		//範囲内かつ0を24セット
		for (int l = 0; l < 24; ++l) {
			int x1 = x + ddx[l];
			int y1 = y + ddy[l];
			if ((0 <= x1) && (H > x1) && (0 <= y1) && (W > y1) && ('.' == S[x1][y1])) {
				if (D[x1][y1] > D[x][y]) {
					D[x1][y1] = D[x][y] + 1;
					q.emplace(x1, y1);
				}
			}
		}
	}

	cout << -1 << endl;
	return 0;
}


Compiler output:
a.cc:8:38: error: narrowing conversion of '2.1000000000000001e+0' from 'double' to 'int' [-Wnarrowing]
    8 | const int ddx[] = { -1,0,1,0,0,0,0,0,2.1,-1,-2,2,2,2,2,-2,-2,-2,-2,1,-1,1,1 };
      |                                      ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define PB push_back
int main()
{
  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  ll h,w,m,r,c,M;
  cin>>h>>w>>m;
  M=m;
  vector <ll> rows(h,0),col(w,0);
  vector <vector <char>> grid(h,vector <char> (w));
  for (ll i=0;i<h;i++)
  {
    for (ll j=0;j<w;j++)
    {
      grid[i][j]='A';
    }
  }
  while (m--)
  {
    cin>>r>>c;
    grid[r-1][c-1]='P';
    rows[r-1]++;
    col[c-1]++;
  }
  if (M==h*w)
  {
    cout<<h+w-1;
  }
  else
  {
    ll rm=0,cm=0;
    for (ll i=0;i<h;i++)
    {
      rm=max(rm,rows[i]);
    }
    for (ll i=0;i<w;i++)
    {
      cm=max(cm,col[i]);
    }
    ll i=0,x=0,ans=rm+cm-1;
    while (x==0 and i<h)
    {
      if (rows[i]==rm)
      {
        for (ll j=0;j<w;j++)
        {
          if (col[j]==cm and grid[i][j]='A')
          {
            x++;
            break;
          }
        }
      }
      i++;
    }
    if (x!=0)
    {
      ans++;
    }
    cout<<ans;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:26: error: lvalue required as left operand of assignment
   49 |           if (col[j]==cm and grid[i][j]='A')
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#include <cstdio>
#include <cstring>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
#define mod 1000000007
//#define mod 998244353
#define pi 3.1415926535
using namespace std;
struct __INIT{
    __INIT(){
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout<<fixed<<setprecision(15);
    }
}__init;


int main(){
    ll h,w,m;
    cin>>h>>w>>m;
    vector<pl> ngo;
    vl tate(h,0);
    vl yoko(w,0);
    rep(i,m){
        ll a,b;
        cin>>a>>b;
        a--,b--;
        ngo.push_back({a,b});
        tate[a]++;
        yoko[b]++;
    }
    ll ans = 0;
    for(pl pitsu:ngo){
        ans = max(ans,ngo.first+ngo.second-1);
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:27: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'first'
   53 |         ans = max(ans,ngo.first+ngo.second-1);
      |                           ^~~~~
a.cc:53:37: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'second'
   53 |         ans = max(ans,ngo.first+ngo.second-1);
      |                                     ^~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#include <cstdio>
#include <cstring>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
#define mod 1000000007
//#define mod 998244353
#define pi 3.1415926535
using namespace std;
struct __INIT{
    __INIT(){
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout<<fixed<<setprecision(15);
    }
}__init;


int main(){
    ll h,w,m;
    cin>>h>>w>>m;
    vector<pl> ngo;
    vl tate(h,0);
    vl yoko(w,0);
    rep(i,m){
        ll a,b;
        cin>>a>>b;
        a--,b--;
        ngo.append({a,b});
        tate[a]++;
        yoko[b]++;
    }
    ll ans = 0;
    for(pl pitsu:ngo){
        ans = max(ans,ngo.first+ngo.second-1);
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:13: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'append'
   47 |         ngo.append({a,b});
      |             ^~~~~~
a.cc:53:27: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'first'
   53 |         ans = max(ans,ngo.first+ngo.second-1);
      |                           ^~~~~
a.cc:53:37: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'second'
   53 |         ans = max(ans,ngo.first+ngo.second-1);
      |                                     ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n = readint();
    int k = readint();
    int base = k;
    int l = 1;
    int r = k + 1;
    while (base--){
        if (l >= r){
            l = k + 2;
            r = 2 * k + 1;
        }
        printf("%d %d\n", l++, r-- );
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: 'readint' was not declared in this scope; did you mean 'readlink'?
    4 |         int n = readint();
      |                 ^~~~~~~
      |                 readlink
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int board[300005][300005], ans, h, w;

void mark(int x, int y) {
	for (int i = 0; i < w; i++) {
		board[x][i]++;
		ans = max(ans, board[x][i]);
	}
	for (int i = 0; i < h; i++) {
		if (x == y) {
			continue;
		}
		board[i][y]++;
		ans = max(ans, board[i][y]);
	}
}
 
 
int main() {
	int m, x, y;
	cin >> h >> w >> m;
	vector<pair<int, int>> boom(m);
	for (int i = 0; i < m; i++) {
		cin >> x >> y;
		boom.emplace_back(x, y);
	}
	for (auto each : boom) {
		mark(each.first, each.second);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
/tmp/ccNV90ZN.o: in function `mark(int, int)':
a.cc:(.text+0x98): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccNV90ZN.o
a.cc:(.text+0xa8): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccNV90ZN.o
a.cc:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccNV90ZN.o
a.cc:(.text+0x155): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccNV90ZN.o
a.cc:(.text+0x165): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccNV90ZN.o
a.cc:(.text+0x172): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccNV90ZN.o
/tmp/ccNV90ZN.o: in function `main':
a.cc:(.text+0x18f): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccNV90ZN.o
a.cc:(.text+0x1ab): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccNV90ZN.o
a.cc:(.text+0x2c1): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccNV90ZN.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#include <cmath>
#include <iomanip> //cout << fixed << setprecision(15) << << endl;
#include <cassert>
#include "atcoder/segtree"

using namespace std;
using namespace atcoder;

#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define P pair<int,int>

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;


int main(){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    int m, h, w;
    cin >> h >> w >> m;
    vector<P> tate(h), yoko(w);
    rep(i,h) tate[i].second = i;
    rep(i,w) yoko[i].second = i;
    set<P> bomb;

    while(m--){
        int hm,wm;
        cin >> hm >> wm;
        hm--; wm--;
        bomb.insert(P(hm,wm));
        tate[hm].first++;
        yoko[wm].first++;
    }
    sort(tate.rbegin(),tate.rend());
    sort(yoko.rbegin(),yoko.rend());
    int tatemax = tate[0].first, yokomax = yoko[0].first;

    bool ok = false;
    rep(i,h){
        rep(j,w){
            if (tate[i].first != tatemax) break;
            if (yoko[j].first != yokomax) break;
            auto itr = bomb.find(P(tate[i].second, yoko[j].second));
            if(itr == bomb.end()){
                //爆弾がなかった
                ok = true;
                break;
            }
        }
        if(ok) break;
    }
    int ans = tate[0].first + yoko[0].first;
    if(!ok) ans--;

    cout << ans << endl;

}



Compiler output:
a.cc:22:10: fatal error: atcoder/segtree: No such file or directory
   22 | #include "atcoder/segtree"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#include <cmath>
#include <iomanip> //cout << fixed << setprecision(15) << << endl;
#include <cassert>
#include "atcoder/segtree"

using namespace std;
using namespace atcoder;

#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define P pair<int,int>

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;


int main(){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    int h, w, m;
    cin >> h >> w >> m;
    vector<P> tate(h), yoko(w);
    bool bomb[h][w];
    rep(i,h) rep(j,w) bomb[i][j] = false;
    rep(i,h) tate[i].second = i;
    rep(i,w) yoko[i].second = i;

    while(m--){
        int hm,wm;
        cin >> hm >> wm;
        hm--; wm--;
        bomb[hm][wm] = true;
        tate[hm].first++;
        yoko[wm].first++;
    }
    sort(tate.rbegin(),tate.rend());
    sort(yoko.rbegin(),yoko.rend());
    int tatemax = tate[0].first, yokomax = yoko[0].first;

    bool ok = false;
    rep(i,h){
        rep(j,w){
            if (tate[i].first != tatemax) break;
            if (yoko[j].first != yokomax) break;
            if(!bomb[tate[i].second][yoko[j].second]){
                ok = true;
                break;
            }
        }
        if(ok) break;
    }
    int ans = tate[0].first + yoko[0].first;
    if(!ok) ans--;

    cout << ans << endl;

}



Compiler output:
a.cc:22:10: fatal error: atcoder/segtree: No such file or directory
   22 | #include "atcoder/segtree"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w,n;
  cin>>h>>w>>n;
  vector<int> hs(h),ws(w);
  set<pair<int,int>> s;
  for(int i=0;i<n;i++){
     int r,c;
     cin>>r>>c;
     --r;--c;
    hs[r]++;
    ws[c]++;
    s.emplace(r,c);
  }
  int mh=0,mw=0;
  for(int i=0;i<h;i++) if(mh==hs[i]) is.push_back(i);
  for(int i=0;i<w;i++) if(mw==ws[i]) js.push_baxk(j);
  int ans=mh+mw;
  for(int i:is) for(int j:js){
    if(s.count(pair(i,j))) continue;
    cout<<ans<<endl;
    return 0;
  }
  --ans;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: 'is' was not declared in this scope; did you mean 'i'?
   17 |   for(int i=0;i<h;i++) if(mh==hs[i]) is.push_back(i);
      |                                      ^~
      |                                      i
a.cc:18:38: error: 'js' was not declared in this scope; did you mean 's'?
   18 |   for(int i=0;i<w;i++) if(mw==ws[i]) js.push_baxk(j);
      |                                      ^~
      |                                      s
a.cc:18:51: error: 'j' was not declared in this scope
   18 |   for(int i=0;i<w;i++) if(mw==ws[i]) js.push_baxk(j);
      |                                                   ^
a.cc:20:13: error: 'is' was not declared in this scope; did you mean 'i'?
   20 |   for(int i:is) for(int j:js){
      |             ^~
      |             i
a.cc:20:27: error: 'js' was not declared in this scope; did you mean 'j'?
   20 |   for(int i:is) for(int j:js){
      |                           ^~
      |                           j
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int H, W, M;
	int h, w;
	int **bom;
	scanf_s("%d %d %d",&H,&W,&M);
	//配列動的確保
	bom = (int**)malloc(sizeof(int*)*W);
	for (int i = 0; i < W; i++) {
		bom[i] = (int*)malloc(sizeof(int*)*H);
	}
	//配列初期化
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			bom[i][j] = 0;
		}
	}
	//爆破対象の位置入力
	for (int i = 0; i < M; i++) {
		scanf_s("%d %d", &h, &w);
		bom[h][w] = 1;
	}
	//カウント
	int cnt = 0;
	int tmp = 0;
	//探索
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (bom[i][j] || bom[j][i])
				cnt++;
		}
		if (cnt > tmp) {
			tmp = cnt;
			cnt = 0;
		}
		else
			cnt = 0;

	}
	printf("%d\n", tmp);
	free(bom);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |         scanf_s("%d %d %d",&H,&W,&M);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
#include <unordered_set>
#include <utility>

using namespace std;

const int H_MAX = 3e5;
const int W_MAX = H_MAX;

template<>
struct hash<pair<int, int> > {
	size_t operator()(const pair<int, int> &p) const {
		return hash<int>{}(p.first) ^ hash<int>{}(p.second);
	}
};

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

	static int h[H_MAX];
	static int w[W_MAX];
	int maxH = 0;
	int maxW = 0;
	int maxHIndex = 0;
	int maxWIndex = 0;
	unordered_set<pair<int, int>> set;
	for(int i = 0; i < M; i++) {
		int hh, ww;
		cin >> hh >> ww;
		hh--;
		ww--;
		
		set.insert({hh, ww});
		h[hh]++;
		w[ww]++;
		if(h[hh] > maxH) {
			maxH = h[hh];
			maxHIndex = hh;
		}
		if(w[ww] > maxW) {
			maxW = w[ww];
			maxWIndex = ww;
		}
	}

	auto result = maxH + maxW;
	if(set.count({maxHIndex, maxWIndex}) > 0) {
		result--;
	}
	cout << result << endl;

	return 0;
}


Compiler output:
a.cc:11:8: error: explicit specialization of 'template<class _Tp> struct std::hash' outside its namespace must use a nested-name-specifier [-fpermissive]
   11 | struct hash<pair<int, int> > {
      |        ^~~~~~~~~~~~~~~~~~~~~
Language: C++

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

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPr(i, n) for(int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for(int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for(int i = (n); i >= (m); --i)
#define MP make_pair
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x, 0, sizeof(x))
#define FILL(x, y) memset(x, y, sizeof(x))
#define MM(x) memset(x, -1, sizeof(x))
#define ALL(x) (x).begin(), (x).end()
#define DB(x) cerr << #x << " = " << x << endl
#define DB2(x, y)                                                              \
    cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define DEBUG                                                                  \
    int x12345;                                                                \
    cin >> x12345;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
const long long MOD = 1e9 + 7;
///////////////////////////////////////////////
// for template
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;
}
///////////////////////////////////////////////
/// 🍈( '-' 🍈 |AC|
int main() {
    int H,W,M;
    cin >> H >> W >> M;
    vector<int> hcount(H);
    vector<int> wcount(W);
    map<PII,bool> bomb;
    REP(i,M){
        int h,w;
        cin >> h >> w;
        h--; w--;
        bomb(MP(h,w)) = true;
        hcount[h]++;
        wcount[w]++;
    }

    int ans = 0;
    REP(i,H){
        REP(j,W){
            int nans = hcount[i] + wcount[j];
            if (bomb(MP(i,j))) nans--;
            chmax(ans,nans);
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:13: error: no match for call to '(std::map<std::pair<int, int>, bool>) (std::pair<int, int>)'
   57 |         bomb(MP(h,w)) = true;
      |         ~~~~^~~~~~~~~
a.cc:66:21: error: no match for call to '(std::map<std::pair<int, int>, bool>) (std::pair<int, int>)'
   66 |             if (bomb(MP(i,j))) nans--;
      |                 ~~~~^~~~~~~~~
Language: C++

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

ll main() {
  ll H, W, M;
  cin >> H >> W >> M;

  vector<vector<bool>> rows(H, vector<bool>(W, false));
  vector<ll> rows_cnt(H, 0);
  vector<ll> columns_cnt(W, 0);
  rep(i,0,M-1) {
    ll h, w;
    cin >> h >> w;
    h--; w--;
    rows[h][w] = true;
    rows_cnt[h]++;
    columns_cnt[w]++;
  }

  ll max_row_cnt = 0;
  vector<ll> max_row_indices;
  rep(i,0,H-1) {
    if (max_row_cnt == rows_cnt[i]) {
      max_row_indices.push_back(i);
    } else if (max_row_cnt < rows_cnt[i]) {
      max_row_indices.clear();
      max_row_indices.push_back(i);
      max_row_cnt = rows_cnt[i];
    }
  }

  ll max_column_cnt = 0;
  vector<ll> max_column_indices;
  rep(i,0,W-1) {
    if (max_column_cnt == columns_cnt[i]) {
      max_column_indices.push_back(i);
    } else if (max_column_cnt < columns_cnt[i]) {
      max_column_indices.clear();
      max_column_indices.push_back(i);
      max_column_cnt = columns_cnt[i];
    }
  }

  for (ll max_row_index : max_row_indices) {
    for (ll max_column_index: max_column_indices) {
      if (!rows[max_row_index][max_column_index]) {
        cout << max_row_cnt + max_column_cnt << endl;
        return 0;
      }
    }
  }

  cout << max_row_cnt + max_column_cnt - 1 << endl;
  return 0;
}


Compiler output:
a.cc:6:1: error: '::main' must return 'int'
    6 | ll main() {
      | ^~
Language: C

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#include <map>
#include <queue>
#define N 1010
#define ll long long
#define mo ((ll)1e9+7)
//10000000000037ll
//21993833369ll
#define db double
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define drep(i,a,b) for(int i=a;i>=b;--i)
#define mst(a,b) memset(a,b,sizeof(a))
using namespace std;
bool cmp(int a, int b) {return a > b;}
inline int read() {
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') {if (ch == '-')f = -1; ch = getchar();}
	while (ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	return x * f;
}
int row[300010], column[300010];
#define pr pair<int,int>
map<pr, bool> ma;
int Mr[300010], Mc[300010];
int main() {
	int n = read(), m = read(), c = read(), mr = 0, mc = 0;

	rep(i, 1, c) {
		int x = read(), y = read();
		//printf("%d %d\n", x, y);
		ma[make_pair(x, y)] = 1;
		row[x]++, column[y]++;
		cmax(mr, row[x]), cmax(mc, column[y]);
	}
	//if (ma[po(1, 2)])puts("error");
	rep(i, 1, n)if (row[i] == mr)Mr[++Mr[0]] = i;
	rep(i, 1, m)if (column[i] == mc)Mc[++Mc[0]] = i;
	int ans = mr + mc;
	rep(i, 1, Mr[0])rep(j, 1, Mc[0]) {
		if (Mr[i] == 1 && Mc[j] == 2)puts("hhh");
		if (ma[make_pair(Mr[i], Mc[j])] == 0) {printf("%d\n", ans); return 0;}
	}
	printf("%d\n", --ans);
	return 0;
}


Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define int long long
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

typedef pair<int,int> PI;
typedef pair<int,pair<int,int>> PII;
static const int INF=1010000000000000017LL;
static const double eps=1e-12;
static const double pi=3.14159265358979323846;
static const int dx[4]={1,-1,0,0};
static const int dy[4]={0,0,1,-1};
static const int ddx[8]={1,-1,0,0,1,1,-1,-1};
static const int ddy[8]={0,0,1,-1,1,-1,1,-1};

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 H,W;
int M;
vector<int> row[300005];
vector<int> col[300005];
vector<int> maxw;
int numh[300005]; 

signed main(){
    cin>>H>>W>>M;
    for(int i=0;i<M;++i){
        int h,w;
        cin>>h>>w;
        h--,w--;
        row[h].push_back(w);
        col[w].push_back(h);
    }
    for(int i=0;i<H;++i){
        if(row[i].size()==0)continue;
        sort(row[i].begin(),row[i].end());
    }
    int ma=0;
    for(int i=0;i<W;++i){
        if(col[i].size()==0)continue;
        sort(col[i].begin(),col[i].end());
        chmax(ma,(int)col[i].size());
    }
    for(int i=0;i<W;++i){
        if(ma==col[i].size())maxw.push_back(i);
    }
    for(auto i:maxw){
        for(auto u:col[i]){
            numh[u]++;
        }
    }
    int ans=0;
    for(int y=0;y<H;++y){
        if(numh[y]==maxw.size())chmax(ans,ma+row[y].size()-1);
        else chmax(ans,ma+row[y].size());
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:38: error: no matching function for call to 'chmax(long long int&, long long unsigned int)'
   59 |         if(numh[y]==maxw.size())chmax(ans,ma+row[y].size()-1);
      |                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:31: note: candidate: 'template<class T> bool chmax(T&, T)'
   21 | template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
      |                               ^~~~~
a.cc:21:31: note:   template argument deduction/substitution failed:
a.cc:59:38: note:   deduced conflicting types for parameter 'T' ('long long int' and 'long long unsigned int')
   59 |         if(numh[y]==maxw.size())chmax(ans,ma+row[y].size()-1);
      |                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:19: error: no matching function for call to 'chmax(long long int&, long long unsigned int)'
   60 |         else chmax(ans,ma+row[y].size());
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:21:31: note: candidate: 'template<class T> bool chmax(T&, T)'
   21 | template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
      |                               ^~~~~
a.cc:21:31: note:   template argument deduction/substitution failed:
a.cc:60:19: note:   deduced conflicting types for parameter 'T' ('long long int' and 'long long unsigned int')
   60 |         else chmax(ans,ma+row[y].size());
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <queue>
#include <functional>
#include <vector>
#include <stack>
#include <set>
using namespace std;
typedef unsigned long long ll;
const int maxn=3e5+50;
const int inf=0x3f3f3f3f;
const int MOD=1e9+7;
const int HASH=131;

int h[maxn];
int w[maxn];
bool mp[maxn][maxn];
struct node
{
    int num,id;
    friend bool operator <(node a,node b)
    {
        return a.num<b.num;
    }
};

node x[maxn],y[maxn];
int main()
{
    int n,m;
    cin>>n>>m;
    int t;
    cin>>t;
    for(int i=1;i<=t;i++)
    {
        int a,b;
        cin>>a>>b;
        h[a]++;
        w[b]++;
        mp[a][b]=1;
    }
    for(int i=1;i<=n;i++)
    {
        y[i].num=h[i];
        y[i].id=i;
    }
    for(int i=1;i<=m;i++)
    {
        x[i].num=w[i];
        x[i].id=i;
    }
    sort(y+1,y+1+n);
    sort(x+1,x+1+m);
    int max_y=y[n].num;
    int max_x=x[m].num;
    int sign=1;
    for(int i=n;i>=1;i--)
    {
        if(y[i].num!=max_y) break;
        for(int j=m;j>=1;j--)
        {
            if(x[j].num!=max_x) break;
            if(mp[y[i].id][x[j].id]==0) {sign=0;break;}
        }
        if(sign==0) break;
    }
    if(sign==0) printf("%d\n",max_y+max_x);
    else printf("%d\n",max_y+max_x-1);
    return 0;
}


Compiler output:
/tmp/cclkK0Dq.o: in function `main':
a.cc:(.text+0x13b): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x152): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x199): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x1b0): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x1da): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x1e4): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x207): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x211): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x230): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x24a): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cclkK0Dq.o
a.cc:(.text+0x276): 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<(n); i++)
#define chmax(a,b) a = max(a,b)
using namespace std;
using ll = long long;
using P  = pair<int,int>;
using vi = vector<int>;

int main(){
    int h, w, m;
    cin >> h >> w >> m;
    vi bomh(h, 0), bomw(w, 0);
    set<P> bombs;
    rep(i,m){
        int a,b; cin>>a>>b; a--;b--;
        bomh[a]++;
        bomw[b]++;
        bombs.insert(P(a,b));
    }
    vi argh, argw;
    int maxh = 0, maxw = 0;
    rep(i,h)chmax(maxh, bomh[i]);
    rep(i,w)chmax(maxw, bomw[i]);
    rep(i,h)if(maxh==bomh[i])argh.push_back(i);
    rep(i,w)if(maxw==bomw[i])argw.push_back(i);
    
    ll count = (ll)argh.size()*argw.size();
    int ans = maxh+maxw;
    if(count>bombs.size()){
        cout<< ans <<endl;
        return 0;
    }
    
    for(auto b: bombs){
        int h = b.first;
        int w = b.second;
        if(argh.count(h) && argw.count(w))
            count--;
    }
    
    if(!count)
        cout << ans-1 << endl;
    else
        cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'using vi = class std::vector<int>' {aka 'class std::vector<int>'} has no member named 'count'
   37 |         if(argh.count(h) && argw.count(w))
      |                 ^~~~~
a.cc:37:34: error: 'using vi = class std::vector<int>' {aka 'class std::vector<int>'} has no member named 'count'
   37 |         if(argh.count(h) && argw.count(w))
      |                                  ^~~~~
Language: C

#include <stdio.h>
int main(){
  int H,W,M;
  int x,y;
  int count=0,max=0;
  int i,j;
  int h[300001]={},w[300001]={};
  int map[300001][300001]={};
  setbuf(stdout,NULL);
  scanf("%d%d%d",&H,&W,&M);
  for(i=1;i<=m;i++){
    scanf("%d%d",&x,&y);
    H[x]++;
    W[y]++;
    map[x][y]++;
  }
  for(i=1;i<=h;i++){
    for(j=1;j<=w;j++){
      count=H[i]+W[j];
      if(map[i][j]==1){
        count--;
      }else{
        continue;
      }
      if(count>=max){
        max=count;
      }
    }
  }
  printf("%d",max);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:14: error: 'm' undeclared (first use in this function)
   11 |   for(i=1;i<=m;i++){
      |              ^
main.c:11:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:6: error: subscripted value is neither array nor pointer nor vector
   13 |     H[x]++;
      |      ^
main.c:14:6: error: subscripted value is neither array nor pointer nor vector
   14 |     W[y]++;
      |      ^
main.c:17:12: warning: comparison between pointer and integer
   17 |   for(i=1;i<=h;i++){
      |            ^~
main.c:18:14: warning: comparison between pointer and integer
   18 |     for(j=1;j<=w;j++){
      |              ^~
main.c:19:14: error: subscripted value is neither array nor pointer nor vector
   19 |       count=H[i]+W[j];
      |              ^
main.c:19:19: error: subscripted value is neither array nor pointer nor vector
   19 |       count=H[i]+W[j];
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long double LD; 
typedef long long ll; 
#define int ll 
#define ff(i,a,b) for (int i = a; i < b; i++) 
#define bf(i,a,b) for (int i = a; i >= b; i--) 
#define all(v) v.begin(),v.end() 
#define show(a) for(auto xyz:a)cout<<xyz<<" ";cout<<endl;
#define F first 
#define S second
#define pb push_back
#define mp make_pair
#define lb lower_bound   
#define ub upper_bound
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define one cout<<"-1"<<endl
#define pi 3.141592653589793238
#define intmx INT_MAX 
#define intmi INT_MIN
const int MOD=1e9+7;
int mod(int x){
    return ((x%MOD + MOD)%MOD);
}
int add(int a,int b){
    return mod(mod(a)+mod(b));
}
int mul(int a,int b){
    return mod(mod(a)*mod(b));
}
void solve(){
   int h,w,m;
   cin>>h>>w>>m;
   int H[h]={0},W[w]={0};
   int a[h][w]={};
   while(m--){
       int r,c;
       cin>>r>>c;
       a[r-1][c-1]=1;
       H[r-1]=H[r-1]+1;
       W[c-1]=w[c-1]+1;
   }
 
   int ans=0;
   ff(i,0,h){
       ff(j,0,w){
           //cout<<a[i][j]<<" ";
            if(a[i][j]==0)
            ans=max(ans,H[i]+W[j]);
            else
            ans=max(ans,H[i]+W[j]-1);
       }
       //cout<<endl;
   }
    cout<<ans<<endl;
}
signed main() {
        solve();
    
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:42:16: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   42 |        W[c-1]=w[c-1]+1;
      |                ^
Language: C++

#include<bits/stdc++.h>
#define lg long long int
#define loop(i,s,e) for(lg i=s;i<=e;i++)
#define iloop(i,s,e) for(lg i=e;i>=s;i--)
#define pb push_back
#define mp make_pair
using namespace std;

lg min(lg a,lg b)
{return a<b?a:b;}
lg max(lg a,lg b)
{return a>b?a:b;}
lg lcm(lg a ,lg b)
{
    return (a*b)/__gcd(a,b);
}
bool fn(vector<vector<lg>>& gr,vector<vector<lg>>& nodes)
{
    lg l = gr.size();
    lg n = nodes.size();
    lg j=0;
    
    if(n>l) return false;
    
    for(lg i=0;i<l;i++)
    {
        if(nodes[j][0]==gr[i][0] && nodes[j][1]==gr[i][1])
            j++;
        
        if(j==n) return true;
        
        if(nodes[j][0]<gr[i][0])
            return false;
    }
    return false;
}
int main()
{
    lg n,m,t;
    cin>>n>>m>>t;

    vector<lg>rows(n,0);
    vector<lg>cols(m,0);
    vector<vector<lg>>gr;
    vector<lg>cord(2,0);
    for(lg i=0;i<t;i++)
    {
        lg a,b;
        cin>>a>>b;
        cord[0]=a-1;
        cord[1]=b-1;
        gr.pb(cord);
        rows[a-1]++;
        cols[b-1]++;
    }
    sort(gr.begin(),gr.end());
    lg r=0,c=0;
    for(lg i=0;i<n;i++)
        r=max(r,rows[i]);
    vector<lg>rr;
    for(lg i=0;i<n;i++)
        if(rows[i]==r)
            rr.pb(i);

    for(lg i=0;i<m;i++)
        c=max(c,cols[i]);
    vector<lg>cc;
    for(lg i=0;i<m;i++)
        if(cols[i]==c)
            cc.pb(i);

    lg maxnum=r+c;

    vector<vector<lg>>nodes;

    vector<lg>cord(2,0);
    lg x=rr.size();
    lg y=cc.size();
    for(lg i=0;i<x;i++)
        for(lg j=0;j<y;j++)
        {
            cord[0]=rr[i];
            cord[1]=cc[j];
            nodes.pb(cord);
        }

    if(fn(gr,nodes))
        maxnum--;

    cout<<maxnum<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:76:15: error: redeclaration of 'std::vector<long long int> cord'
   76 |     vector<lg>cord(2,0);
      |               ^~~~
a.cc:45:15: note: 'std::vector<long long int> cord' previously declared here
   45 |     vector<lg>cord(2,0);
      |               ^~~~
Language: C++

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

// #define int long long

int N, M, T;

int main(){
	cin >> N >> M >> T;
	map < int, int > row, col;
	set < pair < int, int > > grid;

	while (T--){
		int A, B; cin >> A >> B;
		row[A-1] += 1;
		col[B-1] += 1;
		grid.insert({A-1, B-1});
	}

	vector < pair <int, int> > scol;
	for (auto c : col){
		scol.push_back({c.second, c.first});
	}
	sort(scol.begin(), scol.end());
	reverse(scol.begin(), scol.end());

	long long res = 0;
	for (auto r : row){
		long long ix = r.first, val = r.second;
		for(int i = 0; i < scol.size(); i ++){
			int curr = val;
			curr += scol[i].first - (grid.find({ix, scol[i].second}) != grid.end()); 	
			if (res - curr >= 2)
				break;
			res = max(res, curr);
		}
	}
	cout << res << "\n";
}



Compiler output:
a.cc: In function 'int main()':
a.cc:35:34: error: no matching function for call to 'max(long long int&, int&)'
   35 |                         res = max(res, curr);
      |                               ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:35:34: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   35 |                         res = max(res, curr);
      |                               ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:35:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   35 |                         res = max(res, curr);
      |                               ~~~^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main() {
    int H, W, M;
    cin >> H >> W >> M;
    int h[M], w[M];
    int ch[H]{}, cw[W]{};
    int hmax = 0;
    int wmax = 0;
    for (int i = 0; i < M; i++) {
        cin >> h[i] >> w[i];
        h[i]--;
        w[i]--;
        ch[h[i]]++;
        cw[w[i]]++;
        hmax = max(hmax, ch[h[i]]);
        wmax = max(wmax, cw[w[i]]);
    }
    int hh = 0;
    int ww = 0;
    for (int i = 0; i < H; i++) {
        if (hmax == ch[i]) hh++;
    }
    for (int i = 0; i < W; i++) {
        if (wmax == cw[i]) ww++;
    }
    int cnt = 0
    for (int i = 0; i < M; i++) {
        if (ch[h[i]] == hmax && cw[w[i]] == wmax) cnt++;
    }
    if (cnt==hh*ww) {
        cout << hmax + wmax - 1<< endl;
    } else {
        cout << hmax + wmax << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: expected ',' or ';' before 'for'
   30 |     for (int i = 0; i < M; i++) {
      |     ^~~
a.cc:30:21: error: 'i' was not declared in this scope
   30 |     for (int i = 0; i < M; i++) {
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int H, W, M;
    cin >> H >> W >> M;
    int h[M], w[M];
    int ch[H]{}, cw[W]{};
    int hmax = 0;
    int wmax = 0;
    for (int i = 0; i < M; i++) {
        cin >> h[i] >> w[i];
        h[i]--;
        w[i]--;
        ch[h[i]]++;
        cw[w[i]]++;
        hmax = max(hmax, ch[h[i]]);
        wmax = max(wmax, cw[w[i]]);
    }
    int hh = 0;
    int ww = 0;
    for (int i = 0; i < H; i++) {
        if (hmax == ch[i]) hh++;
    }
    for (int i = 0; i < W; i++) {
        if (wmax == cw[i]) ww++;
    }
    ll v = hh * ww;
    for (int i = 0; i < M; i++) {
        if (ch[h[i]] == hmax && cw[w[i]] == wmax) {
            v--;
        }
    }
    if (v == 0) {
        cout << hmax + wmax - 1<< endl;
    } else {
        cout << hmax + wmax << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'll' was not declared in this scope
   28 |     ll v = hh * ww;
      |     ^~
a.cc:31:13: error: 'v' was not declared in this scope
   31 |             v--;
      |             ^
a.cc:34:9: error: 'v' was not declared in this scope
   34 |     if (v == 0) {
      |         ^
Language: C++

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




int main(){
  int H , W , M ; 
  cin >> H >> W >> M ; 
  vector<int> A(H) ; 
  vector<int> B(W) ; 
  vector<vector<int>> C(H , vector<int>(W)) ;  
  
  for(int i = 0 ; i < M ; i++){
      int h , w ; 
      cin >> h >> w ; 
      A.at(h-1)++ ; 
      B.at(w-1)++ ; 
      C.at(h-1).at(w-1)++ ; 
    
  }
  

  vector<int>::iterator iter = max_element(A.begin(),A.end()) ; 
  size_t index = distance(A.begin(),iter) ; 
  int index= max_element(A.begin(),A.end()) - A.begin();    
  //cout << index << endl ;
  
  vector<int>::iterator iter2 = max_element(B.begin(),B.end()) ; 
  size_t index2 = distance(B.begin(),iter2) ; 
  int index2= max_element(B.begin(),B.end()) - B.begin();  
  //cout << index2 << endl ; 
  

  
  if(C.at(index).at(index2) > 0 ){
    cout << A.at(index) + B.at(index2) -1<<endl ; 
    return 0 ; 
  }
  else{
    cout << A.at(index) + B.at(index2) <<endl ; 
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:7: error: conflicting declaration 'int index'
   26 |   int index= max_element(A.begin(),A.end()) - A.begin();
      |       ^~~~~
a.cc:25:10: note: previous declaration as 'size_t index'
   25 |   size_t index = distance(A.begin(),iter) ;
      |          ^~~~~
a.cc:31:7: error: conflicting declaration 'int index2'
   31 |   int index2= max_element(B.begin(),B.end()) - B.begin();
      |       ^~~~~~
a.cc:30:10: note: previous declaration as 'size_t index2'
   30 |   size_t index2 = distance(B.begin(),iter2) ;
      |          ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxm=3e5+5;
pair<int,int>p[maxm];
int r[maxm],c[maxm];
int n,m,k;
int main(){
    cin>>n>>m>>k;
    for(int i=1;i<=k;i++){
        int x,y;cin>>x>>y;
        p[i]={x,y};
        r[x]++,c[y]++;
    }
    int ma1=-1,num1=0;
    for(int i=1;i<=n;i++)ma1=max(ma1,r[i]);
    for(int i=1;i<=n;i++)num1+=(r[i]==ma1);
    int ma2=-1,num2=0;
    for(int i=1;i<=m;i++)ma2=max(ma2,c[i]);
    for(int i=1;i<=m;i++)num2+=(c[i]==ma2);
    int cnt=0;
    for(int i=1;i<=k;i++){
        int x=p[i].first,y=p[i].second;
        cnt+=(r[x]==ma1&&c[y]==ma2);
    }
    cout<<ma1+ma2-(cnt==num1*num2)<<endl;
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'