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

import java.util.Scanner;
import java.util.HashMap;
import java.util.TreeSet;
import java.lang.Comparable;

public class Main {
    static Scanner sc = new Scanner(System.in);

    int H, W, M;
    HashMap<Integer, Integer> bombsOnRow, bombsOnCol;

    class Pair implements Comparable<Pair> {
        public Integer a, b;
        public Pair(Integer aa, Integer bb) { a = aa; b = bb; }

        @Override
        public int compareTo(Pair o) {
            if (this.a == o.a) return this.b.compareTo(o.b);
            else return this.a.compareTo(o.a);
        }

        public boolean equals(Pair o) {
            return (this.a.compareTo(o.a) == 0 && this.b.compareTo(o.b) == 0);
        }
    }
    TreeSet<Pair> targets = new TreeSet<>();

    void solve() {
        input();

        Integer ans = 0;
        int maxBombOnRow = 0;
        int row = 0;
        for (Integer key : bombsOnRow.keySet()) {
            Integer bomb = bombsOnRow.get(key);
            if (maxBombOnRow <= bomb) {
                maxBombOnRow = bomb;
                row = key;
            }
        }
        for (Integer key : bombsOnCol.keySet()) {
            ans = Math.max(ans,
                maxBombOnRow + bombsOnCol.get(key) -
                (targets.contains(new Pair(row, key)) ? 1 : 0) 
            );
        }
        System.out.println(ans);
    }

    void input() {
        bombsOnCol = new HashMap<Integer, Integer>();
        bombsOnRow = new HashMap<Integer, Integer>();
        H = sc.nextInt(); W = sc.nextInt(); M = sc.nextInt();
        for (int a, b, i = 0; i < M; i++) {
            a = sc.nextInt(); b = sc.nextInt();
            bombsOnRow.put(a, bombsOnRow.getOrDefault(a, 0) + 1);
            bombsOnCol.put(b, bombsOnCol.getOrDefault(b, 0) + 1);
            targets.add(new Pair(a, b));
        }
    }

    public static void main(String[] args) {
        try {
            new e().solve();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

Compiler output:
Main.java:64: error: cannot find symbol
            new e().solve();
                ^
  symbol:   class e
  location: class Main
1 error
Language: Java

import java.util.Scanner;
import java.util.HashMap;
import java.util.TreeSet;
import java.lang.Comparable;

public class e {
    static Scanner sc = new Scanner(System.in);

    int H, W, M;
    HashMap<Integer, Integer> bombsOnRow, bombsOnCol;

    class Pair implements Comparable<Pair> {
        public Integer a, b;
        public Pair(Integer aa, Integer bb) { a = aa; b = bb; }

        @Override
        public int compareTo(Pair o) {
            if (this.a == o.a) return this.b.compareTo(o.b);
            else return this.a.compareTo(o.a);
        }

        public boolean equals(Pair o) {
            return (this.a.compareTo(o.a) == 0 && this.b.compareTo(o.b) == 0);
        }
    }
    TreeSet<Pair> targets = new TreeSet<>();

    void solve() {
        input();

        Integer ans = 0;
        int maxBombOnRow = 0;
        int row = 0;
        for (Integer key : bombsOnRow.keySet()) {
            Integer bomb = bombsOnRow.get(key);
            if (maxBombOnRow <= bomb) {
                maxBombOnRow = bomb;
                row = key;
            }
        }
        for (Integer key : bombsOnCol.keySet()) {
            ans = Math.max(ans,
                maxBombOnRow + bombsOnCol.get(key) -
                (targets.contains(new Pair(row, key)) ? 1 : 0) 
            );
        }
        System.out.println(ans);
    }

    void input() {
        bombsOnCol = new HashMap<Integer, Integer>();
        bombsOnRow = new HashMap<Integer, Integer>();
        H = sc.nextInt(); W = sc.nextInt(); M = sc.nextInt();
        for (int a, b, i = 0; i < M; i++) {
            a = sc.nextInt(); b = sc.nextInt();
            bombsOnRow.put(a, bombsOnRow.getOrDefault(a, 0) + 1);
            bombsOnCol.put(b, bombsOnCol.getOrDefault(b, 0) + 1);
            targets.add(new Pair(a, b));
        }
    }

    public static void main(String[] args) {
        try {
            new e().solve();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

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

#define DIN freopen("input.txt","r",stdin);
#define DOUT freopen("output.txt","w",stdout);
#include <bits/stdc++.h>
#include <cstdio>
#define mem(a,b) memset(a,b,sizeof(a))
#define REP(i,a,b) for(int i=(a);i<=(int)(b);i++)
#define REP_(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
using namespace std;
typedef long long LL;
typedef std::vector<int> VI;
typedef std::pair<int, int> P;
bool search(int x, int y, int list[][2],int M)
{
    for (int i = 0; i < M; i++)
    {
        if (list[i][0] == x && list[i][1] == y) return true;
    }
    return false;

}
int main()
{
    int H, W, M;
    const int maxn = 3e5;
    cin >> H >> W >> M;
    int result = 0;
    int List[maxn][2];
    map<int, int> list_x, list_y;

    //input and record
    for (int i = 0; i < M; i++)
    {
        int x, y;
        cin >> y >> x;
        List[i][0] = x; List[i][1] = y;
        if (list_x.count(x) != 0)list_x[x]++;
        else list_x[x] = 1;
        if (list_y.count(y) != 0)list_y[y]++;
        else list_y[y] = 1;
    }
    // using vector to do a value sort
    vector<int> Max_colomn;
    vector<int>Max_list;
    int x_temp_max = 0;
    for (int x = 1; x <= W; x++)
    {
        if (list_x.count(x))
        {
            if (x_temp_max < list_x[x])
            {
                x_temp_max = list_x[x];
            }
        }
    }
    for (int x = 1; x <= W; x++)
    {
        if (list_x.count(x))
        {
            if (x_temp_max == list_x[x])
            {
                Max_colomn.push_back(x);
            }
        }
    }
    int y_temp_max = 0;
    for (int y = 1; y <= H; y++)
    {
        if (list_y.count(y))
        {
            if (y_temp_max < list_y[y])
            {
                y_temp_max = list_y[y];
            }
        }
    }
    for (int y = 1; y <= H; y++)
    {
        if (list_y.count(y))
        {
            if (y_temp_max < list_y[y])
            {
                Max_list.push_back(y);
            }
        }
    }
    for (int x = 0; x < Max_colomn.size; x++)
    {
        for (int y = 0; y < Max_list.size(); y++)
        {
            if (!search(x, y, List, M))
            {
                cout << x_temp_max + y_temp_max;
            }
        }
    }
    cout << x_temp_max + y_temp_max - 1;

    


}

Compiler output:
a.cc: In function 'int main()':
a.cc:87:36: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   87 |     for (int x = 0; x < Max_colomn.size; x++)
      |                         ~~~~~~~~~~~^~~~
      |                                        ()
Language: C++

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

struct edge{
    int to,weight;
    edge(int to,int weight):to(to),weight(weight){}
};
using Graph = vector<vector<int>> ;
using GraphEdge = vector<vector<int>> ;

long long modinv(long long a, long long m=MOD) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
    /*MODの割り算の際に
    a/＝b;
    を
    a *= modinv(b,MOD);
    とする。
        */
}

const int MAXH=300001;
const int MAXW=300001;
int main(){
    int H,W,M;cin >> H >> W >> M;
    ll tate[MAXW];
    ll yoko[MAXH];
    bool onw[MAXW];
    bool onh[MAXW];

    memset(onw, false, sizeof(onw));  
    memset(onh, false, sizeof(onh));  
    memset(tate, 0, sizeof(tate));
    memset(yoko, 0, sizeof(yoko));
    int h[MAXH];
    int w[MAXW];
    rep(i,M){
        cin >> h[i] >> w[i];
        tate[w[i]]++;
        yoko[h[i]]++;
    }
    ll ans = 0;
    ll maxw=0,maxh=0;
    ll x=0,y=0;
    Rep(i,W){
        maxw = max(tate[i],maxw);
    }
    Rep(i,W){
        if(maxw==tate[i]){
            onw[i] = true;
            x++;
        }
    }

    Rep(i,H){
        maxh = max(maxh,yoko[i]);
    }

    Rep(i,H){
        if(maxh==yoko[i]){
            onh[i] = true;
            y++;
        }
    }

    ans = x*y;
    rep(i,M){
        if(onw[w[i]] && onh[h[i]]){
            ans--;
        }
    }

    ll tma = maxh+maxw;
    // if(ans>0)cout << tma << endl;
    else cout << tma-1 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:86:5: error: 'else' without a previous 'if'
   86 |     else cout << tma-1 << endl;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define double long double
using namespace std;
const int MOD = 1000000007;
const int INF = 1e14;
using Graph = vector<vector<int>>;

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

  map<int, int> Hcnt;
  map<int, int> Wcnt;
  set<pair<int, int>> num;
  for( int i = 0; i < M; i++ ){
    int h, w;
    cin >> h >> w;
    num.insert({h, w});
    Hcnt[h]++;
    Wcnt[w]++;
  }

  //HとWの最大値をそれぞれ調べる
  int Hmax = 0;
  for( auto p : Hcnt ){
    if( p.second > Hmax ) Hmax = p.second;
  }
  int Wmax = 0;
  for( auto p : Wcnt ){
    if( p.second > Wmax ) Wmax = p.second;
  }

  vector<int> H_kouho;
  for( auto p : Hcnt ){
    if( p.second == Hmax ) H_kouho.push_back(p.first);
  }
  vector<int> W_kouho;
  for( auto p : Wcnt ){
    if( p.second == Wmax ) W_kouho.push_back(p.first);
  }

  for( int i = 0; i < H_kouho.size(); i++ ){
    for( int j = 0; j < W_kouho.size(); j++ ){
      if( !num.count({H_kouho[i], W_kouho[j]}) ){
        cout << Hmax+Wmax << endl;
        return 0;
      }
    }
  }
  else cout << Hmax+Wmax-1 << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:3: error: 'else' without a previous 'if'
   51 |   else cout << Hmax+Wmax-1 << endl;
      |   ^~~~
Language: C++


#include <bits/stdc++.h>

#define loop(s, e, i) for (int i = s; i < e; ++i)
#define print(s) cout << s << endl;
using namespace std;
using ll = long long;
using lld = long long;

/*
浮動小数点の入力
cout << fixed << setprecision(9) << endl;
*/

ll gcd(ll a, ll b)
{
  if (a < b)
  {
    return gcd(b, a);
  }
  while (b != 0)
  {
    ll tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
  ll H, W, M;
  cin >> H >> W >> M;

  vector<ll> HA(H);
  vector<ll> WA(W);
  set<pair<int, int>> MA;

  loop(0, M, i){
    ll x, y;
    cin >> y >> x;
    x--;
    y--;
    HA[y] +=1;
    WA[x] +=1;
    MA.insert(make_pair(y, x));
  }

  ll sw = *max_element(WA.begin(), WA.end());
  ll sh = *max_element(HA.begin(), HA.end());
  vector<int> wls;
  vector<int> hls;
  ll score = 0;

  loop(0, H, i) {
    if (HA[i] == sh) {
      hls.push_back(i);
    }
  }

  loop(0, W, i) {
    if (WA[i] == sw) {
      wls.push_back(i);
    }
  }

  for(auto y : hls) {
    for(auto x : xls) {
      if (MA.count({y, x}) == 0) {
        print(sw + sh);
        return 0;
      }
    }
  }
  score--;
  print(score);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:18: error: 'xls' was not declared in this scope; did you mean 'hls'?
   69 |     for(auto x : xls) {
      |                  ^~~
      |                  hls
a.cc:70:19: error: no matching function for call to 'std::set<std::pair<int, int> >::count(<brace-enclosed initializer list>)'
   70 |       if (MA.count({y, x}) == 0) {
      |           ~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/set:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_set.h:756:9: note: candidate: 'template<class _Kt> decltype (((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_count_tr(__x)) std::set<_Key, _Compare, _Alloc>::count(const _Kt&) const [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]'
  756 |         count(const _Kt& __x) const
      |         ^~~~~
/usr/include/c++/14/bits/stl_set.h:756:9: note:   template argument deduction/substitution failed:
a.cc:70:19: note:   couldn't deduce template parameter '_Kt'
   70 |       if (MA.count({y, x}) == 0) {
      |           ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_set.h:750:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::count(const key_type&) const [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; size_type = long unsigned int; key_type = std::pair<int, int>]'
  750 |       count(const key_type& __x) const
      |       ^~~~~
/usr/include/c++/14/bits/stl_set.h:750:29: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::set<std::pair<int, int> >::key_type&' {aka 'const std::pair<int, int>&'}
  750 |       count(const key_type& __x) const
      |             ~~~~~~~~~~~~~~~~^~~
Language: C

#include<stdio.h>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(j,m) for(int (j)=0;(j)<(m);(j)++)
#define max(x,y) x>y?x:y

int main() {
  int h,w,m;
  scanf("%d %d %d", &h,&w,&m);
  int h[600000] = {0};
  int w[600000] = {0};
  int hc[600000] = {0};
  int wc[600000] = {0};

  int bh,bw;
  int hset[m];
  int wset[m];
  rep(i,m){
    scanf("%d %d", &bh,&bw);
    bh--;
    bw--;
    hc[bh] += 1;
    wc[bw] += 1;
    hset[i] = bh;
    wset[i] = bw;
  }

  int hs[h];
  int ws[w];

  int sumh;
  rep(i,h){
    sumh = 0;
    rep2(j,w){
      if(hw[i][j] == 1){
        sumh += 1;
      }
    }
    hs[i] = sumh;
  }

  int sumw;
  rep(i,w){
    sumw = 0;
    rep2(j,h){
      if(hw[j][i] == 1){
        sumw += 1;
      }
    }
    ws[i] = sumw;
  }

  int maxh = -1;
  int maxw = -1;
  int maxb = -1;

  rep(i,h){
    maxh = max(maxh,hs[i]);
  }
  rep(i,w){
    maxw = max(maxw,ws[i]);
  }
  rep(i,m){
    maxb = max(maxb,hs[hset[i]] + ws[wset[i]]);
  }

  long long int hmc = 0, wmc = 0, bmc = 0;

  rep(i,h){
    if(maxh == hs[i]) hmc++;
  }
  rep(i,w){
    if(maxw == ws[i]) wmc++;
  }
  rep(i,m){
    if(maxb == hs[hset[i]] + ws[wset[i]]) bmc++;
  }

  int ans = maxh + maxw;

  if(maxb == maxh + maxw){
    if(bmc == hmc * wmc){
      ans--;
    }
  }

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

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:10:7: error: conflicting types for 'h'; have 'int[600000]'
   10 |   int h[600000] = {0};
      |       ^
main.c:8:7: note: previous declaration of 'h' with type 'int'
    8 |   int h,w,m;
      |       ^
main.c:11:7: error: conflicting types for 'w'; have 'int[600000]'
   11 |   int w[600000] = {0};
      |       ^
main.c:8:9: note: previous declaration of 'w' with type 'int'
    8 |   int h,w,m;
      |         ^
main.c:35:10: error: 'hw' undeclared (first use in this function); did you mean 'hs'?
   35 |       if(hw[i][j] == 1){
      |          ^~
      |          hs
main.c:35:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(j,m) for(int (j)=0;(j)<(m);(j)++)
#define max(x,y) x>y?x:y

int main() {
  int h,w,m;
  scanf("%d %d %d", &h,&w,&m);
  int h[h] = {0};
  int w[w] = {0};
  int hc[h] = {0};
  int wc[w] = {0};

  int bh,bw;
  int hset[m];
  int wset[m];
  rep(i,m){
    scanf("%d %d", &bh,&bw);
    bh--;
    bw--;
    hc[bh] += 1;
    wc[bw] += 1;
    hset[i] = bh;
    wset[i] = bw;
  }

  int hs[h];
  int ws[w];

  int sumh;
  rep(i,h){
    sumh = 0;
    rep2(j,w){
      if(hw[i][j] == 1){
        sumh += 1;
      }
    }
    hs[i] = sumh;
  }

  int sumw;
  rep(i,w){
    sumw = 0;
    rep2(j,h){
      if(hw[j][i] == 1){
        sumw += 1;
      }
    }
    ws[i] = sumw;
  }

  int maxh = -1;
  int maxw = -1;
  int maxb = -1;

  rep(i,h){
    maxh = max(maxh,hs[i]);
  }
  rep(i,w){
    maxw = max(maxw,ws[i]);
  }
  rep(i,m){
    maxb = max(maxb,hs[hset[i]] + ws[wset[i]]);
  }

  long long int hmc = 0, wmc = 0, bmc = 0;

  rep(i,h){
    if(maxh == hs[i]) hmc++;
  }
  rep(i,w){
    if(maxw == ws[i]) wmc++;
  }
  rep(i,m){
    if(maxb == hs[hset[i]] + ws[wset[i]]) bmc++;
  }

  int ans = maxh + maxw;

  if(maxb == maxh + maxw){
    if(bmc == hmc * wmc){
      ans--;
    }
  }

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:7: error: conflicting types for 'h'; have 'int[h]'
   10 |   int h[h] = {0};
      |       ^
main.c:8:7: note: previous declaration of 'h' with type 'int'
    8 |   int h,w,m;
      |       ^
main.c:10:14: error: variable-sized object may not be initialized except with an empty initializer
   10 |   int h[h] = {0};
      |              ^
main.c:11:7: error: conflicting types for 'w'; have 'int[w]'
   11 |   int w[w] = {0};
      |       ^
main.c:8:9: note: previous declaration of 'w' with type 'int'
    8 |   int h,w,m;
      |         ^
main.c:11:14: error: variable-sized object may not be initialized except with an empty initializer
   11 |   int w[w] = {0};
      |              ^
main.c:35:10: error: 'hw' undeclared (first use in this function); did you mean 'hs'?
   35 |       if(hw[i][j] == 1){
      |          ^~
      |          hs
main.c:35:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(j,m) for(int (j)=0;(j)<(m);(j)++)
#define max(x,y) x>y?x:y

int main() {
  int h,w,m;
  scanf("%d %d %d", &h,&w,&m);
  int h[h] = {0};
  int w[w] = {0};

  int bh,bw;
  int hset[m];
  int wset[m];
  rep(i,m){
    scanf("%d %d", &bh,&bw);
    bh--;
    bw--;
    hc[bh] += 1;
    wc[bw] += 1;
    hset[i] = bh;
    wset[i] = bw;
  }

  int hs[h];
  int ws[w];

  int sumh;
  rep(i,h){
    sumh = 0;
    rep2(j,w){
      if(hw[i][j] == 1){
        sumh += 1;
      }
    }
    hs[i] = sumh;
  }

  int sumw;
  rep(i,w){
    sumw = 0;
    rep2(j,h){
      if(hw[j][i] == 1){
        sumw += 1;
      }
    }
    ws[i] = sumw;
  }

  int maxh = -1;
  int maxw = -1;
  int maxb = -1;

  rep(i,h){
    maxh = max(maxh,hs[i]);
  }
  rep(i,w){
    maxw = max(maxw,ws[i]);
  }
  rep(i,m){
    maxb = max(maxb,hs[hset[i]] + ws[wset[i]]);
  }

  long long int hmc = 0, wmc = 0, bmc = 0;

  rep(i,h){
    if(maxh == hs[i]) hmc++;
  }
  rep(i,w){
    if(maxw == ws[i]) wmc++;
  }
  rep(i,m){
    if(maxb == hs[hset[i]] + ws[wset[i]]) bmc++;
  }

  int ans = maxh + maxw;

  if(maxb == maxh + maxw){
    if(bmc == hmc * wmc){
      ans--;
    }
  }

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:7: error: conflicting types for 'h'; have 'int[h]'
   10 |   int h[h] = {0};
      |       ^
main.c:8:7: note: previous declaration of 'h' with type 'int'
    8 |   int h,w,m;
      |       ^
main.c:10:14: error: variable-sized object may not be initialized except with an empty initializer
   10 |   int h[h] = {0};
      |              ^
main.c:11:7: error: conflicting types for 'w'; have 'int[w]'
   11 |   int w[w] = {0};
      |       ^
main.c:8:9: note: previous declaration of 'w' with type 'int'
    8 |   int h,w,m;
      |         ^
main.c:11:14: error: variable-sized object may not be initialized except with an empty initializer
   11 |   int w[w] = {0};
      |              ^
main.c:20:5: error: 'hc' undeclared (first use in this function); did you mean 'h'?
   20 |     hc[bh] += 1;
      |     ^~
      |     h
main.c:20:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:5: error: 'wc' undeclared (first use in this function); did you mean 'w'?
   21 |     wc[bw] += 1;
      |     ^~
      |     w
main.c:33:10: error: 'hw' undeclared (first use in this function); did you mean 'hs'?
   33 |       if(hw[i][j] == 1){
      |          ^~
      |          hs
Language: C

#include<stdio.h>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(j,m) for(int (j)=0;(j)<(m);(j)++)
#define max(x,y) x>y?x:y

int main() {
  int h,w,m;
  scanf("%d %d %d", &h,&w,&m);
  int hw[h+1][w+1];
  rep(i,h+1){
    rep2(j,w+1){
      hw[i][j] = 0;
    }
  }

  int bh,bw;
  int hset[m];
  int wset[m];
  rep(i,m){
    scanf("%d %d", &bh,&bw);
    bh--;
    bw--;
    hw[bh][bw] = 1;
    hset[i] = bh;
    wset[i] = bw;
  }

  int hs[h];
  int ws[w];

  int sumh;
  rep(i,h){
    sumh = 0;
    rep2(j,w){
      if(hw[i][j] == 1){
        sumh += 1;
      }
    }
    hs[i] = sumh;
  }

  int sumw;
  rep(i,w){
    sumw = 0;
    rep2(j,h){
      if(hw[j][i] == 1){
        sumw += 1;
      }
    }
    ws[i] = sumw;
  }

  int maxh = -1;
  int maxw = -1;
  int maxb = -1;

  rep(i,h){
    maxh = max(maxh,hs[i]);
  }
  rep(i,w){
    maxw = max(maxw,ws[i]);
  }
  rep(i,w){
    maxb = max(maxb,hs[hset[i]] + ws[wset[i]]);
  }

  long long int hmc = 0, wmc = 0, bmc = 0;

  rep(i,h){
    if(maxh == hs[i]) hmc++;
  }
  rep(i,w){
    if(maxw == ws[i]) wmc++;
  }
  rep(i,w){
    if(maxb == hs[hset[i]] + ws[wset[i]]) bmc++
  }

  int ans = maxh + maxw;

  if(bmax == maxh + maxw){
    if(bmc == hmc * wmc){
      ans--;
    }
  }

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:77:48: error: expected ';' before '}' token
   77 |     if(maxb == hs[hset[i]] + ws[wset[i]]) bmc++
      |                                                ^
      |                                                ;
   78 |   }
      |   ~                                             
main.c:82:6: error: 'bmax' undeclared (first use in this function); did you mean 'max'?
   82 |   if(bmax == maxh + maxw){
      |      ^~~~
      |      max
main.c:82:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

#define rep(i,n) for(int i=0;i<(n);i++)

typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//定数
#define INF 1000000000 //10^9:極めて大きい値,∞
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

    int h,w,m;

int main(){
    cin>>h>>w>>m;
    vector<int> yv(h),xv(w);
    int x,y;
    set<pair<int,int>> s;
    rep(i,m){
        cin>>y>>x;
        y--;
        x--;
        s.insert(make_pair(y,x));
        yv[y]++;
        xv[x]++;
    }
    int ymax=0;
    rep(i,h){
        ymax=max(ymax,yv[i])
    }
    ll ans=ymax;
    int xmax=0;
    rep(i,w){
        xmax=max(xmax,xv[i]);
    }
    ans+=xmax;
    rep(i,h){
        if(yv[i]==ymax){
            rep(j,w){
                if(xv[j]==xmax){
                    if(s.count(make_pair(i,j))==0){
                        cout<<ans<<endl;
                        return 0;
                    }
                }
            }
        }
    }
    cout<<ans-1<<endl;
    return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:37:29: error: expected ';' before '}' token
   37 |         ymax=max(ymax,yv[i])
      |                             ^
      |                             ;
   38 |     }
      |     ~
Language: C++

l#include <iostream>

using namespace std;
typedef struct mz
{
    int height;
    int wide;
} mz;
mz jl[300005];
int Hs[300005]= {0};
int Ws[300005]= {0};
bool pd(int M,int hindex,int windex)
{
    for(int i=1; i<=M; i++)
    {
        if(jl[i].height==hindex && jl[i].wide==windex)
        {
            return true;
        }
    }
    return false;
}
int main()
{
    int H,W,M,hindex,windex,maxh,maxw;
    int height,wide;
    cin>>H>>W>>M;
    for(int i=1; i<=H; i++)
    {
        Hs[i]=0;
    }
    for(int i=1; i<=W; i++)
    {
        Ws[i]=0;
    }
    for(int i=1; i<=M; i++)
    {
        cin>>height>>wide;
        jl[i].height=height;
        jl[i].wide=wide;
        Hs[height]++;
        Ws[wide]++;
    }
    maxh=Hs[1],hindex=1;
    for(int i=2; i<=H; i++ )
    {
        if(maxh<Hs[i])
        {
            maxh=Hs[i];
            hindex=i;
        }
    }

    maxw=Ws[1],windex=1;
    for(int i=2; i<=W; i++ )
    {
        if(maxw<Ws[i])
        {
            maxw=Ws[i];
            windex=i;
        }
    }
    bool flag=true;
    for(int i=hindex; i<=H; i++)
    {
        for(int j=windex; j<=W; j++)
        {
            if(Hs[i]==maxh && Ws[j]==maxw)
            {
                if(!pd(M,hindex,windex))
                {
                    cout<<(maxh+maxw);
                    flag=true;
                    return 0;
                }
            }
        }
    }
    if(flag)
    {
        cout<<maxh+maxw-1;
    }
    return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | l#include <iostream>
      |  ^
a.cc:1:1: error: 'l' does not name a type
    1 | l#include <iostream>
      | ^
a.cc: In function 'int main()':
a.cc:27:5: error: 'cin' was not declared in this scope
   27 |     cin>>H>>W>>M;
      |     ^~~
a.cc:72:21: error: 'cout' was not declared in this scope
   72 |                     cout<<(maxh+maxw);
      |                     ^~~~
a.cc:81:9: error: 'cout' was not declared in this scope
   81 |         cout<<maxh+maxw-1;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

using int64 = long long;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int H, W, M;
	cin >> H >> W >> M;
	unordered_map<int, int> bombs_line, bombs_col;
	for (int i = 0; i < M; ++i) {
		int hx, wx;
		cin >> hx >> wx;
		bombs_line[hx]++;
		bombs_col[wx]++;
	}
	int max_on_line = 0;
	for (auto it1 : bombs_line) {
		max_on_line = max(max_on_line, it1.second);
	}
	int max_on_col = 0;
	for (auto it2 : bombs_col) {
		max_on_col = max(max_on_col, bombcol[it2.first] > 1? it2.second - 1 : it2.second);
	}
	cout << max_on_line + max_on_col << '\n';
	return 0;
}	


Compiler output:
a.cc: In function 'int main()':
a.cc:53:46: error: 'bombcol' was not declared in this scope; did you mean 'bombs_col'?
   53 |                 max_on_col = max(max_on_col, bombcol[it2.first] > 1? it2.second - 1 : it2.second);
      |                                              ^~~~~~~
      |                                              bombs_col
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pi 2*asin(1.0)
#define MAX 10000000
#define MOD 1000000007
 
 
vector<long> fac(MAX);
vector<long> finv(MAX);
vector<long> inv(MAX);
 
//template functions
/////////////////////////
void Cominit(){
  fac.at(0)=fac.at(1)=1;
  finv.at(0)=finv.at(1)=1;
  inv.at(1)=1;
  for(long i=2;i<MAX;i++){
      fac.at(i)=(fac.at(i-1)*i)%MOD;
      inv.at(i)=MOD-inv.at(MOD%i)*(MOD/i)%MOD;
      finv.at(i)=finv.at(i-1)*inv.at(i)%MOD;
  }
}

long facComb(long N,long M){// nCm%
if(N<M) return 0;
if(N<0||M<0) return 0;
return fac.at(N)*(finv.at(M)*finv.at(N-M)%MOD)%MOD;
}

long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}

long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}

long GCM(long A,long B){
            long W,r;
    if(A<B){

        W=B;
        B=A;
        A=W;
    }
    while(A%B!=0){
        r=A%B;
        A=B;
        B=r;
    }
    return B;
}
long LCM(long A,long B){
    return (A*B)/GCM(A,B);
}

long upDiv(long a,long b){
  return (a+b-1)/b;
}

/////////////////////////


//Answer


int main() {

typedef pair<long,long> P;
long H,W,M,ans,flag=0;
cin>>H>>W>>M;
vector<P> h(H+1);
vector<P> w(W+1);
vector<P> m(M);
vector<P> hw(M);

vector<long> hw(M,1);
//vector<vector<long>> A(H+1,vector<long>(W+1,0));

for(long i=0;i<H+1;i++){
h.at(i).first=0;
h.at(i).second=i;
}
for(long i=0;i<W+1;i++){
w.at(i).first=0;
w.at(i).second=i;
}
 
for(long i=0;i<M;i++){
cin>>m.at(i).first>>m.at(i).second;
h.at(m.at(i).first).first++;
w.at(m.at(i).second).first++;
//A.at(m.at(i).first).at(m.at(i).second)=1;
}
sort(h.begin(),h.end());
reverse(h.begin(),h.end());
sort(w.begin(),w.end());
reverse(w.begin(),w.end());
sort(m.begin(),m.end());

 
long a=0,b=0;
while(a<H+1 && h.at(a).first==h.at(0).first){
    a++;
  if(a==H+1){
    break;
  }
}
while(b<W+1 && w.at(b).first==w.at(0).first){
    b++;
  if(b==W+1){
    break;
  }
}


if(a*b>M){
    ans=h.at(0).first+w.at(0).first;
}else{
    for(long i=0;i<a;i++){
        for(long j=0;j<b;j++){
            hw.at(i*b+j).first=h.at(i).second;
            hw.at(i*b+j).first=w.at(j).second;          
        }
    }
    sort(hw.begin(),hw.end());
    long t=0;
    for(long i=0;i<M;i++){
        if(m.at(i).first==hw.at(t).first&&m.at(i).second==hw.at(t).second){
            t++;
        }
    }

    if(t<a*b){
        ans=h.at(0).first+w.at(0).first;
    }else{
        ans=h.at(0).first+w.at(0).first-1;
    }
 
}
cout<<ans<<endl;
 
 
 
}





Compiler output:
a.cc: In function 'int main()':
a.cc:89:14: error: conflicting declaration 'std::vector<long int> hw'
   89 | vector<long> hw(M,1);
      |              ^~
a.cc:87:11: note: previous declaration as 'std::vector<std::pair<long int, long int> > hw'
   87 | vector<P> hw(M);
      |           ^~
Language: C++

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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;
}
bool vector_finder(std::vector<ll> vec, int number) {
  bool f = binary_search(all(vec), number);
  if(f) return true;
  else return false;
}
struct edge {
  ll to, cost;
};

int main() {
  int H, W; cin >> H >> W;
  int M; cin >> M;
  vector<int> h(M), w(M);
  REP(i, M) {
    cin >> h[i] >> w[i];
    h[i]--; w[i]--;
  }
  vector<ll> x(H, 0), y(W, 0);
  REP(i, M) {
    x[h[i]]++; y[w[i]]++;
  }
  ll ans = 0;
  ll max_x = *max_element(all(x));
  ll max_y = *max_element(all(y));
  vector<ll> p, q;
  REP(i, H) if(x[i] == max_x) p.push_back(i);
  REP(i, W) if(y[i] == max_y) q.push_back(i);
  ans = max_x + max_y;
  bool flag = false; ll cnt = 0;
  REP(i, M) {
    if(vector_finder(all(p), h[i]) && vector_finder(all(q), w[i])) {
      cnt++;
    }
  }
  if(p.size() * q.size() == cnt) cout << ans - 1 << endl;
  else cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: could not convert 'p.std::vector<long long int>::begin()' from 'std::vector<long long int>::iterator' to 'std::vector<long long int>'
    5 | #define all(x) (x).begin(),(x).end()
      |                ~~~~~~~~~^~
      |                         |
      |                         std::vector<long long int>::iterator
a.cc:57:22: note: in expansion of macro 'all'
   57 |     if(vector_finder(all(p), h[i]) && vector_finder(all(q), w[i])) {
      |                      ^~~
a.cc:5:25: error: could not convert 'q.std::vector<long long int>::begin()' from 'std::vector<long long int>::iterator' to 'std::vector<long long int>'
    5 | #define all(x) (x).begin(),(x).end()
      |                ~~~~~~~~~^~
      |                         |
      |                         std::vector<long long int>::iterator
a.cc:57:53: note: in expansion of macro 'all'
   57 |     if(vector_finder(all(p), h[i]) && vector_finder(all(q), w[i])) {
      |                                                     ^~~
Language: C++

#include<bits/stdc++.h>
 using namespace std;
 
 // #define  int           long long
 #define pb                push_back
 #define ppb               pop_back
 #define pf                push_front
 #define ppf               pop_front
 #define all(x)            (x).begin(),(x).end()
 #define uniq(v)           (v).erase(unique(all(v)),(v).end())
 #define sz(x)             (int)((x).size())
 #define fr                first
 #define sc                second
 #define pint              pair<int,int>
 #define rep(i,a,b)        for(int i=a;i<b;i++)
 #define mem1(a)           memset(a,-1,sizeof(a))
 #define mem0(a)           memset(a,0,sizeof(a))
 #define ppc               __builtin_popcount
 #define ppcll             __builtin_popcountll
 #define vint			   vector<int>
 #define vpint			   vector<pair<int,int>>
 #define mp                make_pair


 void reader() 
 { 
 #ifndef ONLINE_JUDGE 
 freopen("input.txt","r",stdin);
 freopen("output.txt","w",stdout); 
 #endif
 }
 
 void fastIO() {ios_base::sync_with_stdio(false); cin.tie(NULL);}
 
 
 
 void solve()
 {
 
 int n,m,t;
 cin>>n>>m>>t;
 int r,c;
 int a[n][m];
 rep(i,0,n)
 rep(j,0,m)
 a[i][j]=0;
  vint rc(n,0);
 vint cc(m,0)
 while(t--)
 {
 	cin>>r>>c;
 	r--;
 	c--;
    rc[r]++;
    cc[c]++;
 	a[r][c]=1;
 }
 int maxi=0;
 rep(i,0,n)
 rep(j,0,m)
 {
 	if(a[i][j]==1)
 		maxi=max(maxi,rc[i]+cc[j]-1);
 	else
 		maxi=max(maxi,rc[i]+cc[j]);
 }
cout<<maxi;

 
 cout<<"\n";
 }
 
 
 
 signed main()
 {
 	reader(); fastIO();
 	long long t=1;
 	//cin>>t;
 	while(t--) solve();
 	return 0;
 }

Compiler output:
a.cc: In function 'void solve()':
a.cc:49:2: error: expected ',' or ';' before 'while'
   49 |  while(t--)
      |  ^~~~~
Language: Java

import java.util.*;
public class Bomber {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        int m = sc.nextInt();
        
        int[] rows = new int[h];
        int[] cols = new int[w];
        
        int[][] grid = new int[h][w];
        
        for(int i = 0; i<m ; i++) {
          int x = sc.nextInt()-1;
          int y = sc.nextInt()-1;
          grid[x][y] = 1;
          rows[x]++;
          cols[y]++;
        }
        
        int out = 0;
        for(int i = 0; i<h; i++) {
          for(int j = 0; j<w; j++) {
            int possible = rows[i]+cols[j];
            if(grid[i][j] == 1) possible--;
            out = Math.max(out, possible);
          }
        }
        
        System.out.println(out);
    }
}


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

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int maxn = 3e5 + 10;
int x, y, r[maxn], c[maxn];
vector<int>  rr, cc;
set<pair<int,int> >st;
int main()
{
    int h, w, m;
    cin >> h >> w >> m;
    int mr = 0, mc = 0;///行最大，列最大值
    for (int i = 0; i < m; i++)
    {
        cin>>x>>y;
        st.insert(make_pair(x,y));
        r[x]++;
        c[y]++;
        if(mr<r[x])
        {
            mr=r[x];///更新行最大值
            rr.clear();
            rr.pb(x);///看有幾行最大的值
        }
        else if(mr==r[x])
        {
            rr.pb(x);///如果相等放進來
        }
        if(mc<c[y])
        {
            mc=c[y];
            cc.clear();
            cc.pb(y);
        }
        else if(mc==c[y])
        {
            cc.pb(y);
        }
    }
    for(int i:rr)///便利的是存進來的是行值最大的行坐標
        for(int j:cc)///列值最大的列坐標
        {
            if(st.count(make_pair(i,j)))///如果這個點有東西的話
                continue;
            else
            {
                cout<<mr+mc;///弱國這個點沒東西
                return;
            }
        }
    cout << mr+mc-1;///如果都是在一點用東西，那就要減去在重曡的一個
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   48 |                 return;
      |                 ^~~~~~
Language: C

#include<stdio.h>

#define rep(i,n) for(int i=0; i< (int)(n); i++)
#define rep2(j,n) for(int j=0; j< (int)(n); j++)
#define max(x,y) x>y?x:y

int main() {
  int h,w,m;
  scanf("%d %d %d\n", h,w,m);
  int hw[h+1][w+1];
  rep(i,h+1){
    rep2(j,w+1){
      hw[i][j] = 0;
    }
  }

  int bh,bw;
  rep(i,m){
    scanf("%d %d\n", &bh,&bw);
    hw[bh][bw] = 1;  
  }

  int sumh;
  rep(i,h){
    rep2(j,w){
      if(hw[i][j] = 1){
        sumh += 1;
      }  
    }
    hw[i][w+1] = sumh;
  }

  int sumw;
  rep(i,w){
    rep2(j,h){
      if(hw[i][j] = 1){
        sumw += 1;
      }  
    }
    hw[h+1][i] = sumw;
  }

  int maxh = -1;
  int maxw = -1;
  
  rep(i,h){
    maxh = max(maxh,hw[i][w+1]);
  }
  rep(i,w){
    maxw = max(maxh,hw[h+1][i]);
  }

  int ans = -100;
  int h2[h][w];
  rep(i,h){
    rep2(j,w){
      hw2[i][j] = (hw[bh][bw] == 1 ? -1 : 0);
      hw2[i][j] = hw[i][w+1] + hw[h+1][j];
      ans = max(ans,hw2[i][j]);
    }
  }

  printf("%d\n", ans);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:57:7: error: 'hw2' undeclared (first use in this function); did you mean 'h2'?
   57 |       hw2[i][j] = (hw[bh][bw] == 1 ? -1 : 0);
      |       ^~~
      |       h2
main.c:57:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#define rep(i,n) for(int i=0; i< (int)(n); i++)
#define rep2(j,n) for(int j=0; j< (int)(n); j++)
#define max(x,y) x>y?x:y

int main() {
  int h,w,m;
  scanf("%d %d %d\n", h,w,m);
  int hw[h+1][w+1];
  rep(i,h+1){
    rep2(j,w+1){
      hw[i][j] = 0;
    }
  }

  int bh,bw;
  rep(i,m){
    scanf("%d %d\n", &bh,&bw);
    hw[bh][bw] = 1;  
  }

  int sumh;
  rep(i,h){
    rep2(j,w){
      if(hw[i][j] = 1){
        sumh += 1;
      }  
    }
    hw[i][w+1] = sumh;
  }

  int sumw;
  rep(i,w){
    rep2(j,h){
      if(hw[i][j] = 1){
        sumw += 1;
      }  
    }
    hw[h+1][j] = sumw;
  }

  int maxh = -1;
  int maxw = -1;
  
  rep(i,h){
    maxh = max(maxh,hw[i][w+1])
  }
  rep(i,w){
    maxw = max(maxh,hw[h+1][i])
  }

  int ans = -100;
  int h2[h][w];
  rep(i,h){
    rep2(j,w){
      hw2[i][j] = (hw[bh][bw] == 1 ? -1 : 0);
      hw2[i][j] = hw[i][w+1] + hw[h+1][j];
      ans = max(ans,hw2[i][j])
    }
  }

  printf("%d\n", ans);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:40:13: error: 'j' undeclared (first use in this function)
   40 |     hw[h+1][j] = sumw;
      |             ^
main.c:40:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:48:3: error: expected ';' before '}' token
   48 |   }
      |   ^
main.c:51:3: error: expected ';' before '}' token
   51 |   }
      |   ^
main.c:57:7: error: 'hw2' undeclared (first use in this function); did you mean 'h2'?
   57 |       hw2[i][j] = (hw[bh][bw] == 1 ? -1 : 0);
      |       ^~~
      |       h2
main.c:60:5: error: expected ';' before '}' token
   60 |     }
      |     ^
Language: C++

https://atcoder.jp/contests/abc176/standings/virtual#include <cstdio>
#include <unordered_set>
#include <utility>
using namespace std;
using ll = long long;

struct phash {
	inline size_t operator()(const pair<int, int> &p) const {
		const auto h1 = hash<int>()(p.first);
		const auto h2 = hash<int>()(p.second);
		return h1 ^ (h2 << 1);
	}
};

int main() {
	int H, W, M;
	scanf("%d%d%d", &H, &W, &M);
	unordered_set<pair<int, int>, phash> tg;
	int *sumr, *sumc;
	sumr = new int[H]();
	sumc = new int[W]();
	for (int i = 0; i < M; i++) {
		int h, w;
		scanf("%d%d", &h, &w);
		h--, w--;
		tg.insert(make_pair(h, w));
		sumr[h]++;
		sumc[w]++;
	}

	unordered_set<int> maxi, maxj;
	int maxsumr = 0, maxsumc = 0;
	for (int i = 0; i < H; i++) {
		if (sumr[i] > maxsumr) {
			maxi.clear();
			maxsumr = sumr[i];
			maxi.insert(i);
		} else if (sumr[i] == maxsumr) {
			maxi.insert(i);
		}
	}
	for (int j = 0; j < W; j++) {
		if (sumc[j] > maxsumc) {
			maxj.clear();
			maxsumc = sumc[j];
			maxj.insert(j);
		} else if (sumc[j] == maxsumc) {
			maxj.insert(j);
		}
	}
	ll n = maxi.size() * maxj.size();
	for (auto p : tg) {
		if (maxi.count(p.first) && maxj.count(p.second)) {
			n--;
		}
		if (n == 0) {
			break;
		}
	}
	printf("%d\n", maxsumr + maxsumc - (n == 0));
	return 0;
}


Compiler output:
a.cc:1:1: error: 'https' does not name a type
    1 | https://atcoder.jp/contests/abc176/standings/virtual#include <cstdio>
      | ^~~~~
In file included from /usr/include/c++/14/unordered_set:40,
                 from a.cc:2:
/usr/include/c++/14/initializer_list:51:15: error: 'size_t' does not name a type
   51 |       typedef size_t            size_type;
      |               ^~~~~~
/usr/include/c++/14/initializer_list:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | // std::initializer_list support -*- C++ -*-
/usr/include/c++/14/initializer_list:57:7: error: 'size_type' does not name a type
   57 |       size_type                 _M_len;
      |       ^~~~~~~~~
/usr/include/c++/14/initializer_list:60:54: error: 'size_type' has not been declared
   60 |       constexpr initializer_list(const_iterator __a, size_type __l)
      |                                                      ^~~~~~~~~
/usr/include/c++/14/initializer_list:68:17: error: 'size_type' does not name a type
   68 |       constexpr size_type
      |                 ^~~~~~~~~
/usr/include/c++/14/initializer_list:45:11: fatal error: definition of 'class std::initializer_list<_E>' does not match '#include <initializer_list>'
   45 |     class initializer_list
      |           ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

#define rep(i,n) for(int i=0; i< (int)(n); i++)
#define rep2(j,n) for(int j=0; j< (int)(n); j++)
#define max(x,y) x>y?x:y

int main() {
  int h,w,m;
  scanf("%d %d %d\n", h,w,m);
  int hw[h+1][w+1];
  rep(i,h+1){
    rep2(j,w+1){
      hw[i][j] = 0;
    }
  }

  int bh,bw;
  rep(i,m){
    scanf("%d %d\n", &bh,&bw);
    hw[bh][bw] = 1;  
  }

  int sumh;
  rep(i,h){
    rep2(j,w){
      if(hw[i][j] = 1){
        sumh += 1;
      }  
    }
    hw[i][w+1] = sumh;
  }

  int sumw;
  rep(i,w){
    rep2(j,h){
      if(hw[i][j] = 1){
        sumw += 1;
      }  
    }
    hw[h+1][j] = sumw;
  }

  int maxh = -1;
  int maxw = -1;
  
  rep(i,h){
    maxh = max(maxh,hw[i][w+1])
  }
  rep(i,w){
    maxw = max(maxh,hw[h+1][i])
  }

  int ans;
  rep(i,h){
    rep2(j,w){
      hw2[i][j] = (hw[bh][bw] == 1 ? -1 : 0);
      ans = hw[i][w+1] + hw[h+1][j];
    }
  }

  printf("%d\n", ans);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:40:13: error: 'j' undeclared (first use in this function)
   40 |     hw[h+1][j] = sumw;
      |             ^
main.c:40:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:48:3: error: expected ';' before '}' token
   48 |   }
      |   ^
main.c:51:3: error: expected ';' before '}' token
   51 |   }
      |   ^
main.c:56:7: error: 'hw2' undeclared (first use in this function); did you mean 'hw'?
   56 |       hw2[i][j] = (hw[bh][bw] == 1 ? -1 : 0);
      |       ^~~
      |       hw
Language: C

#include<stdio.h>

#define rep(i,n) for(int i=0; i< (int)(n); i++)
#define re2(j,n) for(int j=0; j< (int)(n); j++)
#define max(x,y) x>y?x:y

int main() {
  int h,w,m;
  scanf("%d %d %d\n", h,w,m);
  int hw[h+1][w+1];
  rep(i,h+1){
    rep2(j,w+1){
      hw[i][j] = 0;
    }
  }

  int bh,bw;
  rep(i,m){
    scanf("%d %d\n", &bh,&bw);
    hw[bh][bw] = 1;  
  }

  int sumh;
  rep(i,h){
    rep2(j,w){
      if(hw[i][j] = 1){
        sumh += 1;
      }  
    }
    hw[i][w+1] = sumh;
  }

  int sumw;
  rep(i,w){
    rep2(j,h){
      if(hw[i][j] = 1){
        sumw += 1;
      }  
    }
    hw[h+1][j] = sumw;
  }

  int maxh = -1;
  int maxw = -1;
  
  rep(i,h){
    maxh = max(maxh,hw[i][w+1])
  }
  rep(i,w){
    maxw = max(maxh,hw[h+1][i])
  }

  int ans;
  rep(i,h){
    rep2(j,w){
      hw2[i][j] = (hw[bh][bw] == 1 ? -1 : 0);
      ans = hw[i][w+1] + hw[h+1][j];
    }
  }

  printf("%d\n", ans);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:5: error: implicit declaration of function 'rep2'; did you mean 'rep'? [-Wimplicit-function-declaration]
   12 |     rep2(j,w+1){
      |     ^~~~
      |     rep
main.c:12:10: error: 'j' undeclared (first use in this function)
   12 |     rep2(j,w+1){
      |          ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:16: error: expected ';' before '{' token
   12 |     rep2(j,w+1){
      |                ^
      |                ;
main.c:25:14: error: expected ';' before '{' token
   25 |     rep2(j,w){
      |              ^
      |              ;
main.c:35:14: error: expected ';' before '{' token
   35 |     rep2(j,h){
      |              ^
      |              ;
main.c:48:3: error: expected ';' before '}' token
   48 |   }
      |   ^
main.c:51:3: error: expected ';' before '}' token
   51 |   }
      |   ^
main.c:55:14: error: expected ';' before '{' token
   55 |     rep2(j,w){
      |              ^
      |              ;
Language: C

#include<stdio.h>

int main(){
  int H,W,m,hmax=0,wmax=0;
  
  scanf("%d %d %d",&H,&W,&m);
  
  int hbomb[H+1],h[m+1],wbomb[W+1],w[m+1];
  
  for(int i=1;i<=H;i++){
    hbomb[i]=0;
  }
  
  for(int i=1;i<=W;i++){
    wbomb[i]=0;
  }
  
  for(int i=1;i<=m;i++){
    scanf("%d %d",&h[i],&w[i]);
    hbomb[h[i]]+=1;
    wbomb[w[i]]+=1;
  }
  
  for(int i=1;i<=H;i++){
    if(hmax<hbomb[i])hmax=hbomb[i];
  }
  
  for(int i=1;i<=W;i++){
    if(wmax<wbomb[i])wmax=wbomb[i];
  }
  
  int hbox[H+1],wbox[W+1];
  int hcount=0,wcount=0,count=0;
  
  for(int i=1;i<=H,i++){
    if(hbomb[i]==hmax){hbox[i]=1;hcount+=1;}
    else{hbox[i]=0;}
  }
  
  for(int i=1;i<=W,i++){
    if(wbomb[i]==wmax){wbox[i]=1;wcount+=1;}
    else{wbox[i]=0;}
  }
  
  for(int i=1;i<=m;i++){
    if(hbox[h[i]]==1 && wbox[w[i]]==1)count+=1;
  }
  
  if(count<hcount*wcount){printf("%d",hmax+wmax);return 0;}
  else{printf("%d",hmax+wmax-1);return 0;}
}

Compiler output:
main.c: In function 'main':
main.c:35:23: error: expected ';' before ')' token
   35 |   for(int i=1;i<=H,i++){
      |                       ^
      |                       ;
main.c:40:23: error: expected ';' before ')' token
   40 |   for(int i=1;i<=W,i++){
      |                       ^
      |                       ;