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

imos(table, 0, y_ + 1, x_ + 1, y_ + K + 1);
                        imos(table, x_ + K + 1, y_ + 1, 2 * K, y_ + K + 1);
                }
        }
 
        for(int i=0;i<2*K;i++){
                for(int j=1;j<2*K;j++){
                        table[i][j] += table[i][j-1];
                }
        }
        for(int i=1;i<2*K;i++){
                for(int j=0;j<2*K;j++){
                        table[i][j] += table[i-1][j];
                }
        }
        int max_count = 0;
 
        for(int i=0;i<2*K;i++){
                for(int j=0;j<2*K;j++){
                        if(max_count < table[i][j])
                                max_count = table[i][j];
                }
        }
 
        std::cout << max_count << std::endl;
 
 
        return 0;
 
}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | imos(table, 0, y_ + 1, x_ + 1, y_ + K + 1);
      |     ^
a.cc:2:29: error: expected constructor, destructor, or type conversion before '(' token
    2 |                         imos(table, x_ + K + 1, y_ + 1, 2 * K, y_ + K + 1);
      |                             ^
a.cc:3:17: error: expected declaration before '}' token
    3 |                 }
      |                 ^
a.cc:4:9: error: expected declaration before '}' token
    4 |         }
      |         ^
a.cc:6:9: error: expected unqualified-id before 'for'
    6 |         for(int i=0;i<2*K;i++){
      |         ^~~
a.cc:6:21: error: 'i' does not name a type
    6 |         for(int i=0;i<2*K;i++){
      |                     ^
a.cc:6:27: error: 'i' does not name a type
    6 |         for(int i=0;i<2*K;i++){
      |                           ^
a.cc:11:9: error: expected unqualified-id before 'for'
   11 |         for(int i=1;i<2*K;i++){
      |         ^~~
a.cc:11:21: error: 'i' does not name a type
   11 |         for(int i=1;i<2*K;i++){
      |                     ^
a.cc:11:27: error: 'i' does not name a type
   11 |         for(int i=1;i<2*K;i++){
      |                           ^
a.cc:18:9: error: expected unqualified-id before 'for'
   18 |         for(int i=0;i<2*K;i++){
      |         ^~~
a.cc:18:21: error: 'i' does not name a type
   18 |         for(int i=0;i<2*K;i++){
      |                     ^
a.cc:18:27: error: 'i' does not name a type
   18 |         for(int i=0;i<2*K;i++){
      |                           ^
a.cc:25:14: error: 'cout' in namespace 'std' does not name a type
   25 |         std::cout << max_count << std::endl;
      |              ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | imos(table, 0, y_ + 1, x_ + 1, y_ + K + 1);
a.cc:28:9: error: expected unqualified-id before 'return'
   28 |         return 0;
      |         ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

int main(){
    
    int n,k;
    int x[100001],y[100001];
    char c[100001];
    int col,count,max=0;
    scanf("%d",&n);
    scanf("%d",&k);

    for(int i=1;i<=n;i++){
        scanf("%d%d%c",&x[i],&y[i],&c[i]);
        if(c[i]=='W'){
            x[i]+=k;
        }
    }
    for(int u=0;u<=k-1;u++){
        for(int v=0;v<=k-1;v++){
            count=0;
            for(int i=1;i<=n;i++){
                col=0;
                x[i]+=u;
                y[i]+=v;

                x[i]=x[i]%2k;
                y[i]=y[i]%2k;

                if(k<=x[i]){
                    col=!col;
                }
                if(k<=y[i]){
                    col=!col;
                }

                if(col)count++;
            }
            if(max<count)max=count;
            if(max<n-count)max=n-count;
        }
    }

    printf("%d",max);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: fixed-point types not supported in C++
   29 |                 x[i]=x[i]%2k;
      |                           ^~
a.cc:30:27: error: fixed-point types not supported in C++
   30 |                 y[i]=y[i]%2k;
      |                           ^~
Language: C++

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

int main(){
    
    int n,k;
    int x[100001],y[100001];
    char c[100001];
    int col,count,max=0;
    scanf("%d",&n);
    scanf("%d",&k);

    for(int i=1;i<=n;i++){
        scanf("%d%d%c",&x[i],&y[i],&c[i]);
        if(c[i]=='W'){
            x[i]+=k;
        }
        x[i]/=2*k;
        y[i]/=2*k;
    }
    for(int x=0;x<=k-1;x++){
        for(int y=0;y<=k-1;y++){
            count=0;
            for(int i=1;i<=n;i++){
                col=0;
                if(k<=x[i]){
                    col=!col;
                }
                if(k<=y[i]){
                    col=!col;
                }

                if(col=0)count++;
            }
            if(max<count)max=count;
            if(max<n-count)max=n-count;
        }
    }

    printf("%d",max);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:24: error: invalid types 'int[int]' for array subscript
   28 |                 if(k<=x[i]){
      |                        ^
a.cc:31:24: error: invalid types 'int[int]' for array subscript
   31 |                 if(k<=y[i]){
      |                        ^
Language: C

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

int main(){
    
    int n,k,x[100001],y[100001];
    char c[100001];
    int col,count,max=0;
    scanf("%d",&n);
    scanf("%d",&k);

    for(int i=1;i<=n;i++){
        scanf("%d%d%c",&x[i],&y[i],&c[i]);
        if(c[i]=='W'){
            x[i]+=k;
        }
        x[i]/=2*k;
        y[i]/=2*k;
    }
    for(int x=0;x<=k-1;x++){
        for(int y=0;y<=k-1;y++){
            count=0;
            for(int i=1;i<=n;i++){
                col=0;
                if(k<=x[i])col=!col;
                if(k<=y[i])col=!col;

                if(col=0)count++;
            }
            if(max<count)max=count;
            if(max<n-count)max=n-count;
        }
    }

    printf("%d",max);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:24: error: subscripted value is neither array nor pointer nor vector
   27 |                 if(k<=x[i])col=!col;
      |                        ^
main.c:28:24: error: subscripted value is neither array nor pointer nor vector
   28 |                 if(k<=y[i])col=!col;
      |                        ^
Language: C++

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

int main(){
    
    int n,k,x[100001],y[100001];
    char c[100001];
    int col,count,max=0;
    scanf("%d",&n);
    scanf("%d",&k);

    for(int i=1;i<=n;i++){
        scanf("%d%d%c",&x[i],&y[i],&c[i]);
        if(c[i]=='W'){
            x[i]+=k;
        }
        x[i]/=2*k;
        y[i]/=2*k;
    }
    for(int x=0;x<=k-1;x++){
        for(int y=0;y<=k-1;y++){
            count=0;
            for(int i=1;i<=n;i++){
                col=0;
                if(k<=x[i])col=!col;
                if(k<=y[i])col=!col;

                if(col=0)count++;
            }
            if(max<count)max=count;
            if(max<n-count)max=n-count;
        }
    }

    printf("%d",max);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: error: invalid types 'int[int]' for array subscript
   27 |                 if(k<=x[i])col=!col;
      |                        ^
a.cc:28:24: error: invalid types 'int[int]' for array subscript
   28 |                 if(k<=y[i])col=!col;
      |                        ^
Language: C++

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

int main(){
    
    int n,k,x[100001],y[100001];
    char c[100001];
    int col,count,max=0;
    scanf("%d",&n);
    scanf("%d",&k);

    for(int i=1;i<=n;i++){
        scanf("%d%d%c",&x[i],&y[i],&c[i]);
        if(c[i]=='W'){
            x[i]+=k;
        }
        x[i]/=2*k;
        y[i]/=2*k;
    }
    for(int x=0;x<=k-1;x++){
        for(int y=0;y<=k-1;y++){
            count=0;
            for(int i=1;i<=n;i++){
                col=0
                if(k<=x[i])col=!col;
                if(k<=y[i])col=!col;

                if(col=0)count++;
            }
            if(max<count)max=count;
            if(max<n-count)max=n-count;
        }
    }

    printf("%d",max);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: expected ';' before 'if'
   26 |                 col=0
      |                      ^
      |                      ;
   27 |                 if(k<=x[i])col=!col;
      |                 ~~    
a.cc:28:24: error: invalid types 'int[int]' for array subscript
   28 |                 if(k<=y[i])col=!col;
      |                        ^
Language: C++

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

int main(){
    
    int n,k,x[100001],y[100001];
    char c[100001];
    int col,count,max=0;
    scanf("%d",&n);
    scanf("%d",&k);

    for(int i=1;i<=n;i++){
        scanf("%d%d%c",x[i],y[i],c[i]);
        if(c[i]=='W'){
            x[i]+=k;
        }
        x[i]/=2*k;
        y[i]/=2*k;
    }
    for(int x=0;x<=k-1;x++){
        for(int y=0;y<=k-1;y++){
            count=0;
            for(int i=1;i<=n;i++){
                col=0
                if(k<=x[i])col=!col;
                if(k<=y[i])col=!col;

                if(col=0)count++;
            }
            if(max<count)max=count;
            if(max<n-count)max=n-count;
        }
    }

    printf("%d",max);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: expected ';' before 'if'
   26 |                 col=0
      |                      ^
      |                      ;
   27 |                 if(k<=x[i])col=!col;
      |                 ~~    
a.cc:28:24: error: invalid types 'int[int]' for array subscript
   28 |                 if(k<=y[i])col=!col;
      |                        ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iomanip>

using namespace std;

int v[2001][2001];
int n,k;
int num(int x1,int y1,int x2,int y2){
    return v[x2][y2] - v[x2][y1] - v[x1][y2] + v[x1][y1];///前缀和 减去左边 下边和左下边的k宫格前缀和  容斥定理：左边和下边都包含了左下边 需要加上一个左下边
}
int main()
{
    int x,y;
    char ch;
    scanf("%d%d",&n,&k);
    for(int i = 1;i <= n;i ++){
        scanf("%d%d %c",&x,&y,&ch);
        x %= 2 * k;///把所有点都移动到 2k * 2k 的区域
        y %= 2 * k;
        x += k * (c == 'W');///x可以变成y W 也可以变成 B 这里白色都变成黑色的 如果转换后的黑色是满足的那么原来的白色也一定是满足的
        v[a % (2 * k) + 1][x % (2 * k) + 1] ++;///求前缀和要求从（1,1）开始
    }
    for(int i = 1;i <= 2 * k;i ++)///求前缀和
        for(int j = 1;j <= 2 * k;j ++)
            v[i][j] += v[i - 1][j] + v[i][j - 1] - v[i - 1][j - 1];///加上左边下边和左下角的和  容斥定理：左边和下边的都包含了左下边的  要减去一个左下边的
    int ans = 0,sum;
    for(int i = 1;i <= k;i++)///k * k个格子依次做为起点构成新的k宫格 也就是移动k宫格 看看有几个黑色点包含在内 （默认黑色 可互换）
        for(int j = 1;j <= k;j++)
        {
            ///斜对角的k宫格是相同颜色 2k * 2k区域最多有五个这样的区域
            sum = num(0,0,i,j) + num(i,j,k + i,k + j) + num(k + i,k + j,2 * k,2 * k) + num(k + i,0,2 * k,j) + num(0,k + j,i,2 * k);
            ans = max(ans,max(sum,n - sum));///黑白色可以互换
        }
    printf("%d\n",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:19: error: 'c' was not declared in this scope
   25 |         x += k * (c == 'W');///x可以变成y W 也可以变成 B 这里白色都变成黑色的 如果转换后的黑色是满足的那么原来的白色也一定是满足的
      |                   ^
a.cc:26:11: error: 'a' was not declared in this scope
   26 |         v[a % (2 * k) + 1][x % (2 * k) + 1] ++;///求前缀和要求从（1,1）开始
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iomanip>

using namespace std;
struct color
{
    int x,y,no;
}s[100000];
int n,k,ans,sum;
int v[2000][2000];
int main()
{
    char ch;
    scanf("%d%d",&n,&k);
    for(int i = 0;i < n;i ++)
    {
        scanf("%d %d %c",&s[i].x,&s[i].y,&ch);
        s[i].x %= k * 2;
        s[i].y %= k * 2;
        s[i].no = (ch == 'W' ? 1 : 0);
    }
    for(int i = 0;i < k;i ++)
    {
        sum = dif = 0;
        for(int j = 0;j < n;j ++)
        {
            int p = s[j].x >= i && s[j].x < i + k;
            int q = s[j].y >= i && s[j].y < i + k;
            if(p ^ q ^ s[j].no == 0)sum ++;
        }
        ans = max(ans,max(sum,n - sum));
    }
    printf("%d",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:15: error: 'dif' was not declared in this scope; did you mean 'div'?
   29 |         sum = dif = 0;
      |               ^~~
      |               div
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define INT(x) int x; scanf("%d",&x)
#define LL(x) ll x; scanf("%lld",&x)
#define INPUT(x) cin >> x
#define REP1(x,n) for(int x = 0; x < n; x++)
#define REP2(x,s,e) for(int x = s; x <= e; x++)
#define RREP1(x,n) for(int x = n-1; x >= 0; x--)
#define RREP2(x,s,e) for(int x = s; x >= e; x--)
#define BR printf("\n")
#define INF_INT 2147483647
#define INF_LL 9223372036854775807

typedef long long ll;

int main(){
    INT(N);INT(K);
    int table[1000][1000] = {};
    
    if(K == 1) wile(1){}
    
    REP1(i, N){
        char c;
        INT(x);INT(y);INPUT(c);
        
        if((x % (2*K) >= K && y % (2*K) < K ) || (y % (2*K) >= K && x % (2*K) < K )){
            c = (c == 'W')? 'B': 'W';
        }
        
        x %= K;
        y %= K;
        
        if(c == 'W'){
            
            table[y][0]++;
            if(x+1 != K){
                table[y][x+1] -= 2;
                table[K-1][x+1]++;
            }
        }else{
            table[K-1][0]++;
            
            table[y][0]--;
            if(x+1 != K){
                table[y][x+1] += 2;
                table[K-1][x+1]--;
            }
        }
    }
    
    //累積和
    REP1(i,K){
        REP1(j,K-1){
            table[i][j+1] += table[i][j];
        }
    }
    REP1(j,K){
        RREP1(i,K-1){
            table[i][j] += table[i+1][j];
        }
    }
    
    int maxx = 0;
    
    REP1(i,K){
        REP1(j,K){
            maxx = max(table[i][j], maxx);
        }
    }
    
    cout << maxx << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: 'wile' was not declared in this scope
   28 |     if(K == 1) wile(1){}
      |                ^~~~
Language: C++

#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <functional>

using namespace std;
using ll = long long;

#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define REP(i,n) for(int i = 0; i < int(n); i++)
#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VL vector<ll>
#define VVL vector<vector<ll>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define PAIR pair<int,int>
#define MP make_pair
#define VP vector<pair<int,int>>
#define VS vector<string>
#define QUE queue<int>
#define DEQ deque<int>
#define PQUE priority_queue<int> //5,5,4,3,3,2,...
#define REPQUE priority_queue<int, vector<int>, greater<int>> //1,1,2,3,4,4,5,...
#define SUM(obj) accumulate((obj).begin(), (obj).end(), 0)
#define SORT(obj) sort((obj).begin(), (obj).end()) // 1,2,3,4,5...
#define RESORT(obj) sort((obj).begin(), (obj).end(), greater<int>()) // 5,4,3,2,1...
#define UB(obj,n) upper_bound((obj).begin(), (obj).end(), n) //itr > n
#define LB(obj,n) lower_bound((obj).begin(), (obj).end(), n) //itr>= n

const ll MOD = (ll)1e9 + 7;

int main() {
	int N, K;
	cin >> N >> K;
	VVI xy(4*K,VI(4*K,0));
	REP(i, N) {
		ll xx, yy;
		string cc;
		cin >> xx >> yy >> cc;
		if (cc == "W") xx += (ll)K;
		xx %= (ll)(2 * K);
		yy %= (ll)(2 * K);
		xy[(int)xx][(int)yy]++;
		xy[(int)xx+ 2 * K][(int)yy]++;
		xy[(int)xx][(int)yy+2 * K]++;
		xy[(int)xx + 2 * K][(int)yy + 2 * K]++;
	}

	VVI s(2 * K, VI(2 * K, 0));
	REP(i, K) REP(j, K) s[0][0] += xy[i][j];
	
	REP(i,2*K) {
		REP(j, 2 * K) {
			int R = 0, L = 0;

			if ((i == 0) && (j != 0)) {
				int T = 0, B = 0;
				REP(l, i, i + K) {
					B += xy[l][j - 1];
					T += xy[l][j - 1 + K];
				}
				s[0][j] = s[0][j - 1] + T - B;
			}

			if (i != 0) {
				FOR(k, j, j + K) {
					L += xy[i - 1][k];
					R += xy[i - 1 + K][k];
				}
				s[i][j] = s[i - 1][j] + R - L;
			}
		}
	}
	int maxs = 0;
	REP(i, 2 * K) REP(j, 2 * K) maxs = (maxs, s[i][j] + s[(i + K) % (2 * K)][(j + K) % (2 * K)]);
	cout << maxs << endl;	
}


Compiler output:
a.cc:70:48: error: macro "REP" passed 3 arguments, but takes just 2
   70 |                                 REP(l, i, i + K) {
      |                                                ^
a.cc:20:9: note: macro "REP" defined here
   20 | #define REP(i,n) for(int i = 0; i < int(n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:70:33: error: 'REP' was not declared in this scope
   70 |                                 REP(l, i, i + K) {
      |                                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
 
#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
#define FF first
#define SS second
 
#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}
 
 
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;
 
LL N, K;
int bb[4010][4010];
int ww[4010][4010];
 
int bacc[4010][4010];
int wacc[4010][4010];
int bsum(int x1, int y1, int x2, int y2){
  return bacc[y2][x2] - bacc[y2][x1] - bacc[y1][x2] + bacc[y1][x1];
}
int wsum(int x1, int y1, int x2, int y2){
  return wacc[y2][x2] - wacc[y2][x1] - wacc[y1][x2] + wacc[y1][x1];
}
 
int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
 
  cin >> N >> K;
 
  int K2 = K * 2;
  REP(i,N){
	int x, y;
	char c;
	cin >> x >> y >> c;
	x %= K2;
	y %= K2;
	if(c == 'B'){
	  bb[y][x]++;
	  bb[y+K2][x]++;
	  bb[y][x+K2]++;
	  bb[y+K2][x+K2]++;
	}
	else{
	  ww[y][x]++;
	  ww[y+K2][x]++;
	  ww[y][x+K2]++;
	  ww[y+K2][x+K2]++;
	}
  }
 
  REP(y,K2*2) REP(x,K2*2){
	bacc[y+1][x+1] += bb[y][x] + bacc[y+1][x] + bacc[y][x+1] - bacc[y][x];
	wacc[y+1][x+1] += ww[y][x] + wacc[y+1][x] + wacc[y][x+1] - wacc[y][x];
  }
 
  int ans = 0;
  REP(y1,K2) REP(x1,K2){
	int x2 = x1 + K, y2 = y1 + K;
	int sum = bsum(x1, y1, x2, y2) + bsum(x2, y2, x2+K, y2+K);
	sum += wsum(x2, y1, x2+K, y2) + wsum(x1, y2, x2, y2+K);
 
	//cout<<x1<<","<<y1<<":"<<sum<<endl;
	//maxi(ans, sum);
  }
  cout << sum << endl;
 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:118:11: error: 'sum' was not declared in this scope; did you mean 'wsum'?
  118 |   cout << sum << endl;
      |           ^~~
      |           wsum
Language: C++

#include<iostream>
#include<vector>
#include<queue>

using namespace std;

int main (void) {
  int N=0;
  int K=0;
  int ans1=0;
  int ans2=0;
  cin >> N >> K;
  int x[N] = {0};
  int y[N] = {0};
  int z[N] = {0};
  string str = "";
  int a=0;
  for (int i =0 ; i<N; i++) {
    cin >> x[i] >> y[i] >> str;
  x[i]=(x[i]+y[i])/2K;
  if ( str=="W") {
    a=int(1);
  }
  else {
    a=int(0);
  }
  z[i]=x[i]+a;
  }
  for (int j=0; j<N; j++) {
    if (z[j]%2==0) {
      ans1= ans1 +1;
    }
    else {
      ans2 = ans2 +1;
    }
  }
  cout << max(ans1, ans2) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: fixed-point types not supported in C++
   20 |   x[i]=(x[i]+y[i])/2K;
      |                    ^~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<cmath>
#include<map>
#include<set>
using namespace std;
#define LL long long
int n,k,m,sb[2010][2010],sw[2010][2010],p,q;
void clear()
{
	memset(sb,0,sizeof(sb));
	memset(sw,0,sizeof(sw));
}
void cal()
{
	for(int i=1;i<=m;i++)
	for(int j=1;j<=m;j++)
	{
		sb[i][j]+=sb[i][j-1]+sb[i-1][j]-sb[i-1][j-1];
		sw[i][j]+=sw[i][j-1]+sw[i-1][j]-sw[i-1][j-1];
	}
}
int calb(int mx,int my,int nx,int ny)
{
	mx+=p;nx+=p;
	my+=q;ny+=q;
	if(mx>m||my>m||nx<1||ny<1)return 0;
	mx=max(1,mx);my=max(1,my);
	nx=min(m,nx);ny=min(m,ny);
	return sb[nx][ny]-sb[nx][my-1]-sb[mx-1][ny]+sb[mx-1][my-1];
}
int calw(int mx,int my,int nx,int ny)
{
	mx+=p;nx+=p;
	my+=q;ny+=q;
	if(mx>m||my>m||nx<1||ny<1)return 0;
	mx=max(1,mx);my=max(1,my);
	nx=min(m,nx);ny=min(m,ny);
	return sw[nx][ny]-sw[nx][my-1]-sw[mx-1][ny]+sw[mx-1][my-1];
}
int main()
{
	while(cin>>n>>k)
	{
		clear();
		int x,y;
		char s[3];
		m=k*2;
		for(int i=1;i<=n;i++)
		{
			scanf("%d%d%s",&x,&y,s);
			if(s[0]=='W')
			{
				sw[x%m+1][y%m+1]++;
			}
			else sb[x%m+1][y%m+1]++;
		}
		cal();
		int ans=-1,t;
		for(int i=0;i<=k;i++)
		for(int j=0;j<=k;j++)
		{
			p=i,q=j;
			t=calb(1,1,k,k)+calb(k+1,k+1,k+k,k+k)+calb(-k+1,-k+1,0,0)+calb(-k+1,k+1,0,k+k)+calb(k+1,-k+1,2*k,0)+calw(k+1,1,2*k,k)+calw(1,k+1,k,2*k)+calw(1,-k+1,k,0)+calw(-k+1,1,0,k);
			ans=max(t,ans);
			t=calw(1,1,k,k)+calw(k+1,k+1,k+k,k+k)+calw(-k+1,-k+1,0,0)+calw(-k+1,k+1,0,k+k)+calw(k+1,-k+1,2*k,0)+calb(k+1,1,2*k,k)+calb(1,k+1,k,2*k)+calb(1,-k+1,k,0)+calb(-k+1,1,0,k);
			ans=max(t,ans);
		}
		cout<<ans<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'void clear()':
a.cc:12:9: error: 'memset' was not declared in this scope
   12 |         memset(sb,0,sizeof(sb));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<set>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: Java

public class Main {
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int K = scanner.nextInt();
		String[] c = new String[N];
		int[] a = new int[N];
		int[] b = new int[N];
		int max = 0;
		int min = N;
		for(int i=0;i<N;i++){
			a[i]=scanner.nextInt();
			b[i]=scanner.nextInt();
			c[i]=scanner.next();
		}
		for(int w=0;w<K;w++){
			for(int h=0;h<K;h++){
				int pos = 0;
				for(int j=0;j<N;j++){
					if("B".equals(c[j])){
						if((((a[j]+w)/K)+(b[j]+h)/K)%2==0){
							pos++;
						}
					}
					else{
						if((((a[j]+w)/K)+(b[j]+h)/K)%2!=0){
							pos++;
						}
					}
				}
				if(max<pos){
					max = pos;
				}
				if(min>pos){
					min = pos;
				}
				if(max==N){
					break;
				}
				if(min==0){
					break;
				}

			}
		}
		if(max<N-min){
			max = N - min;
		}
		System.out.println(max);
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		                      ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int K = sc.nextInt();
		
		int[] x = new int[ N ];
		int[] y = new int[ N ];
		boolean[] c = new boolean[ N ];
		boolean[] d = new boolean[ N ];
		
		for(int i = 0 ; i < N ; i ++){
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			c[i] = ( "B".equals( sc.next() ) );
		}
		
		int maxFillCount = 0;
		
		for(int p = 0 ; p < K  ; p++){
			for(int q = 0 ; q < K ; q++){
				for(int i = 0 ; i < N ; i++){
					d[i] = isBlack(K , x[i] - p , y[i] - q );
				int count = Math.max(fillCount(c,d) , N - fillCount(c,d));
				if(maxFillCount < count ){
//					System.out.printf("( %d , %d )\n",p ,q );
					maxFillCount = count;
				}
			}
		}
		
		System.out.println(maxFillCount);
	}
	
	static boolean isBlack(int K , int x , int y){
		int Kx = x / K ;
		int Ky = y / K ;
		
		return ( Kx + Ky ) % 2 == 0 ;
	}
	
	static int fillCount(boolean[] c , boolean[] d){
		int cnt = 0 ;
		for(int i = 0 ; i < c.length ; i ++){
//			System.out.println("c[" + i + "] = " + c[i] + " ,d[" + i + "] = " + d[i] );
			
			if(c[i] == d[i]){
				cnt ++;
			}
		}
		return cnt;
	}
}


Compiler output:
Main.java:38: error: illegal start of expression
	static boolean isBlack(int K , int x , int y){
	^
1 error
Language: C

#include <stdio.h>
int main() {
	int n,k;
	scanf("%d %d",&n,&k);
	int x[n],y[n];
	char c[n];
	for(int i = 0;i < n;i++) scanf("%d %d %c",&x[i],&y[i],&c[i]);
	int box[n][n];
	for(int i = 0;i < n;i++) for(int j = 0;j < n;j++) box[i][j] = 0;
	int xin,yin,check[n+1][n+1];
	for(int i = 0;i < n;i++) for(int j = 0;j < n;j++) check[i][j] = 1;
	for(int i = 0;i < n;i++) {
		xin = x[i] % k; yin = y[i] % k;
		if(c[i] == 'W') {
			for(int j = 0;j < xin;j++) for(int k = yin;k < n+1;k++) check[j][k] = 0;
			for(int j = xin;j < n+1;j++) for(int k = 0;k < yin;k++) check[j][k] = 0;
		}
		if(c[i] == 'B') {
			for(int j = 0;j < xin;j++) for(int k = 0;k < yin;k++) check[j][k] = 0;
			for(int j = xin;j < n+1;j++) for(int k = yin;k < n+1;k++) check[j][k] = 0;
		}
	}
	sum = 0;
	for(int i = 0;i < n;i++) {
		if(i == 0) for(int j = 1;j < n - 1;j++) if(check[i][j] == 1) sum += 1;
		else for(int j = 0;j < n;j++) if(check[i][j] == 1) sum += 1;
	}
	printf("6d",&sum);
	return 0;
}
	
		

Compiler output:
main.c: In function 'main':
main.c:23:9: error: 'sum' undeclared (first use in this function)
   23 |         sum = 0;
      |         ^~~
main.c:23:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int OK[1001][1001], NG[1001][1001];

int main() {
  int N, K;
  cin >> N >> K;

  auto res = 0;

  for(auto i = 0; i < N; ++i) {
    int x, y; char c1;
    cin >> x >> y >> c1;
    x %= 2*K;
    y %= 2*K;
    auto c = (c1=='B') ? 0 : 1;
    for(auto i = 0; i < K; ++i) for(auto j = 0; j < K; ++j) {
      auto t = 0;
      if(y < i || i+K <= y) t ^= 1;
      if(x < j || j+K <= x) t ^= 1;
      if(t == c) ++OK[i][j];
      else       ++NG[i][j];
      res = max({res, OK[i][j], NG[i][j]})
    }
  }

  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:43: error: expected ';' before '}' token
   24 |       res = max({res, OK[i][j], NG[i][j]})
      |                                           ^
      |                                           ;
   25 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const ll inf=(1ll<<61);
const int MX=1e5+9;
int n,k,x,y;
int a[1009][1009][2];
char c;
int cel(int x,int y){
    if(x%y==0)return x/y;
    return x/y+1;
}
int main(){
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++){
        scanf("%d%d%s",&x,&y,&c);
        int x1=cel(x,k);
        int y1=cel(y,k);
        x1--;y1--;
        int n1=x1*k;
        int m1=y1*k;
        if(c=='W'){
            if(a[x-n1][])
        }
    }
    int ans=1;
    for(int i=1;i<=k;i++){
        for(int j=0;j<=k;j++){
            a[i][j]+=a[i-1][j][0];
            a[i][j]+=a[i-1][j][1];
        }
    }
    for(int i=1;i<=k;i++){
        for(int j=0;j<=k;j++){
            a[j][i]+=a[j][i-1][0];
            a[j][i]+=a[j][i-1][1];
        }
    }
    for(int i=0;i<=k;i++){
        for(int j=0;j<=k;j++){
            ans=max(ans,a[i][j][0]);
            ans=max(ans,a[i][j][1]);
        }
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected primary-expression before ']' token
   24 |             if(a[x-n1][])
      |                        ^
a.cc:25:9: error: expected primary-expression before '}' token
   25 |         }
      |         ^
a.cc:30:20: error: incompatible types in assignment of 'int' to 'int [2]'
   30 |             a[i][j]+=a[i-1][j][0];
      |             ~~~~~~~^~~~~~~~~~~~~~
a.cc:31:20: error: incompatible types in assignment of 'int' to 'int [2]'
   31 |             a[i][j]+=a[i-1][j][1];
      |             ~~~~~~~^~~~~~~~~~~~~~
a.cc:36:20: error: incompatible types in assignment of 'int' to 'int [2]'
   36 |             a[j][i]+=a[j][i-1][0];
      |             ~~~~~~~^~~~~~~~~~~~~~
a.cc:37:20: error: incompatible types in assignment of 'int' to 'int [2]'
   37 |             a[j][i]+=a[j][i-1][1];
      |             ~~~~~~~^~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<math.h>
#include <stdlib.h>
using namespace std;
int main(){

	int n,k;
	int x[100000],y[100000];
	string c[100000];
	int color;
	int q[2000][2000][2]={};
	int re[2000][1000]={};
	int ans;
	
	cin >> n >> k;
	for(int i=0;i<n;i++){
		cin >> x[i] >> y[i] >> c[i];
		if(c[i]=="B"){
		color=0;
		}else{
		color=1;
		}
		
		int quotx,quoty;
		quotx=x[i]%(2*k);
		quoty=y[i]%(2*k);
		q[quotx][quoty][color]=q[quotx][quoty][color]+1;
	}
	
	int sum=0;
	for(int i=0;i<k;i++){
	for(int j=0;j<k;j++){
		sum=sum+q[i][j][0]+q[i+k][j+k][0]+q[i][j+k][1]+q[i+k][j][1];
		ans=sum;
	}
	}
	re[0][0]=sum;
	
	for(int i=1;i<2*k;i++){
	sum=0;
	for(int sy=0;sy<k;sy++){
		int sxx = (i+k-1)%(2*k);
		sum=sum-q[i-1][sy][0]+q[sxx][sy+k][0]-q[i-1][sy+k][1]+q[sxx][sy][1];
	}
	re[i][0]=re[i-1][0]+sum;
	if(re[i][0]>ans){
		ans=re[i][0];
	}
	}
	

	for(int j=1;j<k;j++){
	for(int i=0;i<2*k;i++){
	
		sum=0;
		for(int sx=0;sx<2*k;sx++){
			int sxx = (sx+k)%(2*k);
			sum=sum-q[sx][j-1][0]+q[sxx][j+k-1][0]-q[sxx][j-1][1]+q[sx][j+k-1][1];
		}
			re[i][j]=re[i][j-1]+sum;
			
		if(re[i][j]>ans){
		ans=re[i][j];
		}
		
		}
	
	}
	}
	
	cout << ans;
	return 0;

}

Compiler output:
a.cc:72:9: error: 'cout' does not name a type
   72 |         cout << ans;
      |         ^~~~
a.cc:73:9: error: expected unqualified-id before 'return'
   73 |         return 0;
      |         ^~~~~~
a.cc:75:1: error: expected declaration before '}' token
   75 | }
      | ^
Language: C++

#include<iostream>
#include<string>
#include<math.h>
#include <stdlib.h>
using namespace std;
int main(){

	int n,k;
	int x[100000],y[100000];
	string c[100000];
	int color;
	int q[2000][2000][2]={};
	int re[2000][1000]={};
	int ans;
	
	cin >> n >> k;
	for(int i=0;i<n;i++){
		cin >> x[i] >> y[i] >> c[i];
		if(c[i]=="B"){
		color=0;
		}else{
		color=1;
		}
		
		int quotx,quoty;
		quotx=x[i]%(2*k);
		quoty=y[i]%(2*k);
		q[quotx][quoty][color]=q[quotx][quoty][color]+1;
	}
	
	int sum=0;
	for(int i=0;i<k;i++){
	for(int j=0;j<k;j++){
		sum=sum+q[i][j][0]+q[i+k][j+k][0]+q[i][j+k][1]+q[i+k][j][1];
		ans=sum;
	}
	}
	re[0][0]=sum;
	
	for(int i=1;i<2*k;i++){
	sum=0;
	for(int sy=0;sy<k;sy++){
		int sxx = (i+k-1)%(2*k);
		sum=sum-q[i-1][sy][0]+q[sxx][sy+k][0]-q[i-1][sy+k][1]+q[sxx][sy][1];
	}
	re[i][0]=re[i-1][0]+sum;
	if(re[i][0]>ans){
		ans=re[i][0];
	}
	}
	

	for(int j=1;j<k;j++){
	for(int i=0;i<2*k;i++){
	
		sum=0;
		for(int sx=0;sx<2k;sx++){
			int sxx = (sx+k)%(2*k);
			sum=sum-q[sx][j-1][0]+q[sxx][j+k-1][0]-q[sxx][j-1][1]+q[sx][j+k-1][1];
		}
			re[i][j]=re[i][j-1]+sum;
			
		if(re[i][j]>ans){
		ans=re[i][j];
		}
		
		}
	
	}
	}
	
	cout << ans;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:33: error: fixed-point types not supported in C++
   57 |                 for(int sx=0;sx<2k;sx++){
      |                                 ^~
a.cc: At global scope:
a.cc:72:9: error: 'cout' does not name a type
   72 |         cout << ans;
      |         ^~~~
a.cc:74:9: error: expected unqualified-id before 'return'
   74 |         return 0;
      |         ^~~~~~
a.cc:75:1: error: expected declaration before '}' token
   75 | }
      | ^
Language: C++

#include<iostream>
#include<string>
#include<math.h>
#include <stdlib.h>
using namespace std;
int main(){

	int n,k;
	int x[100000],y[100000];
	string c[100000];
	int color;
	int q[2000][2000][2]={};
	int re[2000][1000]={};
	int ans;
	
	cin >> n >> k;
	for(int i=0;i<n;i++){
		cin >> x[i] >> y[i] >> c[i];
		if(c[i]=="B"){
		color=0;
		}else{
		color=1;
		}
		
		int quotx,quoty;
		quotx=x[i]%2k;
		quoty=y[i]%2k;
		q[quotx][quoty][color]=q[quotx][quoty][color]+1;
	}
	
	int sum=0;
	for(int i=0;i<k;i++){
	for(int j=0;j<k;j++){
		sum=sum+q[i][j][0]+q[i+k][j+k][0]+q[i][j+k][1]+q[i+k][j][1];
		ans=sum;
	}
	}
	re[0][0]=sum;
	
	for(int i=1;i<2k;i++){
	sum=0;
	for(int sy=0;sy<k;sy++){
		int sxx = (i+k-1)%2k;
		sum=sum-q[i-1][sy][0]+q[sxx][sy+k][0]-q[i-1][sy+k][1]+q[sxx][sy][1];
	}
	re[i][0]=re[i-1][0]+sum;
	if(re[i][0]>ans){
		ans=re[i][0];
	}
	}
	

	for(int j=1;j<k;j++){
	for(int i=0;i<2k;i++){
	
		sum=0;
		for(int sx=0;sx<2k;sx++){
			int sxx = (sx+k)%2k;
			sum=sum-q[sx][j-1][0]+q[sxx][j+k-1][0]-q[sxx][j-1][1]+q[sx][j+k-1][1];
		}
			re[i][j]=re[i][j-1]+sum;
			
		if(re[i][j]>ans){
		ans=re[i][j];
		}
		
		}
	
	}
	}
	
	cout << ans;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:28: error: fixed-point types not supported in C++
   26 |                 quotx=x[i]%2k;
      |                            ^~
a.cc:27:28: error: fixed-point types not supported in C++
   27 |                 quoty=y[i]%2k;
      |                            ^~
a.cc:40:23: error: fixed-point types not supported in C++
   40 |         for(int i=1;i<2k;i++){
      |                       ^~
a.cc:43:35: error: fixed-point types not supported in C++
   43 |                 int sxx = (i+k-1)%2k;
      |                                   ^~
a.cc:54:23: error: fixed-point types not supported in C++
   54 |         for(int i=0;i<2k;i++){
      |                       ^~
a.cc:57:33: error: fixed-point types not supported in C++
   57 |                 for(int sx=0;sx<2k;sx++){
      |                                 ^~
a.cc:58:42: error: fixed-point types not supported in C++
   58 |                         int sxx = (sx+k)%2k;
      |                                          ^~
a.cc: At global scope:
a.cc:72:9: error: 'cout' does not name a type
   72 |         cout << ans;
      |         ^~~~
a.cc:74:9: error: expected unqualified-id before 'return'
   74 |         return 0;
      |         ^~~~~~
a.cc:75:1: error: expected declaration before '}' token
   75 | }
      | ^
Language: Java

import java.util.Scanner;

public class ABC086_C {
	
	static int FA;
	static int N;
	static int K;
	static int x[];
	static int y[];
	static boolean c[];
	
	public static void main(String[] args) {
		ABC086_C_Ans ans = new ABC086_C_Ans();
		ans.start();
		Scanner scanner = new Scanner(System.in);
		N = scanner.nextInt();
		K = scanner.nextInt();
		x = new int[N+1];
		y = new int[N+1];
		c = new boolean[N+1];
		for (int i = 1; i <= N; i++) {
			x[i] = scanner.nextInt();
			y[i] = scanner.nextInt();
			c[i] = scanner.next().equals("B");
		}
		scanner.close();
		
		for (int heightSlide = 0; heightSlide < K; heightSlide++) {
			ABC086_C_Calc calc = new ABC086_C_Calc(heightSlide);
			calc.start();
		}
		
		System.out.println(FA);
		
	}

}

class ABC086_C_Ans extends Thread {
	@Override
	public void run() {
		try {
			Thread.sleep(1950);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println(Main.FA);
	}
}

class ABC086_C_Calc extends Thread {
	int heightSlide;
	public ABC086_C_Calc(int i) {
		heightSlide = i;
	}
	@Override
	public void run() {
		int answer = 0;
		int answer2 = 0;
		for (int widthSlide = 0; widthSlide < Main.K; widthSlide++) {
			answer = 0;
			answer2 = 0;
			for (int i = 1; i <= Main.N; i++) {
				if (((((Main.x[i] +heightSlide) % (Main.K*2)) - Main.K < 0) ^ (((Main.y[i] + widthSlide) % (Main.K*2)) - Main.K < 0)) == Main.c[i]) {
					answer++;
				} else {
					answer2++;
				}
			}
			Main.FA = Math.max(Main.FA, answer);
			Main.FA = Math.max(Main.FA, answer2);
		}
	}
}

Compiler output:
Main.java:3: error: class ABC086_C is public, should be declared in a file named ABC086_C.java
public class ABC086_C {
       ^
Main.java:39: error: duplicate class: ABC086_C_Ans
class ABC086_C_Ans extends Thread {
^
Main.java:51: error: duplicate class: ABC086_C_Calc
class ABC086_C_Calc extends Thread {
^
Main.java:47: error: cannot access Main
		System.out.println(Main.FA);
		                   ^
  bad source file: ./Main.java
    file does not contain class Main
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
4 errors
Language: Java

		for(int i=0;i<N;i++){
			if(!booleans.get(i)){
				continue;
			}
			for(int w=0;w<K;w++){
				for(int h=0;h<K;h++){
					int pos = 0;
					for(int j=0;j<N;j++){
						if(c.get(i).equals(c.get(j))){
							if(((((((a.get(j)+w)/K)%2)+((b.get(j)+h)/K)%2)))%2==0){
								pos++;
							}
						}
						else{
							if(((((((a.get(j)+w)/K)%2)+((b.get(j)+h)/K)%2)))%2!=0){
								pos++;
							}
						}
					}
					if(max<pos){
						max = pos;
					}
					if(max==N){
						break;
					}
				}
			}
			if(max==N){
				break;
			}
		}
		System.out.println(max);


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
		for(int i=0;i<N;i++){
		^
Main.java:1: error: class, interface, enum, or record expected
		for(int i=0;i<N;i++){
		            ^
Main.java:1: error: class, interface, enum, or record expected
		for(int i=0;i<N;i++){
		                ^
Main.java:4: error: class, interface, enum, or record expected
			}
			^
Main.java:5: error: class, interface, enum, or record expected
			for(int w=0;w<K;w++){
			            ^
Main.java:5: error: class, interface, enum, or record expected
			for(int w=0;w<K;w++){
			                ^
Main.java:6: error: class, interface, enum, or record expected
				for(int h=0;h<K;h++){
				            ^
Main.java:6: error: class, interface, enum, or record expected
				for(int h=0;h<K;h++){
				                ^
Main.java:8: error: class, interface, enum, or record expected
					for(int j=0;j<N;j++){
					^
Main.java:8: error: class, interface, enum, or record expected
					for(int j=0;j<N;j++){
					            ^
Main.java:8: error: class, interface, enum, or record expected
					for(int j=0;j<N;j++){
					                ^
Main.java:12: error: class, interface, enum, or record expected
							}
							^
Main.java:17: error: class, interface, enum, or record expected
							}
							^
Main.java:22: error: class, interface, enum, or record expected
					}
					^
Main.java:25: error: class, interface, enum, or record expected
					}
					^
Main.java:30: error: class, interface, enum, or record expected
			}
			^
16 errors
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n;
  cin>>n;
  vll t(n);
  vll x(n);
  vll y(n);
  rep(i,n) cin>>t[i]>>x[i]>>y[i];
  if(abs(x[i])+abs(y[i])>t[i]&&(abs(x[i])+abs(y[i]))%2==t[i]%2){
    for(int i=1;i<n;i++){
      if(abs(x[i]-x[i-1])+abs(y[i]-y[i-1])>t[i]-t[i-1]&&(abs(x[i]-x[i-1])+abs(y[i]-y[i-1]))%2==(t[i]-t[i-1])%2){
        if(i==n-1){
          COUT("Yes");
        }
        continue;
      }
      else{
        COUT("No");
        break;
      }
    }
  }
  else{
    COUT("No");
  }
}
                           
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:41:12: error: 'i' was not declared in this scope
   41 |   if(abs(x[i])+abs(y[i])>t[i]&&(abs(x[i])+abs(y[i]))%2==t[i]%2){
      |            ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n;
  cin>>n;
  vll t(n);
  vll x(n);
  vll y(n);
  rep(i,n) cin>>t[i]>>x[i]>>y[i];
  if(abs(x[i])+abs(y[i])>t[i]&&(abs(x[i])+abs(y[i]))%2==t[i]%2){
    for(int i=1;i<n;i++){
      if(abs(x[i]-x[i-1])+abs(y[i]-y[i-1])>t[i]-t[i-1]&&(abs(x[i]-x[i-1])+abs(y[i]-y[i-1]))%2==(t[i]-t[i-1])%2){
        continue;
      }
      else{
        COUT("No");
        break;
      }
    }
  }
  else{
    COUT("No");
  }
}
                           
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:41:12: error: 'i' was not declared in this scope
   41 |   if(abs(x[i])+abs(y[i])>t[i]&&(abs(x[i])+abs(y[i]))%2==t[i]%2){
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main() {
    int N;
    int t[110000], x[110000], y[110000];
    cin >> N;
    t[0] = x[0] = y[0] = 0;  
    for (int i = 0; i < N; ++i) cin >> t[i+1] >> x[i+1] >> y[i+1];  

    bool can = true;
    for (int i = 0; i < N; ++i) {
        int dt = t[i+1] - t[i];
        int dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i]);
        if (dt < dist) can = false;
        if (dist % 2 != dt % 2) can = false;
    }

    if (can) cout << "Yes" << endl;
    else cout << "No" << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: expected '}' at end of input
   20 |     else cout << "No" << endl;
      |                               ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int N, curt = 0, curx = 0, cury = 0, t, x, y;
	cin >> N;
	for (int i = 1; i <= N; ++i){
		cin >> t >> x >> y;
		if (t - curt < abs(x-curx)+abs(y-cury) || (abs(x-curx) + abs(y-cury) + t - curt)%2!=0){
			cout << "No\n";
			return;
		}
		curt = t;
		curx = x;
		cury = y;
	}
	cout << "Yes\n";
}

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

#include<bits/stdc++.h>
using namspace std;
int main(){
  int n,x=0,y=0,t=0,a,b,c;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a>>b>>c;
    if(a-t<abs(x-b)+abs(y-c)){
      cout<<"No";
      return 0;
    }else{
      if((a-t-(abs(x-b)+abs(y-c)))%2==1){
        cout<<"No";
        return 0;
      }else{
        t=a;
        x=b;
        y=c;
      }
    }
  }
  cout<<"Yes";
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspace'
    2 | using namspace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |       cout<<"No";
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout<<"No";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |   cout<<"Yes";
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namspace std;
int main(){
  int n,x=0,y=0,t=0,a,b,c;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a>>b>>c;
    if(a-t<abs(x-b)+abs(y-c)){
      cout<<"No";
      return 0;
    }else{
      if((a-t)-(abs(x-b)+abs(y-c))%2==1){
        cout<<"No";
        return 0;
      }else{
        t=a;
        x=b;
        y=c;
      }
    }
  }
  cout<<"Yes";
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspace'
    2 | using namspace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |       cout<<"No";
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout<<"No";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |   cout<<"Yes";
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~