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

#include<iostream>
#include<vector>
#include<map>

using namespace std;

int memo[100][100];
int memo2[100][100][2];
char s[100][100];
int h, w;

int search(int i, int j) {
	int cost = INT_MAX;

	if (memo[i][j] != -1) return memo[i][j];

	if (i == h - 1 && j == w - 1) return int(s[i][j] == '#');
	else if (i == h - 1) {
		memo[i][j] = search(i, j + 1) + (s[i][j] == '#');
		return memo[i][j];
	}
	else if (j == w - 1) {
		memo[i][j] = search(i + 1, j) + (s[i][j] == '#');
		return memo[i][j];
	}
	else {
		int tmp = search(i, j + 1);
		memo[i][j] = search(i + 1, j);
		if (tmp < memo[i][j])memo[i][j] = tmp;
		memo[i][j] += int(s[i][j] == '#');
		return memo[i][j];
	}

	return -1;
}

int search2(int i, int j, int pre_flag) {
	if (memo2[i][j][pre_flag] != -1) return memo2[i][j][pre_flag];
	int flag = (s[i][j] == '#');

	if (i == h - 1 && j == w - 1) {
		memo2[i][j][pre_flag] = flag * !pre_flag;
		return memo2[i][j][pre_flag];
	}
	else if (i == h - 1) {
		memo2[i][j][pre_flag] = search2(i, j + 1, flag) + flag * !pre_flag;
		return memo2[i][j][pre_flag];
	}
	else if (j == w - 1) {
		memo2[i][j][pre_flag] = search2(i + 1, j, flag) + flag * !pre_flag;
		return memo2[i][j][pre_flag];
	}
	else {
		int tmp = search2(i, j + 1, flag);
		memo2[i][j][pre_flag] = search2(i + 1, j, flag);
		if (tmp < memo2[i][j][pre_flag])memo2[i][j][pre_flag] = tmp;
		memo2[i][j][pre_flag] += flag * !pre_flag;
		return memo2[i][j][pre_flag];
	}

	return -1;
}

int main() {

	cin >> h >> w;
	for (int i=0; i < h; i++) {
		for (int j=0; j < w; j++) {
			cin >> s[i][j];
			memo[i][j] = -1;
			memo2[i][j][0] = -1;
			memo2[i][j][1] = -1;
		}
	}
	cout << search2(0, 0, 0) << endl;

	//for (int i = 0; i < h; i++) {
	//	for (int j = 0; j < w; j++) {
	//		cout << s[i][j];
	//	}
	//	cout << endl;
	//}
	//cout << "~~~~~~~~" << endl;
	//for (int i = 0; i < h; i++) {
	//	for (int j = 0; j < w; j++) {
	//		cout << memo[i][j];
	//	}
	//	cout << endl;
	//}
	return 0;
}

Compiler output:
a.cc: In function 'int search(int, int)':
a.cc:13:20: error: 'INT_MAX' was not declared in this scope
   13 |         int cost = INT_MAX;
      |                    ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<map>
  +++ |+#include <climits>
    4 |
Language: C++

#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,n) for(int i=1; i<=(n); i++)

int main() {
	int h,w;
    cin>>h>>w;
    vector<string> grid(h);
    for(int i=0; i<h; i++){
        cin>>grid[i];
    }
    
    vector<vector<int>> dist(h+1,vector<int>(w+1,5000));
    dist[1][1]=0;
    //距離定義
    
    int chgL,chgU;
    //距離決定時の色変更分
    
    while(dist[h][w]>4000){ //ゴール探索するまでor200times
        rep2(i,h){
            rep2(j,w){ //各マスについて
                if(dist[i][j]>4000&&(dist[i][j-1]<4000||dist[i-1][j]<4000)){
                    //最前線判定
                    
                    chgL=0;
                    chgU=0;
                    if(j>1){
                        if(grid[i-1][j-1]!=grid[i-1][j-2])chgL=1;
                    }
                    if(i>1){
                        if(grid[i-1][j-1]!=grid[i-2][j-1])chgU=1;
                    }
                    dist[i][j]=min(dist[i][j-1]+chgL,dist[i-1][j]+chgU);
                    
                }
            }
        }
        
    }
    int a=dist[h][w];
    if(grid[0][0]=='.')cout<<(a+1)/2;
    else cout<<(a/2+1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin>>h>>w;
      |     ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | using namespace std;
a.cc:46:24: error: 'cout' was not declared in this scope
   46 |     if(grid[0][0]=='.')cout<<(a+1)/2;
      |                        ^~~~
a.cc:46:24: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:47:10: error: 'cout' was not declared in this scope
   47 |     else cout<<(a/2+1);
      |          ^~~~
a.cc:47:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>

using namespace std;

int H, W;

void bfs(vector<vector<char>> vec, int r, int c, int count) {
    // 良いマスでなければ塗りつぶす（カウントを増やす）
    if (vec[r][c] == '#') {
        count += 1;
    }

    // ゴールしたら終了
    if (r == H and c == W) {
        cout << count << endl;
        return;
    }

    // 下に行けるか確認
    if (r < H) {
        bfs(vec, r + 1, c, count + 1);
    }

    // 右に行けるか確認
    if (c < W) {
        bfs(vec, r, c + 1, count + 1);
    }
}

int main() {
    cin >> H >> W;
    vector<vector<char>> vec(H, vector<char>(W));

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> vec[i][j];
        }
    }

    bfs(vec, 0, 0, 0);
}

Compiler output:
a.cc:7:6: error: variable or field 'bfs' declared void
    7 | void bfs(vector<vector<char>> vec, int r, int c, int count) {
      |      ^~~
a.cc:7:10: error: 'vector' was not declared in this scope
    7 | void bfs(vector<vector<char>> vec, int r, int c, int count) {
      |          ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:7:17: error: 'vector' was not declared in this scope
    7 | void bfs(vector<vector<char>> vec, int r, int c, int count) {
      |                 ^~~~~~
a.cc:7:17: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:7:24: error: expected primary-expression before 'char'
    7 | void bfs(vector<vector<char>> vec, int r, int c, int count) {
      |                        ^~~~
a.cc:7:36: error: expected primary-expression before 'int'
    7 | void bfs(vector<vector<char>> vec, int r, int c, int count) {
      |                                    ^~~
a.cc:7:43: error: expected primary-expression before 'int'
    7 | void bfs(vector<vector<char>> vec, int r, int c, int count) {
      |                                           ^~~
a.cc:7:50: error: expected primary-expression before 'int'
    7 | void bfs(vector<vector<char>> vec, int r, int c, int count) {
      |                                                  ^~~
a.cc: In function 'int main()':
a.cc:32:5: error: 'vector' was not declared in this scope
   32 |     vector<vector<char>> vec(H, vector<char>(W));
      |     ^~~~~~
a.cc:32:5: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:32:19: error: expected primary-expression before 'char'
   32 |     vector<vector<char>> vec(H, vector<char>(W));
      |                   ^~~~
a.cc:36:20: error: 'vec' was not declared in this scope
   36 |             cin >> vec[i][j];
      |                    ^~~
a.cc:40:9: error: 'vec' was not declared in this scope
   40 |     bfs(vec, 0, 0, 0);
      |         ^~~
a.cc:40:5: error: 'bfs' was not declared in this scope
   40 |     bfs(vec, 0, 0, 0);
      |     ^~~
Language: C++

// #define _CRT_SECURE_NO_WARNINGS
// #define _DEBUG

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

using namespace std;
string line[105];
int counter = 0;
int last_row, last_col;
int dp[105][105];

/*
void traverse(int r, int c) {
	cout << r << " " << c << endl;
	if (r == last_row || c == last_col)
		return;
	
	dp[r + 1][c] = min(dp[r + 1][c], line[r + 1][c] == '#' ? dp[r][c] + 1 : dp[r][c]);
	cout << "dp[r + 1][c] " << dp[r + 1][c] << endl;
	dp[r][c + 1] = min(dp[r][c + 1], line[r][c + 1] == '#' ? dp[r][c] + 1 : dp[r][c]);
	cout << "dp[r][c + 1] " << dp[r][c + 1] << endl;
	cout << "##########" << endl;
	traverse(r + 1, c);
	traverse(r, c + 1);
}
*/

int traverse(int r, int c) {
	if (r == 0 && c == 0) {
		if (line[r][c] == '#')
			dp[0][0] = 1;
		else
			dp[0][0] = 0;
		return dp[0][0];
	}
	if (c < 0 || r < 0)
		dp[r][c] = INT_MAX;
	else {
		if (line[r][c] == '.')
			dp[r][c] = min(traverse(r - 1, c), traverse(r, c - 1));
		else
			dp[r][c] = min(traverse(r - 1, c), traverse(r, c - 1)) + 1;
	}
	return dp[r][c];
}



int main(){
#ifdef _DEBUG
	freopen("in.in", "r", stdin);
#endif
	cin >> last_row >> last_col;
	string str;
	for (int i = 0; i < last_row; i++)
		cin >> line[i];

	/*
	for (int j = 0; j < last_row; j++)
		for (int k = 0; k < last_col; k++)
			dp[j][k] = -1;
	*/
	cout << traverse(last_row - 1, last_col - 1) << endl;
	// cout << dp[last_row - 1][last_col - 1] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int traverse(int, int)':
a.cc:40:28: error: 'INT_MAX' was not declared in this scope
   40 |                 dp[r][c] = INT_MAX;
      |                            ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <vector>
  +++ |+#include <climits>
    7 | #include <string>
Language: Java

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class RangeFlip {
	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		solve(reader, writer);
		reader.close();
		writer.close();
	}

	static int[][] graph = new int[100][100];
	static int h = 0;
	static int w = 0;

	private static void solve(BufferedReader reader, PrintWriter writer) throws IOException {
		String[] temp = reader.readLine().split(" ");
		h = Integer.parseInt(temp[0]);
		w = Integer.parseInt(temp[1]);
		for (int i = 0; i < h; i++) {
			String nextLine = reader.readLine();
			for (int j = 0; j < w; j++) {
				graph[i][j] = nextLine.charAt(j) == '.' ? 0 : 1;
			}
		}
		int cnt = count(0, 0);
		writer.println(cnt);

	}

	static List<Integer> blackCounts = new ArrayList<>();

	private static int count(int i, int j) {
		countPaths(i, j, 0);
		Collections.sort(blackCounts);
		return blackCounts.get(0);
	}

	private static void countPaths(int i, int j, int blackCount) {
		if (i == h - 1 && j == w - 1) {
			blackCounts.add(blackCount);
		} else {
			if (graph[i][j] == 1)
				blackCount++;
			if (i + 1 < h) {
				countPaths(i + 1, j, blackCount);
			}
			if (j + 1 < w) {
				countPaths(i, j + 1, blackCount);
			}
		}
	}

	static class Node {
		int x;
		int y;

		public Node(int a, int b) {
			x = a;
			y = b;
		}
	}
}


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

#include<iostream>
#include<vector>
#include<string>
#define rep(i, n) for (int i=0; i<(n); i++)
using namespace std;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

int p(int s1, int s2, int dp){
    if(s1 == 0 && s2 == 0) return 0;
    if(s1 == 1 && s2 == 1) return 0;
    if(s1 == 1 && s2 == 0) return 1;
    if(dp > 0) return 0;
    else return 1; 
}

int main(){
    int H, W; cin >> H >> W;
    string tmp;
    int s[H+2][W+2], dp[H+2][W+2];
    rep(i, H+2){
        rep(j, W+2) dp[i][j] = 300;
    }
    /*
    rep(i, H+2){
        dp[i][0] = 300;
        dp[i][W+1] = 300;
    }
    rep(i, W+2){
        dp[0][i] = 300;
        dp[H+1][i] = 300;
    }
    */
    for(int i=1; i<H+1; i++){
        cin >> tmp;
        for(int j=0; j<W; j++){
            if(tmp[j] == '#') s[i][j+1] = 0;
            else s[i][j+1] = 1;
        }
    }
    int a, b;
    dp[1][1] = 0;
    for(int i=1; i<H+1; i++){
        for(int j=1; j<W+1; j++){
            if(i == 1 && j == 1) continue;
            a = dp[i][j-1] + p(s[i][j-1], s[i][j], dp[i][j-1]);
            b = dp[i-1][j] + p(s[i-1][j], s[i][j], dp[i-1][j]);
            chmin(dp[i][j], a);
            chmin(dp[i][j], b);
        }
    }
    /*
    for(int i=1; i<H+1; i++){
        for(int j=1; j<W+1; j++) cout << s[i][j] << " ";
        cout << endl;
    }
    cout << endl;
    for(int i=1; i<H+1; i++){
        for(int j=1; j<W+1; j++) cout << dp[i][j] << " ";
        cout << endl;
    }
    */

    if(dp[H][W] == 0 && s[H][W] = 0) dp[H][W]++;
    cout << dp[H][W] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:22: error: lvalue required as left operand of assignment
   69 |     if(dp[H][W] == 0 && s[H][W] = 0) dp[H][W]++;
      |        ~~~~~~~~~~~~~~^~~~~~~~~~
Language: C++

H, W = map(int, input().split())
arr = [list(input()) for i in range(H)]
ans = []

def bfs(r, c, count):
    # マス目をいい状態にする
    if arr[r][c] == '#':
        count += 1

    # ゴールした場合終了
    if r == H - 1 and c == W - 1 :
        ans.append(count)
        return False

    # 下に進める場合は進む
    if r + 1 < H:
        bfs(r + 1, c, count)
    
    # 右に進める場合は進む
    if c + 1 < W:
        bfs(r, c + 1, count)


bfs(0, 0, 0)
print(min(ans))

Compiler output:
a.cc:6:7: error: invalid preprocessing directive #\U000030de\U000030b9\U000076ee\U00003092\U00003044\U00003044\U000072b6\U0000614b\U0000306b\U00003059\U0000308b
    6 |     # マス目をいい状態にする
      |       ^~~~~~~~~~~~~~~~~~~~~~
a.cc:10:7: error: invalid preprocessing directive #\U000030b4\U000030fc\U000030eb\U00003057\U0000305f\U00005834\U00005408\U00007d42\U00004e86
   10 |     # ゴールした場合終了
      |       ^~~~~~~~~~~~~~~~~~
a.cc:15:7: error: invalid preprocessing directive #\U00004e0b\U0000306b\U00009032\U00003081\U0000308b\U00005834\U00005408\U0000306f\U00009032\U00003080
   15 |     # 下に進める場合は進む
      |       ^~~~~~~~~~~~~~~~~~~~
a.cc:19:7: error: invalid preprocessing directive #\U000053f3\U0000306b\U00009032\U00003081\U0000308b\U00005834\U00005408\U0000306f\U00009032\U00003080
   19 |     # 右に進める場合は進む
      |       ^~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'H' does not name a type
    1 | H, W = map(int, input().split())
      | ^
Language: C++

#include<iostream>
#include <vector>
using namespace std;
using Field = vector<vector <char>>;

int rec(Field &field, int h, int w, int y, int x, int &count, vector<int> &cnt){
  
  if (field[y][x] == '#') count++;
  
  if(y==h-1 && x== w-1)	return count;
  
  if(y+1 < h)
    return rec(field, h,w,y+1, x, count);
  
  if(x+1 < w)
    return rec(field, h,w, y, x+1, count);
  
  return count;
}

int main(){
  int h,w;cin >> h >> w;
  Field field(h, vector<char>(w,'_'));
  for(int i=0; i<h;i++){
    string line;
    cin >> line;
    for(int j=0; j<w;j++){
      field[i][j] = line[j];
    }
  }
  vector<int> cnt;
  int ans,count=0;
  ans = rec(field,h,w,0,0,count,cnt);
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int rec(Field&, int, int, int, int, int&, std::vector<int>&)':
a.cc:13:15: error: too few arguments to function 'int rec(Field&, int, int, int, int, int&, std::vector<int>&)'
   13 |     return rec(field, h,w,y+1, x, count);
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:6:5: note: declared here
    6 | int rec(Field &field, int h, int w, int y, int x, int &count, vector<int> &cnt){
      |     ^~~
a.cc:16:15: error: too few arguments to function 'int rec(Field&, int, int, int, int, int&, std::vector<int>&)'
   16 |     return rec(field, h,w, y, x+1, count);
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:6:5: note: declared here
    6 | int rec(Field &field, int h, int w, int y, int x, int &count, vector<int> &cnt){
      |     ^~~
Language: C++

from collections import deque
from heapq import heappush, heappop
h, w = map(int, input().split())
grid = [input() for _ in range(h)]

def solve(grid, h, w):
    if h == 0 or w == 0:
        return 0
    color = grid[0][0]
    cnt = 0
    if color == '#':
        cnt += 1
    dist = [[-1] * w for _ in range(h)]
    dist[0][0] = cnt
    q = []
    q.append((0, 0))
    current_color_cluster = [(0, 0)]
    while q and dist[h - 1][w - 1] == -1:
        new_q = []
        for i, j in q:
            for ii, jj in ((i + 1, j), (i, j + 1)):
                if 0 <= ii < h and 0 <= jj < w and dist[ii][jj] == -1 and grid[ii][jj] == color:
                    dist[ii][jj] = cnt
                    new_q.append((ii, jj))
        if new_q:
            current_color_cluster.extend(new_q)
            q = new_q
        elif dist[h - 1][w - 1] == -1:
            if color == '#':
                cnt += 1
            color = '#' if color == '.' else '.'
            q = current_color_cluster
            current_color_cluster = []
    return dist[h - 1][w - 1]

print(solve(grid, h, w))



Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import deque
      | ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int ,int> pii;
typedef pair<ll ,ll> pll;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define all(X) (X).begin(), (X).end()
#define sll(n) scanf("%lld",&n)
#define sll2(x,y) scanf("%lld%lld",&x,&y)
#define sll3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z)
#define REP(i,x,y) for(ll i = x;i <= y;++i)
#define debug(x) cerr<<#x<<"::"<<x<<endl
#define debug2(x,y) cerr<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n"
#define debug3(x,y,z) cerr<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n"
#define debug4(x,y,z,w) cerr<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<"\n"
ll power(ll x,ll y,ll z) {
	ll ret = 1;
	while(y > 0) {
		if(y & 1) ret = (ret*x)%z;
		x = (x*x)%z;
		y >>= 1;
	}
	return ret;
}
const ll N = 105, inf = 1e15;
ll dp[N][N];
string s[N];
int main() {
 
	ll n,m;
	sll2(n,m);
	REP(i,0,n-1) cin >> s[i];
	REP(i,1,n) REP(j,1,m) dp[i][j] = inf;
	char pre = '$';
	REP(j,1,m) {
		dp[1][j] = dp[1][j - 1];
		if(s[0][j - 1] == '#') {
			if(pre != '#') dp[1][j]++; 
		}
		pre = s[0][j - 1];
	}
	char pre = s[1][1];
	REP(i,2,n) {
		REP(j,1,m) {
			if(j == 1) {
				dp[i][j] = dp[i - 1][j];
				if(s[i - 1][0] == '#' && pre != '#') dp[i][j]++;
				pre = s[i - 1][0];
			} else {
				char up = s[i - 2][j - 1],lf = s[i - 1][j - 2],di = s[i - 2][j - 2], curr = s[i - 1][j - 1];
				if(up == '#' && lf == '#') {
					dp[i][j] = min(dp[i][j - 1], dp[i - 1][j]);
					
				} else if(up == '#' && lf == '.') {
					if(curr == '#') {
						dp[i][j] = min(dp[i - 1][j], dp[i][j - 1] + 1);
					} else {
						dp[i][j] = min(dp[i][j - 1], dp[i - 1][j]);
					}
				} else if(up == '.' && lf == '#') {
					if(curr == '#') {
						dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1]);
					} else {
						dp[i][j] = min(dp[i][j - 1], dp[i - 1][j]);
					}
				} else {
					if(curr == '#') {
						dp[i][j] = 1 + min(dp[i - 1][j], dp[i][j - 1]);
					} else {
						dp[i][j] = min(dp[i - 1][j], dp[i][j - 1]);
					}
				}
			}
		}
	}
	printf("%lld\n", dp[n][m]);
	
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:14: error: redeclaration of 'char pre'
   45 |         char pre = s[1][1];
      |              ^~~
a.cc:37:14: note: 'char pre' previously declared here
   37 |         char pre = '$';
      |              ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int DP[110][110],A,B;
string G[110];
short mem[101][101][101][101];
int dfs(int r1,c1,r2,c2)
{
  if(mem[r1][c1][r2][c2])
    return mem[r1][c1][r2][c2];
  for(int i=r1;i<r2;i++)
    for(int j=c1;j<c2;j++)
    {
      int Tmp=1000000;
      if(i>r1)
        Tmp=min(Tmp,DP[i-1][j]);
      if(j>c1)
        Tmp=min(Tmp,DP[i][j-1]);
      if(Tmp==1000000)
        Tmp=0;
      if(G[i][j]=='#')
        Tmp++;
      DP[i][j]=Tmp;
    }
  int res=DP[r2-1][c2-1];
  for(int i=r1;i<r2;i++)
    for(int j=c1;j<c2;j++)
    {
      int Tmp=1000000;
      if(i>r1)
        Tmp=min(Tmp,DP[i-1][j]);
      if(j>c1)
        Tmp=min(Tmp,DP[i][j-1]);
      if(Tmp==1000000)
        Tmp=0;
      if(G[i][j]=='.')
        Tmp++;
      DP[i][j]=Tmp;
    }
  res=min(res,DP[r2-1][c2-1]+1);
  for(int i=r1+1;i<r2-1;i++)
    for(int j=c1+1;j<c2-1;j++)
      res=min(res,dfs(r1,c1,i,j)+dfs(i,j,r2,c2));
  return mem[r1][c1][r2][c2]=res+1;
}
int main()
{
  cin>>A>>B;
  for(int i=0;i<A;i++)
    cin>>G[i];
  cout<<dfs(0,0,A,B)-1<<endl;
  return 0;
}

Compiler output:
a.cc:6:16: error: 'c1' has not been declared
    6 | int dfs(int r1,c1,r2,c2)
      |                ^~
a.cc:6:19: error: 'r2' has not been declared
    6 | int dfs(int r1,c1,r2,c2)
      |                   ^~
a.cc:6:22: error: 'c2' has not been declared
    6 | int dfs(int r1,c1,r2,c2)
      |                      ^~
a.cc: In function 'int dfs(int, int, int, int)':
a.cc:8:14: error: 'c1' was not declared in this scope; did you mean 'r1'?
    8 |   if(mem[r1][c1][r2][c2])
      |              ^~
      |              r1
a.cc:8:18: error: 'r2' was not declared in this scope; did you mean 'r1'?
    8 |   if(mem[r1][c1][r2][c2])
      |                  ^~
      |                  r1
a.cc:8:22: error: 'c2' was not declared in this scope
    8 |   if(mem[r1][c1][r2][c2])
      |                      ^~
a.cc:10:18: error: 'r2' was not declared in this scope; did you mean 'r1'?
   10 |   for(int i=r1;i<r2;i++)
      |                  ^~
      |                  r1
a.cc:11:15: error: 'c1' was not declared in this scope; did you mean 'r1'?
   11 |     for(int j=c1;j<c2;j++)
      |               ^~
      |               r1
a.cc:11:20: error: 'c2' was not declared in this scope
   11 |     for(int j=c1;j<c2;j++)
      |                    ^~
a.cc:24:14: error: 'r2' was not declared in this scope; did you mean 'r1'?
   24 |   int res=DP[r2-1][c2-1];
      |              ^~
      |              r1
a.cc:24:20: error: 'c2' was not declared in this scope
   24 |   int res=DP[r2-1][c2-1];
      |                    ^~
a.cc:26:15: error: 'c1' was not declared in this scope; did you mean 'r1'?
   26 |     for(int j=c1;j<c2;j++)
      |               ^~
      |               r1
a.cc:41:15: error: 'c1' was not declared in this scope; did you mean 'r1'?
   41 |     for(int j=c1+1;j<c2-1;j++)
      |               ^~
      |               r1
a.cc:43:18: error: 'c1' was not declared in this scope; did you mean 'r1'?
   43 |   return mem[r1][c1][r2][c2]=res+1;
      |                  ^~
      |                  r1
Language: C++

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

const int INF = 1000000;
const int MOD = 1e9 + 7;
int t[105][105];
char s[105][105];
int main() {
   int h, w;
   cin >> h >> w;
   rep(i, 0, h) { rep(j, 0, w) cin >> s[i][j]; }
   rep(i, 0, h) { rep(j, 0, w) t[i][j] = INF; }
   queue<P> que;
   que.push(P(0, 0));
   if (s[0][0] == '#')
      t[0][0] = 1;
   else
      t[0][0] = 0;
   while (que.size()) {
      P X = que.front();
      que.pop();
      int x = X.first, y = X.second;
      if (x >= w && y >= h) continue;
      if (x + 1 < w && y < h) {
         if (s[y][x + 1] == '#') {
            chmin(t[y][x + 1], t[y][x] + 1);
         } else {
            chmin(t[y][x + 1], t[y][x]);
         }
         que.push(P(x + 1, y));
      }
      if (y + 1 < h & x < w) {
         if (s[y + 1][x] == '#') {
            chmin(t[y + 1][x], t[y][x] + 1);
         } else {
            chmin(t[y + 1][x], t[y][x]);
         }
         que.push(P(x, y + 1));
      }
   }
   cout << t[h - 1][w - 1] << endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: 'chmin' was not declared in this scope
   31 |             chmin(t[y][x + 1], t[y][x] + 1);
      |             ^~~~~
a.cc:33:13: error: 'chmin' was not declared in this scope
   33 |             chmin(t[y][x + 1], t[y][x]);
      |             ^~~~~
a.cc:39:13: error: 'chmin' was not declared in this scope
   39 |             chmin(t[y + 1][x], t[y][x] + 1);
      |             ^~~~~
a.cc:41:13: error: 'chmin' was not declared in this scope
   41 |             chmin(t[y + 1][x], t[y][x]);
      |             ^~~~~
Language: C++

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

char arr[101][101]
int main()
{
    int a,b;
    cin>>a>>b;
   // char arr[a][b];
    for(int i=0;i<a;i++)
    {
        for(int  j=0;j<b;j++)
        cin>>arr[i][j];
    }
    int i=0,j=0,count=0,p;
    while((i<a)&&(j<b))
    {
        int count1=0,count2=0;
        if(arr[i][j]=='#')
        count++;
        for(p=j;p<b;p++)
        {
            if(arr[i][p]=='.')
            count1++;
        }
        for(p=i;p<a;p++)
        {
            if(arr[p][j]=='.')
            count2++;
        }
        if((count2>=count1)&&(i<a-1))
        {
            i++;
        }
        else
        {
            j++;
        }
        }
        cout<<count;
}

Compiler output:
a.cc:6:1: error: expected initializer before 'int'
    6 | int main()
      | ^~~
Language: C++

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

#define ull unsigned long long int
#define ll long long int
#define pb push_back
#define eb emplace_back
#define MOD (ull)(double)(1e9 + 7)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pull pair<ull, ull>
#define m_p make_pair

int dp[h+1][w+1] = { 0 };

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int h, w;
	cin >> h >> w;
	
	char s[h+1][w+1];
	for(int i=1 ; i<=h ; ++i){
		for(int j=1 ; j<=w ; ++j){
			cin >> s[i][j];
		}
	}
	
	for(int i=1 ; i<=w ; ++i){
	    dp[1][i] = dp[1][i-1];
	    if(s[1][i] == '#')dp[1][i]++;
	}
	
	for(int i=2 ; i<=h ; ++i){
	    dp[i][1] = dp[i-1][1];
	    if(s[i][1] == '#')dp[i][1]++;
	}
	
	for(int i=2 ; i<=h ; ++i){
		for(int j=2 ; j<=w ; ++j){
			dp[i][j] = min(dp[i-1][j], dp[i][j-1]);
			if(s[i][j] == '#')dp[i][j]++;
		}
	}
	
	cout << dp[h][w];
}


Compiler output:
a.cc:14:8: error: 'h' was not declared in this scope
   14 | int dp[h+1][w+1] = { 0 };
      |        ^
a.cc:14:13: error: 'w' was not declared in this scope
   14 | int dp[h+1][w+1] = { 0 };
      |             ^
a.cc: In function 'int main()':
a.cc:31:13: error: 'dp' was not declared in this scope; did you mean 'dup'?
   31 |             dp[1][i] = dp[1][i-1];
      |             ^~
      |             dup
a.cc:36:13: error: 'dp' was not declared in this scope; did you mean 'dup'?
   36 |             dp[i][1] = dp[i-1][1];
      |             ^~
      |             dup
a.cc:42:25: error: 'dp' was not declared in this scope; did you mean 'dup'?
   42 |                         dp[i][j] = min(dp[i-1][j], dp[i][j-1]);
      |                         ^~
      |                         dup
a.cc:47:17: error: 'dp' was not declared in this scope; did you mean 'dup'?
   47 |         cout << dp[h][w];
      |                 ^~
      |                 dup
Language: C++

#include<iostream>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
int min_n=100*100+5;
int sum=0;//存储临时答案 
int h,w;
char ptr[150][150];
int next[2][2]={{0,1},{1,0}}; 
bool check(int x,int y){
	return (x<=h/*行*/)&&(y<=w/*列*/);//判断合法 
} 
void dfs(int x,int y){//全部遍历，求最小的操作数 
	if(x==h&&y==w){//本次到达终点 
		min_n=min(min_n,sum);//取出最小值
		return ;//结束本次的调用 
	}
	//寻找下一步
	for(int i=0;i<2;i++){
		int nx=x+next[i][0];
		int ny=y+next[i][1];//找到下一步操作
		//判断下一步操作是否合法
		if(check(nx,ny)){//如果合法
			if(ptr[nx][ny]=='#'){//判断下一个位置是 黑 还是 白  ，是黑  则  加一操作 
				sum++;
			}
			dfs(nx,ny);
			if(ptr[nx][ny]=='#'){
				sum--;
			} 
		} 
	}
}
int main(){
	cin>>h>>w;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			cin>>ptr[i][j];
		}
	}//数据输入完毕，下面开始处理数据
	//先要判断第一个是不是
	if(ptr[1][1]=='#'){
		sum++;//计数器加一操作 
	} 
	dfs(1,1);//然后从一开始遍历搜索 
	cout<<min_n<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:21:26: error: reference to 'next' is ambiguous
   21 |                 int nx=x+next[i][0];
      |                          ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:10:5: note:                 'int next [2][2]'
   10 | int next[2][2]={{0,1},{1,0}};
      |     ^~~~
a.cc:22:26: error: reference to 'next' is ambiguous
   22 |                 int ny=y+next[i][1];//找到下一步操作
      |                          ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:10:5: note:                 'int next [2][2]'
   10 | int next[2][2]={{0,1},{1,0}};
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int H,W;
  cin >> H >> W;
  const int Row=H;
  const int coL=W;
  int mat [H][W];
  cin >> {[H][W]};
  cout << H+W-1 << endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected primary-expression before '{' token
    9 |   cin >> {[H][W]};
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int H,W;
  cin >> H >> W;
  const int Row=H;
  const int coL=W;
  int mat [H][W];
  cin >> [H][W];
  cout << H+W-1 << endl;
  }


Compiler output:
a.cc: In lambda function:
a.cc:9:13: error: expected '{' before '[' token
    9 |   cin >> [H][W];
      |             ^
a.cc: In function 'int main()':
a.cc:9:13: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
Language: C++

#include<iostream>
#define D(x) cout<<"D: "<<#x<<'='<<x<<endl;
#define R(x, l) cout<<"R: Array "<<#x<<endl; for(int i = 0; i < l; i++) cout<<' '<<i<<':'<<*(x+i)<<endl;
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
char w[105][105];
bool visited[105][105];
int n, m, Min = 1<<30;
template<typename tn> inline tn next(void)
{
	tn k;
	cin>>k;
	return k;
}
template<typename tn> inline ostream& operator << (ostream& os, const vector<tn>& v)
{
	for(unsigned i = 0; i < v.size(); i++) os<<v[i]<<' ';
	return os;
}
inline void dfs(int x, int y, int cnt)
{
	if (x == n-1 && y == m-1) { Min = min(Min, cnt); return; }
	if (x+1 < n && y < m && cnt+(w[x+1][y] == '#') < Min) dfs(x+1, y, cnt+(w[x+1][y] == '#'));
	if (x < n && y+1 < m && cnt+(w[x][y+1] == '#') < Min) dfs(x, y+1, cnt+(w[x][y+1] == '#'));
}
int main(void)
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n>>m;
	for(int i = 0; i < n; i++) scanf("%s", w[i]);
	dfs(0, 0, w[0][0] == '#');
	cout<<Min<<endl;
	return ~~(0-0);
}


Compiler output:
a.cc:17:71: error: 'vector' does not name a type
   17 | template<typename tn> inline ostream& operator << (ostream& os, const vector<tn>& v)
      |                                                                       ^~~~~~
a.cc:17:77: error: expected ',' or '...' before '<' token
   17 | template<typename tn> inline ostream& operator << (ostream& os, const vector<tn>& v)
      |                                                                             ^
a.cc: In function 'std::ostream& operator<<(std::ostream&, int)':
a.cc:19:33: error: 'v' was not declared in this scope
   19 |         for(unsigned i = 0; i < v.size(); i++) os<<v[i]<<' ';
      |                                 ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class A {
	static String[] lines;
	static int H;
	static int W;
	static Point source;
	static Point dest;
	static int[][] min;
	
	public static void main(String[] args) throws Exception {
		BufferedReader bw = new BufferedReader(new InputStreamReader(System.in));
		String s = bw.readLine();
		String[] w = s.split("\\s+");
		H = Integer.parseInt(w[0]);
		W = Integer.parseInt(w[1]);
		lines = new String[H];
		
		for(int i=0;i<H;i++) {
			lines[i] = bw.readLine(); 
		}
		
		source = new Point(1, 1);
		dest = new Point(H,W);
		
		
		min = new int[H+1][W+1];
		
		for(int r=1;r<=H;r++) {
			for(int c=1;c<=W;c++) {
				int add = lines[r-1].charAt(c-1)=='#'?1:0;
				if( r==1 && c==1 ) {
					min[r][c] = add;
					continue;
				}
				else if( r != 1 && c != 1) {
					min[r][c] = MIN(min[r-1][c],min[r][c-1]) + add;
				}
				else if( r ==1 && c != 1) {
					min[r][c] = min[r][c-1] + add;
				}
				else{
					min[r][c] = min[r-1][c] + add;
				}
			}
		}
		
		System.out.println(min[H][W]);
		
	}
	
	private static int MIN(int x,int y) {
		if( x > y) {
			return y;
		}
		return x;
	}
	
	
	
	static class Point {
		int x;
		int y;
		Point(int x,int y) {
			this.x = x;
			this.y = y;
		}
	}
	
}	



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

#include<bits/stdc++.h>
using namespace std;
int main(){
 int c=0;char a[100][100],H,W;
  cout<<"enter row and colums\n";
  cin>>H>>W;
  for(int i=1;i<=H;i++)
    for(int j=1;j<=W;j++)
      cin>>a[i][j];
  if(a[1][1]!='.')c++;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      for(int k=1;k<=2*H-1;){
        if(a[i+k][j]=='.'){
        	  i++;
        		if(a[i][j+k]=='.')j++;continue;
          		else if(a[i+k][j]=='.')i++;continue;
                          }
        else if (a[i][j+k]=='.'){
          j++;
          if(a[i][j+k]=='.')j++;continue;
          		else if(a[i+k][j]=='.')i++;continue;
        }
        else 
        {c++;}
      }
    }
  }
}
      
  


Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: expected '}' before 'else'
   17 |                         else if(a[i+k][j]=='.')i++;continue;
      |                         ^~~~
a.cc:14:27: note: to match this '{'
   14 |         if(a[i+k][j]=='.'){
      |                           ^
a.cc:19:9: error: 'else' without a previous 'if'
   19 |         else if (a[i][j+k]=='.'){
      |         ^~~~
a.cc:19:25: error: 'k' was not declared in this scope
   19 |         else if (a[i][j+k]=='.'){
      |                         ^
a.cc:22:25: error: expected '}' before 'else'
   22 |                         else if(a[i+k][j]=='.')i++;continue;
      |                         ^~~~
a.cc:19:33: note: to match this '{'
   19 |         else if (a[i][j+k]=='.'){
      |                                 ^
a.cc:24:9: error: 'else' without a previous 'if'
   24 |         else
      |         ^~~~
a.cc: At global scope:
a.cc:28:3: error: expected declaration before '}' token
   28 |   }
      |   ^
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#define D(x) cout<<"D: "<<#x<<'='<<x<<endl;
#define R(x, l) cout<<"R: Array "<<#x<<endl; for(int i = 0; i < l; i++) cout<<' '<<i<<':'<<*(x+i)<<endl;
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
char w[105][105];
bool visited[105][105];
int n, m, Min = 1<<30;
template<typename tn> inline tn next(void)
{
	tn k;
	cin>>k;
	return k;
}
template<typename tn> inline ostream& operator << (ostream& os, const vector<tn>& v)
{
	for(unsigned i = 0; i < v.size(); i++) os<<v[i]<<' ';
	return os;
}
inline void dfs(int x, int y, int cnt)
{
	if (x == n-1 && y == m-1) { Min = min(Min, cnt); return; }
	if (x+1 < n && y < m && cnt+(w[x+1][y] == '#') < Min) dfs(x+1, y, cnt+(w[x+1][y] == '#'));
	if (x < n && y+1 < m && cnt+(w[x][y+1] == '#') < Min) dfs(x, y+1, cnt+(w[x][y+1] == '#'));
}
int main(void)
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n>>m;
	for(int i = 0; i < n; i++) scanf("%s", w[i]);
	dfs(0, 0, w[0][0] == '#');
	cout<<Min<<endl;5
	return ~~(0-0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:26: error: expected ';' before 'return'
   35 |         cout<<Min<<endl;5
      |                          ^
      |                          ;
   36 |         return ~~(0-0);
      |         ~~~~~~
Language: C++

5 5
.#.#.
#.#.#
.#.#.
#.#.#
.#.#.

Compiler output:
a.cc:2:2: error: stray '#' in program
    2 | .#.#.
      |  ^
a.cc:2:4: error: stray '#' in program
    2 | .#.#.
      |    ^
a.cc:3:2: error: invalid preprocessing directive #.
    3 | #.#.#
      |  ^
a.cc:4:2: error: stray '#' in program
    4 | .#.#.
      |  ^
a.cc:4:4: error: stray '#' in program
    4 | .#.#.
      |    ^
a.cc:5:2: error: invalid preprocessing directive #.
    5 | #.#.#
      |  ^
a.cc:6:2: error: stray '#' in program
    6 | .#.#.
      |  ^
a.cc:6:4: error: stray '#' in program
    6 | .#.#.
      |    ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 5 5
      | ^
Language: C++

#include "../../library/template.cpp"

ll h, w;
string s[100];
ll dp[100][100];

ll dfs(ll i, ll j) {
  if (i == h-1 and j == w-1) return 0;

  if (dp[i][j] != -1) {
    return dp[i][j];
  }

  ll n = 1LL<<60, m = 1LL<<60;
  if (i+1 < h) n = dfs(i+1, j);
  if (j+1 < w) m = dfs(i, j+1);

  if (i+1 < h and s[i+1][j] == '#' and s[i][j] == '.') {
    n++;
  }
  if (j+1 < w and s[i][j+1] == '#' and s[i][j] == '.') {
    m++;
  }
  
  if (i == 0 and j == 0 and s[i][j] == '#') {
    if (i+1 < h and s[i+1][j] == '.') {
      n++;
    }
    if (j+1 < w and s[i][j+1] == '.') {
      m++;
    }
  }
  return dp[i][j] = min(n, m);
}

int main() {
  cin >> h >> w;
  rep(i, h) {
    cin >> s[i];
  }

  rep(i, h) {
    rep(j, w) {
      dp[i][j] = -1;
    }
  }

  ll ans = dfs(0, 0);

  cout << ans << endl;
}


Compiler output:
a.cc:1:10: fatal error: ../../library/template.cpp: No such file or directory
    1 | #include "../../library/template.cpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int c=0;char a[100][100],H,W;
  cout<<"enter row and colums\n";
  cin>>H>>W;
  for(int i=1;i<=H;i++)
    for(int j=1;j<=W;j++)
      cin>>a[i][j];
  if(a[1][1]!='.')c++;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      for(int k=1;k<=2*H-1;){
        if(a[i+k][j]=='.'){
        	  i++;
        		if(a[i][j+k]=='.')j++;continue;
          		else if(a[i+k][j]=='.')i++;continue;
                          }
        else if (a[i][j+k]=='.'){
          j++;
          if(a[i][j+k]=='.')j++;continue;
          		else if(a[i+j][j]=='.')i++;continue;
        }
        else 
        {c++;}
      }
    }
  }
      
  


Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: expected '}' before 'else'
   17 |                         else if(a[i+k][j]=='.')i++;continue;
      |                         ^~~~
a.cc:14:27: note: to match this '{'
   14 |         if(a[i+k][j]=='.'){
      |                           ^
a.cc:19:9: error: 'else' without a previous 'if'
   19 |         else if (a[i][j+k]=='.'){
      |         ^~~~
a.cc:19:25: error: 'k' was not declared in this scope
   19 |         else if (a[i][j+k]=='.'){
      |                         ^
a.cc:22:25: error: expected '}' before 'else'
   22 |                         else if(a[i+j][j]=='.')i++;continue;
      |                         ^~~~
a.cc:19:33: note: to match this '{'
   19 |         else if (a[i][j+k]=='.'){
      |                                 ^
a.cc:24:9: error: 'else' without a previous 'if'
   24 |         else
      |         ^~~~
a.cc: At global scope:
a.cc:28:3: error: expected declaration before '}' token
   28 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int c=0;char a[100][100],H,W;
  cout<<"enter row and colums\n";
  cin>>H>>W;
  for(int i=1;i<=H;i++)
    for(int j=1;j<=W;j++)
      cin>>a[i][j];
  if(a[1][1]!='.'])c++;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      for(int k=1;k<=2*H-1;){
        if(a[i+k][j]=='.'){
        	  i++;
        		if(a[i][j+k]=='.')j++;continue;
          		else if(a[+][j]=='.')i++;continue;
                          }
        else if (a[i][j+k]=='.'){
          j++;
          if(a[i][j+k]=='.')j++;continue;
          		else if(a[+][j]=='.')i++;continue;
        }
        else 
        {c++;}
      }
    }
  }
      
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ')' before ']' token
   10 |   if(a[1][1]!='.'])c++;
      |     ~            ^
      |                  )
a.cc:10:18: error: expected primary-expression before ']' token
a.cc:17:25: error: expected '}' before 'else'
   17 |                         else if(a[+][j]=='.')i++;continue;
      |                         ^~~~
a.cc:14:27: note: to match this '{'
   14 |         if(a[i+k][j]=='.'){
      |                           ^
a.cc:17:36: error: expected primary-expression before ']' token
   17 |                         else if(a[+][j]=='.')i++;continue;
      |                                    ^
a.cc:19:9: error: 'else' without a previous 'if'
   19 |         else if (a[i][j+k]=='.'){
      |         ^~~~
a.cc:19:25: error: 'k' was not declared in this scope
   19 |         else if (a[i][j+k]=='.'){
      |                         ^
a.cc:22:25: error: expected '}' before 'else'
   22 |                         else if(a[+][j]=='.')i++;continue;
      |                         ^~~~
a.cc:19:33: note: to match this '{'
   19 |         else if (a[i][j+k]=='.'){
      |                                 ^
a.cc:22:36: error: expected primary-expression before ']' token
   22 |                         else if(a[+][j]=='.')i++;continue;
      |                                    ^
a.cc:24:9: error: 'else' without a previous 'if'
   24 |         else
      |         ^~~~
a.cc: At global scope:
a.cc:28:3: error: expected declaration before '}' token
   28 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
int main(){
 int c=0;char a[100][100],H,W;
  cout<<"enter row and colums\n";
  cin>>H>>W;
  for(int i=1;i<=H;i++)
    for(int j=1;j<=W;j++)
      cin>>a[i][j];
  if(a[1][1]!='.'])c++;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      for(int k=1;k<=2*H-1;){
        if(a[i+k][j]=='.'){
        	  i++;
        		if(a[i][j+k]=='.')j++;continue;
          		else if(a[+][j]=='.')i++;continue;
                          }
        else if (a[i][j+k]=='.'){
          j++;
          if(a[i][j+k]=='.')j++;continue;
          		else if(a[+][j]=='.')i++;continue;
        }
        else 
        {c++;}
      }
    }
  }
      
  


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    4 |   cout<<"enter row and colums\n";
      |   ^~~~
      |   std::cout
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:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>H>>W;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:18: error: expected ')' before ']' token
    9 |   if(a[1][1]!='.'])c++;
      |     ~            ^
      |                  )
a.cc:9:18: error: expected primary-expression before ']' token
a.cc:16:25: error: expected '}' before 'else'
   16 |                         else if(a[+][j]=='.')i++;continue;
      |                         ^~~~
a.cc:13:27: note: to match this '{'
   13 |         if(a[i+k][j]=='.'){
      |                           ^
a.cc:16:36: error: expected primary-expression before ']' token
   16 |                         else if(a[+][j]=='.')i++;continue;
      |                                    ^
a.cc:18:9: error: 'else' without a previous 'if'
   18 |         else if (a[i][j+k]=='.'){
      |         ^~~~
a.cc:18:25: error: 'k' was not declared in this scope
   18 |         else if (a[i][j+k]=='.'){
      |                         ^
a.cc:21:25: error: expected '}' before 'else'
   21 |                         else if(a[+][j]=='.')i++;continue;
      |                         ^~~~
a.cc:18:33: note: to match this '{'
   18 |         else if (a[i][j+k]=='.'){
      |                                 ^
a.cc:21:36: error: expected primary-expression before ']' token
   21 |                         else if(a[+][j]=='.')i++;continue;
      |                                    ^
a.cc:23:9: error: 'else' without a previous 'if'
   23 |         else
      |         ^~~~
a.cc: At global scope:
a.cc:27:3: error: expected declaration before '}' token
   27 |   }
      |   ^
Language: C++

#include<bits/c++.h>
int main(){
 int c=0;char a[100][100],H,W;
  cout<<"enter row and colums\n";
  cin>>H>>W;
  for(int i=1;i<=H;i++)
    for(int j=1;j<=W;j++)
      cin>>a[i][j];
  if(a[1][1]!='.'])c++;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      for(int k=1;k<=2*H-1;){
        if(a[i+k][j]=='.'){
        	  i++;
        		if(a[i][j+k]=='.')j++;continue;
          		else if(a[+][j]=='.')i++;continue;
                          }
        else if (a[i][j+k]=='.'){
          j++;
          if(a[i][j+k]=='.')j++;continue;
          		else if(a[+][j]=='.')i++;continue;
        }
        else 
        {c++;}
      }
    }
  }
      
  

Compiler output:
a.cc:1:9: fatal error: bits/c++.h: No such file or directory
    1 | #include<bits/c++.h>
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C++

// Created by sz
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int h,w;
    cin >> h >> w;
    vector<string> s(h);
    for (int i = 0; i < h; i++){
        cin >> s[i];
    }
    
    vector<vector<int> > dp(h, vector<int>(w, 100000));
    
    function<int(int, int)> DP=[&](int row, int col){
        if(dp[row][col]!=100000)return dp[row][col];
        if(row == h-1 &&  col == w-1){
            if(s[h-1][w-1] == '.')return dp[h-1][w-1] =0;
            else return dp[h-1][w-1] = 1;
        }
        if(row+1< w){
            int& dp_value = dp[row][col];
            dp_value = min(dp_value, DP(row+1,col) + (s[row][col]=='.' &&s[row+1][col] == '#' ));
        }
        if(col+1<w){
            int& dp_value = dp[row][col];
            dp_value = min(dp_value, DP(row,col+1) + (s[row][col]=='.' && s[row][col+1] == '#'));
        }
        
        return dp_value;
    };
    
    cout << DP(0,0) << "\n";
    
    
    return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:37:16: error: 'dp_value' was not declared in this scope; did you mean 'si_value'?
   37 |         return dp_value;
      |                ^~~~~~~~
      |                si_value
Language: C++

// https://atcoder.jp/contests/agc043/tasks/agc043_a

#include <iostream>
using namespace std;

int H, W;
bool map[110][110];
int memo[110][110];
int result = 200;

void dfs(int h, int w, int sum) {
    if (!map[h][w]) ++sum;
    if (h == H && w == W && sum < result) result = sum;

    if (memo[h][w] > sum) return;
    memo[h][w] = sum;

    if (h < H) dfs(h + 1, w, sum);
    if (w < W) dfs(h, w + 1, sum);
}

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

    memset(memo, 200, sizeof(memo));

    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            char c;
            cin >> c;
            map[i + 1][j + 1] = (c == '.');
        }
    }

    dfs(1, 1, 0);
    cout << result << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'memset' was not declared in this scope
   25 |     memset(memo, 200, sizeof(memo));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <iostream>
  +++ |+#include <cstring>
    4 | using namespace std;