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

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

int main(){
	// sengen
	int h,w;

	// nyuryoku
	cin >> h >> w;
	char s[h][w];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin >> s[i][j];
		}
	}
	// keisan
	int dx[4] = {-1,0,0,1};
	int dy[4] = {0,-1,1,0};
	int a = 0;

	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			int count=0;
			if(s[i][j] == '#'){
				for(int k=0;k<4;k++){
					int x=i+dx[k],y=j+dy[k];
					if(x>=0&&x<h&&y>=0&&y<w){
						if(s[x][y] == '#') count++;
					}
				}
				if(count == 0) goto end;
			}
		}
		if(i == h-1&& j == w-1) a=1;
	}
	if(a == 1) cout << "Yes";
	end: cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:31: error: 'j' was not declared in this scope
   35 |                 if(i == h-1&& j == w-1) a=1;
      |                               ^
Language: C++

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

int main(){
	// sengen
	int h,w;

	// nyuryoku
	cin >> h >> w;
	char s[h][w];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin >> s[i][j];
		}
	}
	// keisan
	int dx[4] = {-1,0,0,1};
	int dy[4] = {0,-1,1,0};

	for(int i=0;i<h;i++){
		int a = 0;
		for(int j=0;j<w;j++){
			int count=0;
			if(s[i][j] == '#'){
				for(int k=0;k<4;k++){
					int x=i+dx[k],y=j+dy[k];
					if(x>=0&&x<h&&y>=0&&y<w){
						if(s[x][y] == '#') count++;
					}
				}
			}
			if(count == 0) goto end;
		}
		a = 1;
	}
	if(a) cout << "Yes";
	end: cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:12: error: 'a' was not declared in this scope
   37 |         if(a) cout << "Yes";
      |            ^
Language: C++

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

bool check(vector<vector<char>> s, int y, int x, int H, int W){
    vector<int> dx = {0, 1, 0, -1};
    vector<int> dy = {1, 0, -1, 0};
    for (int i = 0; i<4; i++){
        if (x+dx.at(i)>=0 && x+dx.at(i)<W && y+dy.at(i)>=0 && y+dy.at(i)<H){
            if (s.at(y + dy.at(i)).at(x + dx.at(i)) == '#'){
                return true;
            }
        }
    }
    return false;
}

int main(){
    int H, W;
    cin >> H >> W;
    vector<vector<char>> s(H, vector<char>(W));
    
    for (int i = 0; i<H; i++){
        for (int j=0; j<W; j++){
            cin >> s.at(i).at(j);
        }
    }
    
    for (int i = 0; i<H; i++){
        for (int j=0; j<W; j++){
            if (s.at(i).at(j)=='#'){
                if (!check(s, i, j, H, W)){
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }
    
    cout << "Yes" << endl;
   
}#include <bits/stdc++.h>
using namespace std;

bool check(vector<vector<char>> s, int y, int x, int H, int W){
    vector<int> dx = {0, 1, 0, -1};
    vector<int> dy = {1, 0, -1, 0};
    for (int i = 0; i<4; i++){
        if (x+dx.at(i)>=0 && x+dx.at(i)<W && y+dy.at(i)>=0 && y+dy.at(i)<H){
            if (s.at(y + dy.at(i)).at(x + dx.at(i)) == '#'){
                return true;
            }
        }
    }
    return false;
}

int main(){
    int H, W;
    cin >> H >> W;
    vector<vector<char>> s(H, vector<char>(W));
    
    for (int i = 0; i<H; i++){
        for (int j=0; j<W; j++){
            cin >> s.at(i).at(j);
        }
    }
    
    for (int i = 0; i<H; i++){
        for (int j=0; j<W; j++){
            if (s.at(i).at(j)=='#'){
                if (!check(s, i, j, H, W)){
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }
    
    cout << "Yes" << endl;
   
}

Compiler output:
a.cc:41:2: error: stray '#' in program
   41 | }#include <bits/stdc++.h>
      |  ^
a.cc:41:3: error: 'include' does not name a type
   41 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:44:6: error: redefinition of 'bool check(std::vector<std::vector<char> >, int, int, int, int)'
   44 | bool check(vector<vector<char>> s, int y, int x, int H, int W){
      |      ^~~~~
a.cc:4:6: note: 'bool check(std::vector<std::vector<char> >, int, int, int, int)' previously defined here
    4 | bool check(vector<vector<char>> s, int y, int x, int H, int W){
      |      ^~~~~
a.cc:57:5: error: redefinition of 'int main()'
   57 | int main(){
      |     ^~~~
a.cc:17:5: note: 'int main()' previously defined here
   17 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//}

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int dp[1010][1010];
int bingo[3][3];
bool flag[3][3];
int I[100][20];

int main() {
	int h, w;
	cin >> h >> w;
	bool flag = true;
	rep(i, h) {
		rep(j, w) {
			string s[i][j];
			cin >> s[i][j];
		}
	}
	rep(i, h) {
		rep(j, w) {
			if (s[i][j] == '#') {
				rep(k, 4) {
					int flag2 = 0;
					if (s[i + dx[k]][j + dy[k]] == '#')flag2++;
				}
				if (flag2 == 0)flag = false;
			}
		}
	}
	if (flag)puts("Yes");
	else puts("No");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:29: error: 's' was not declared in this scope
   69 |                         if (s[i][j] == '#') {
      |                             ^
a.cc:74:37: error: 'flag2' was not declared in this scope; did you mean 'flag'?
   74 |                                 if (flag2 == 0)flag = false;
      |                                     ^~~~~
      |                                     flag
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//}

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int dp[1010][1010];
int bingo[3][3];
bool flag[3][3];
int I[100][20];

int main() {
	int h, w;
	cin >> h >> w;
	bool flag = true;
	rep(i, h) {
		rep(j, w) {
			char s[i][j];
			cin >> s[i][j];
		}
	}
	rep(i, h) {
		rep(j, w) {
			if (s[i][j] == '#') {
				rep(k, 4) {
					int flag2 = 0;
					if (s[i + dx[k]][j + dy[k]] == '#')flag2++;
				}
				if (flag2 == 0)flag = false;
			}
		}
	}
	if (flag)puts("Yes");
	else puts("No");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:29: error: 's' was not declared in this scope
   69 |                         if (s[i][j] == '#') {
      |                             ^
a.cc:74:37: error: 'flag2' was not declared in this scope; did you mean 'flag'?
   74 |                                 if (flag2 == 0)flag = false;
      |                                     ^~~~~
      |                                     flag
Language: C++

//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const int INF= 1e9+5;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
char field [60][60];
vector<int>dx={1,-1,0,0};
vector<int>dy={0,0,1,-1};
int h,w;
int dfs(int x,int y){
  if(field[x][y]=='.')return 0;
  res=1;
  rep(i,4){
    if(1<=x+dx[i] && x+dx[i]<=w && 1<=y+dy[i] && y+dy[i]<=h)res=max(res,dfs(x+dx[i],y+dy[i]));
  }
  return res;
}
int main(){
  cin>>h>>w;
  rep(i,h){
    rep(j,w)cin>>field[i][j];
  }
  bool ans=true;
  rep(i,h){
    rep(j,w){
      if(dfs(i,j)==1)ans=false;
    }
  }
  if(ans)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}
  

Compiler output:
a.cc: In function 'int dfs(int, int)':
a.cc:20:3: error: 'res' was not declared in this scope; did you mean 'rep'?
   20 |   res=1;
      |   ^~~
      |   rep
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;

int main(){
    int h, w, i, j, res = 1, flag = 0;
    cin >> h >> w;
    string s[h];
    for(i=0; i<h; i++){
        cin >> s[i];
    } 
    for(i=0; i<h; i++){
        for(j=0; j<w; j++){
            flag = 0;
            if(s[i][j] == '#'){
                if(i != 0 && s[i-1][j] == '#') flag = 1;
                else if(i != h-1 && s[i+1][j] == '#') flag = 1;
                else if(j != 0 && s[i][j-1] == '#') flag = 1;
                else if(j != && s[i][j+1] == '#') flag = 1;
                res &= flag;
            }
        }
    }
    cout << (res ? "Yes\n" : "No\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |                 else if(j != && s[i][j+1] == '#') flag = 1;
      |                         ~~^~~~~~~
a.cc:21:34: error: expected ')' before '[' token
   21 |                 else if(j != && s[i][j+1] == '#') flag = 1;
      |                        ~         ^
      |                                  )
a.cc:21:33: error: label 's' used but not defined
   21 |                 else if(j != && s[i][j+1] == '#') flag = 1;
      |                                 ^
Language: C++

#include<iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
   int h,w;
   cin >> h >> w ;
   char c[h][w] ;
  
  for(int i=0;i<h;i++){
     for(int j=0;j<w;j++){
       cin >> c[i][j] ;
     }   
   }
  
  bool ans true;
  
  for(int i=0;i<h;i++){
     for(int j=0;j<w;j++){
       if(c[i][j]=='#'){
         if(i!=0 && c[i-1][j]=='#')
           continue; //above
         else if(j!=0 && c[i][j-1]=='#')
           continue; //left
         else if(j!=(w-1) && c[i][j+1]=='#')
           continue ; //right
         else if(i!=(h-1) && c[i+1][j]=='#')
           continue ; //below
         else 
           ans = false ;
       }
     }   
   }
  
  if(ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: expected initializer before 'true'
   16 |   bool ans true;
      |            ^~~~
a.cc:30:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |            ans = false ;
      |            ^~~
      |            abs
a.cc:35:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |   if(ans)
      |      ^~~
      |      abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int H,W;cin>>H>>W;
  char X[H+2][W+2];bool x=true;
  for(int i=0;i<H+2;i++){X[i][0]='.';X[i][W+1]='.';}
  for(int i=0;i<W+2;i++){X[0][i]='.';X[H+1][i]='.';}
  for(int i=1;i<=H;i++)for(int j=0;j<=W;j++)cin>>X[i][j];
  for(int i=1;i<=H;i++)for(int j=0;j<=M;j++)
    if(X[i][j]=='#'&&X[i-1][j]=='.'&&X[i+1][j]=='.'
       &&X[i][j-1]=='.'&&X[i][j+1]=='.')x=false;
  if(x)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:39: error: 'M' was not declared in this scope
    9 |   for(int i=1;i<=H;i++)for(int j=0;j<=M;j++)
      |                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll h, w, s;
  s = 0;
  in2(h, w);
  vector<vector<char>> a(h + 2, vector<char> (w + 2, '.'));
  rep(i, h){
    rep(j, w)
      in(a[i + 1][j + 1]);
  }
  rep(i, h + 2){
    rep(j, w + 2){
      if(a[i][j] == '#' && a[i - 1][j] == '.' && a[i + 1][j] == '.' && a[i][j - 1] == '.' && a[i][j + 1] == '.')
        a++;
    }
  }
  if(a)
    out("No");
  else
    out("Yes");
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:10: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   29 |         a++;
      |         ~^~
a.cc:32:6: error: could not convert 'a' from 'std::vector<std::vector<char> >' to 'bool'
   32 |   if(a)
      |      ^
      |      |
      |      std::vector<std::vector<char> >
Language: C++

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

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

    string s[h];

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

    bool ans = false;

    for(int y=0;y<h;y++){
        for(int x=0;x<w;x++){

            if(s[y][x]=='#'){
                int y_up = y+1;
                int y_down = y-1;
                int x_up = x+1;
                int x_down = x-1;
                
                if(x_up<w && s[y][x_up]=='#'){
                    ans = true;
                    break;
                }
                if(x_down>0 && s[y][x_down]=='#'){
                    ans = true;
                    break;
                }
                if(y_up<h && s[y_up][x]=='#'){
                    ans = true;
                    break;
                }
                if(y_down>0 && s[y_down][x]=='#'){
                    ans = true;
                    break;
                }
        }

        if(ans){
            break;
        }
    }
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

#include <bits/stdc++.h>
#include<math.h>
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

  
  
  

  void dfs(int x,int y){
    maze[x][y]='.';
    for(int dx=-1; dx<=1;dx++){
      for(int dy=-1; dy<=1;dy++){
        int nx=x+dx,ny=y+dy;
        if(0<=nx&&nx<N&&0<=ny&&ny<M&&maze[nx][ny]=='#')dfs(nx,ny);
      }
    }
    return;
  }

int main() {
  int N,M;
  cin>>N>>M;
  vector<vector<char>> maze(N, vector<char>(M));
  for(int i=0; i<N;i++){
    for(int j=0; j<M;j++){
      cin>>maze[i][j];
    }
  }
  for(int i=0; i<N;i++){
    for(int j=0; j<M;j++){
      if(maze[i][j]=='#'){
        
      }
    }
  }
  bool ans=true;
  for(int i=0; i<N;i++){
    for(int j=0; j<M;j++){
      if(maze[i][j]=='#'){
        ans=false;
      }
    }
  }
  
 if(ans){
   cout<<"Yes"<<endl;
 }
  else{
    cout<<"No"<<endl;
  }
}






Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:14:5: error: 'maze' was not declared in this scope
   14 |     maze[x][y]='.';
      |     ^~~~
a.cc:18:22: error: 'N' was not declared in this scope
   18 |         if(0<=nx&&nx<N&&0<=ny&&ny<M&&maze[nx][ny]=='#')dfs(nx,ny);
      |                      ^
a.cc:18:35: error: 'M' was not declared in this scope
   18 |         if(0<=nx&&nx<N&&0<=ny&&ny<M&&maze[nx][ny]=='#')dfs(nx,ny);
      |                                   ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> s(H);
  rep(i, H) cin >> s.at(i);

  vector<int> dx(8), dy(8);
  dx = {-1, -1, -1, 0, 0, 1, 1, 1};
  dy = {-1, 0, 1, -1, 1, -1, 0, 1};

  bool flag = true;
  rep(i, H) {
    rep(j, W) {
      if (s.at(i).at(j) == '#') {
        int cnt = 0;
        rep(k, 8) {
          int x = i + dx(k);
          int y = j + dy(k);
          if (x >= 0 && x < H && y >= 0 && y < W) {
            if (s.at(x).at(y) == '#') {
              ++cnt;
              break;
            }
          }
        }
        if (cnt == 0) {
          flag = false;
          break;
        }
      }
    }
    if (!(flag)) break;
  }
  if (flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: no match for call to '(std::vector<int>) (int&)'
   22 |           int x = i + dx(k);
      |                       ~~^~~
a.cc:23:25: error: no match for call to '(std::vector<int>) (int&)'
   23 |           int y = j + dy(k);
      |                       ~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int h, w;
vector<vector<bool>> flg(51, vector<bool>(51));
vector<vector<char>> hw(51, vector<char>(51));
int cnt = 0;
void dfs ( int x, int y ) {
    if ( x < 0 || x >= w || y < 0 || y >= h ) return;
    if ( flg[y][x] ) return;
    if ( hw[y][x] == '.' ) return;
    flg[y][x] = true;
    ++cnt;
    dfs(x+1, y);
    dfs(x-1, y);
    dfs(x, y+1);
    dfs(x, y-1);
    return;
}
int main() {
    cin >> h >> w;
    if ( h == 1 && w == 1 ) {
        if ( h[0][0] == '.' ) cout << "Yes" << endl;
        else                  cout << "No" << endl;
        return 0;
    }
    rep(i, h) rep(j, w) cin >> hw[i][j];
    rep(i, h) rep(j, w) {
        if ( !flg[i][j] && hw[i][j] == '#' ) {
            cnt = 0;
            dfs(i, j);
            if ( cnt == 1 ) {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: invalid types 'int[int]' for array subscript
   25 |         if ( h[0][0] == '.' ) cout << "Yes" << endl;
      |               ^
Language: C++

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


int main(){
 int H,W;
 cin>>H>>W;
 char f[W][H];
 bool flag = true;
 for(int i = 0;i < W;i++){
     for(int j = 0;j < H;j++)cin>>f[i][j]
 }
 for(int i = 0;i < W;i++){
     for(int j = 0;j < H;j++){
         if(f[i][j+1] == '#' || f[i+1][j] == '#' ||f[i][j-1] == '#' ||f[i-1][j] == '#');
         else flag =false;
     }
 }
 if(flag)cout<<"Yes";
 else cout<<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:42: error: expected ';' before '}' token
   11 |      for(int j = 0;j < H;j++)cin>>f[i][j]
      |                                          ^
      |                                          ;
   12 |  }
      |  ~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
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 vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int q[4]={0,1,-1,0};
int w[4]={1,0,0,-1};
int main(){
  ll h,w;
  cin>>h>>w;
  vector<vector<char>> t(h+2,vector<char> (w+2,'.'));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      char a;
      cin>>a;
      t[i][j]=a;
    }
  }
  
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      if(t[i][j]=='#'){
        ll cu=1;
        rep(u,4){
          int nx=i+q[u];
int ny=j+w[u];
          if(t[nx][ny]=='#'){
            cu=0;
          }
        }
        if(cu){
          COUT("No");
          return 0;
        }
      }
    }
  }
  COUT("Yes");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:11: error: invalid types 'long long int[long long int]' for array subscript
   58 | int ny=j+w[u];
      |           ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
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 vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int q[4]={0,1,-1,0};
int w[4]={1,0,0,-1};
int main(){
  ll h,w;
  cin>>h>>w;
  vector<vector<char>> t(h+2,vector<char> (w+2,'.'));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      char a;
      cin>>a;
      t[i][j]=a;
    }
  }
  
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      if(t[i][j]=='#'){
        ll cu=1;
        rep(u,4){
          int nx=i+q[u];
          int ny=j+w[u];
          if(t[nx][ny]=='#'){
            cu=0;
          }
        }
        if(cu){
          COUT("No");
          return 0;
        }
      }
    }
  }
  COUT("Yes");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:21: error: invalid types 'long long int[long long int]' for array subscript
   58 |           int ny=j+w[u];
      |                     ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
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 vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int q[4]={0,1,-1,0};
int w[4]={1,0,0,-1};
int main(){
  ll h,w;
  cin>>h>>w;
  vector<vector<char>> t(h+2,vector<char> (w+2,'.'));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      char a;
      cin>>a;
      t[i][j]=a;
    }
  }
  
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      if(t[i][j]=='#'){
        ll cu=1;
        rep(u,4){
          int nx=i+q[u];
          int ny=j+w[u]
          if(t[nx][ny]=='#'){
            cu=0;
          }
        }
        if(cu){
          COUT("No");
          return 0;
        }
      }
    }
  }
  COUT("Yes");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:21: error: invalid types 'long long int[long long int]' for array subscript
   58 |           int ny=j+w[u]
      |                     ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
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 vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
vll q(4)={0,1,-1,0};
vll w(4)={1,0,0,-1};
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<char>> t(h+2,vector<char> (w+2,'.'));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      char a;
      cin>>a;
      t[i][j]=a;
    }
  }
  
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      if(t[i][j]=='#'){
        int cu=1;
        rep(u,4){
          if(t[i+q[u]][j+w[u]]=='#'){
            cu=0;
          }
        }
        if(cu){
          COUT("No");
          return 0;
        }
      }
    }
  }
  COUT("Yes");
}


Compiler output:
a.cc:38:9: error: expected ',' or ';' before '=' token
   38 | vll q(4)={0,1,-1,0};
      |         ^
a.cc:39:9: error: expected ',' or ';' before '=' token
   39 | vll w(4)={1,0,0,-1};
      |         ^
a.cc: In function 'int main()':
a.cc:57:27: error: invalid types 'int[long long int]' for array subscript
   57 |           if(t[i+q[u]][j+w[u]]=='#'){
      |                           ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
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 vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int q[4]={0,1,-1,0};
int w[4]={1,0,0,-1};
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<char>> t(h+2,vector<char> (w+2,'.'));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      char a;
      cin>>a;
      t[i][j]=a;
    }
  }
  
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      if(t[i][j]=='#'){
       int  cu=1;
        rep(u,4){
          if(t[i+q[u]][j+w[u]]=='#'){
            cu=0;
          }
        }
        if(cu){
          COUT("No");
          return 0;
        }
      }
    }
  }
  COUT("Yes");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:27: error: invalid types 'int[long long int]' for array subscript
   57 |           if(t[i+q[u]][j+w[u]]=='#'){
      |                           ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
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 vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int q[4]={0,1,-1,0};
int w[4]={1,0,0,-1};
int main(){
  ll h,w;
  cin>>h>>w;
  vector<vector<char>> t(h+2,vector<char> (w+2,'.'));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      char a;
      cin>>a;
      t[i][j]=a;
    }
  }
  
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      if(t[i][j]=='#'){
        ll cu=1;
        rep(u,4){
          if(t[i+q[u]][j+w[u]]=='#'){
            cu=0;
          }
        }
        if(cu){
          COUT("No");
          return 0;
        }
      }
    }
  }
  COUT("Yes");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:27: error: invalid types 'long long int[long long int]' for array subscript
   57 |           if(t[i+q[u]][j+w[u]]=='#'){
      |                           ^
Language: C++

#include <iostream>
using namespace std;

int main(void){
  int h, w;
  int flg = 1;
  cin >> h >> w;
  
  string board[50];
  
  for (int i=0; i<h; i++) {
    cin >> board[i];
  }
  
  dx[4] = {1, -1, 0, 0};
  dy[4] = {0, 0, 1, -1};
  
  
  for (int i=0; i<h; i++) {
    for (int j=0; j<w; j++) {
      int flg2 = 0;
      if (board[i][j] == '.') continue;
      
      for (int d=0; d<4; d++) {
        const int ni = i + dx[d];
        const int nj = j + dy[d];
        
        if (ni < 0 or ni >= h) continue;
        if (nj < 0 or nj >= w) continue;
        
        if (board[ni][nj] == '#') flg2 = 1;
      }
      if (flg2 == 0) flg = 0;
    }
  }
  
  if (flg == 0) cout << "No" << endl;
  else cout << "Yes" << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'dx' was not declared in this scope
   15 |   dx[4] = {1, -1, 0, 0};
      |   ^~
a.cc:16:3: error: 'dy' was not declared in this scope
   16 |   dy[4] = {0, 0, 1, -1};
      |   ^~
Language: C++

#include <iostream>
using namespace std;

int main(void){
  int h, w;
  int flg = 1;
  cin >> h >> w;
  
  string board[50];
  
  for (int i=0; i<h; i++) {
    cin >> board[i];
  }
  
  dx[4] = {1, -1, 0, 0};
  dy[4] = {0, 0, 1, -1};
  
  
  for (int i=0; i<h; i++) {
    for (int j=0; j<w; j++) {
      int flg2 = 0;
      if (board[i][j] == '.') continue;
      
      for (int d=0; d<4; d++) {
        const int ni = i + dx[d];
        const int nj = j + dy[d];
        
        if (ni < 0 or ni >= h) continue;
        if (nj < 0 or nj >= w) continue;
        
        if (board[ni][nj] == '#') flg2 = 1;
      }
      if (flg2 == 0) flg = 0;
    }
  }
  
  if (flg == 0) cout << 'No' << endl;
  else cout << 'Yes' << endl;
  
  return 0;
}

Compiler output:
a.cc:37:25: warning: multi-character character constant [-Wmultichar]
   37 |   if (flg == 0) cout << 'No' << endl;
      |                         ^~~~
a.cc:38:16: warning: multi-character character constant [-Wmultichar]
   38 |   else cout << 'Yes' << endl;
      |                ^~~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'dx' was not declared in this scope
   15 |   dx[4] = {1, -1, 0, 0};
      |   ^~
a.cc:16:3: error: 'dy' was not declared in this scope
   16 |   dy[4] = {0, 0, 1, -1};
      |   ^~
Language: C++

#include <iostream>
using namespace std;

int main(void){
  int h, w;
  int flg = 1;
  cin >> h >> w;
  
  string board[50];
  
  for (int i=0; i<h; i++) {
    cin >> board[i];
  }
  
  dx[4] = {1, -1, 0, 0};
  dy[4] = {0, 0, 1, -1};
  
  
  for (int i=0; i<h; i++) {
    for (int j=0; j<w; j++) {
      int flg2 = 0;
      if (board[i][j] == '.') continue;
      
      for (int d=0; d<4; d++) {
        const ni = i + dx[d];
        const nj = j + dy[d];
        
        if (ni < 0 or ni >= h) continue;
        if (nj < 0 or nj >= w) continue;
        
        if (board[ni][nj] == '#') flg2 = 1;
      }
      if (flg2 == 0) flg = 0;
    }
  }
  
  if (flg == 0) cout << 'No' << endl;
  else cout << 'Yes' << endl;
}

Compiler output:
a.cc:37:25: warning: multi-character character constant [-Wmultichar]
   37 |   if (flg == 0) cout << 'No' << endl;
      |                         ^~~~
a.cc:38:16: warning: multi-character character constant [-Wmultichar]
   38 |   else cout << 'Yes' << endl;
      |                ^~~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'dx' was not declared in this scope
   15 |   dx[4] = {1, -1, 0, 0};
      |   ^~
a.cc:16:3: error: 'dy' was not declared in this scope
   16 |   dy[4] = {0, 0, 1, -1};
      |   ^~
a.cc:25:15: error: 'ni' does not name a type
   25 |         const ni = i + dx[d];
      |               ^~
a.cc:26:15: error: 'nj' does not name a type
   26 |         const nj = j + dy[d];
      |               ^~
a.cc:28:13: error: 'ni' was not declared in this scope; did you mean 'i'?
   28 |         if (ni < 0 or ni >= h) continue;
      |             ^~
      |             i
a.cc:29:13: error: 'nj' was not declared in this scope; did you mean 'j'?
   29 |         if (nj < 0 or nj >= w) continue;
      |             ^~
      |             j
a.cc:31:19: error: 'ni' was not declared in this scope; did you mean 'i'?
   31 |         if (board[ni][nj] == '#') flg2 = 1;
      |                   ^~
      |                   i
a.cc:31:23: error: 'nj' was not declared in this scope; did you mean 'j'?
   31 |         if (board[ni][nj] == '#') flg2 = 1;
      |                       ^~
      |                       j
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, d, n) for(int i=(d); i<(n); i++)
int main() {

    int h, w;
    cin >> h >> w;
    char s[55][55] = {};
    REP(i, 1, h){
        REP(j, 1, w){
            cin >> s[i][j];
        }
    }

    REP(i, 1, h){
        REP(j, 1, w){
            if(s[i][j] == '#'){
                if(s[i+1][j] != '#' && s[i-1][j] != '#' && s[i][j+1] != '#' && s[i][j-1] != '#'){
                    cout << "No" << endl;
                    return 0;
            }
        }
    }
    cout << "Yes" << endl;

    return 0;
}

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

#include <iostream>
using namespace std;
int main(){
  int h, w, i, j;
  cin >> h >> w;
  char s[h+2][w+2];
  for(i=1; i<h+1; i++)
    for(j=1; j<w+1; j++)
      cin >> s[i][j];
  for(i=1; i<h+1; i++)
    for(j=1; j<w+1; j++)
      if(s[i][j]=="#"&&s[i+1][j]!="#"&&s[i-1][j]!="#"&&s[i][j-1]!="#"&&s[i][j+1]!="#"){
        cout <<"No";
        return 0;
      }
  cout << "Yes";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if(s[i][j]=="#"&&s[i+1][j]!="#"&&s[i-1][j]!="#"&&s[i][j-1]!="#"&&s[i][j+1]!="#"){
      |          ~~~~~~~^~~~~
a.cc:12:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if(s[i][j]=="#"&&s[i+1][j]!="#"&&s[i-1][j]!="#"&&s[i][j-1]!="#"&&s[i][j+1]!="#"){
      |                        ~~~~~~~~~^~~~~
a.cc:12:49: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if(s[i][j]=="#"&&s[i+1][j]!="#"&&s[i-1][j]!="#"&&s[i][j-1]!="#"&&s[i][j+1]!="#"){
      |                                        ~~~~~~~~~^~~~~
a.cc:12:65: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if(s[i][j]=="#"&&s[i+1][j]!="#"&&s[i-1][j]!="#"&&s[i][j-1]!="#"&&s[i][j+1]!="#"){
      |                                                        ~~~~~~~~~^~~~~
a.cc:12:81: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if(s[i][j]=="#"&&s[i+1][j]!="#"&&s[i-1][j]!="#"&&s[i][j-1]!="#"&&s[i][j+1]!="#"){
      |                                                                        ~~~~~~~~~^~~~~
Language: Java

import java.util.Scanner;

public class Main{
	
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		LinkedList<Integer> scores = new LinkedList<>();
		
		// input
		final int HEIGHT = scan.nextInt();
		final int WIDTH = scan.nextInt();
		char[][] canvas = new char[HEIGHT+2][WIDTH+2];
		for(int i = 1; i <= HEIGHT; i++){
			String input = scan.next();
			char[] temp = input.toCharArray();
			for(int j = 1; j <= WIDTH; j++){
				canvas[i][j] = temp[j-1];
			}
		}
		
		// search
		String answer = "Yes";
		loop: for(int i = 1; i <= HEIGHT; i++){
			for(int j = 1; j <= WIDTH; j++){
				if(canvas[i][j] == '#'){
					if(canvas[i-1][j] != '#' && canvas[i+1][j] != '#' && canvas[i][j-1] != '#' && canvas[i][j+1] != '#'){
						answer = "No";
						break loop;
					}
				}
			}
		}
		
		// answer
		System.out.println(answer);

	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		LinkedList<Integer> scores = new LinkedList<>();
		^
  symbol:   class LinkedList
  location: class Main
Main.java:7: error: cannot find symbol
		LinkedList<Integer> scores = new LinkedList<>();
		                                 ^
  symbol:   class LinkedList
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define fs first
#define sc second
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<tuple<ll,ll>> vtl;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

void solve(){
    //abc96c
    int h,w;
    cin>>h>>w;
    string board[60];
    rep(i,h)cin>>board[i];
    int dx[]={1,0,-1,0};
    int dy[]={0,1,0,-1};
    bool f=0;
    
    rep(i,h){
        rep(j,w){
            if(board[i][j]=='#'){
                rep(k,4){
                    int cnt=0;
                    int x=i+dx[k];
                    int y=j+dy[k];
                    if(x>=0&&x<h&&y>=0&&y<w&&board[x][y]=='#')f=1;
                    else cnt++;
                }
                if(cnt==4){
                    f=0;
                    break;
                }
            }
        }
        if(!f)break;
    }
    if(h==1&&w==1&&board[0][0]=='#'){
        cout<<"Yes"<<endl;
        return;
    }
    cout<<(f?"Yes":"No")<<endl;
}

int main(){
    cout<<std::fixed<<std::setprecision(10);
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:38:20: error: 'cnt' was not declared in this scope; did you mean 'int'?
   38 |                 if(cnt==4){
      |                    ^~~
      |                    int
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define fs first
#define sc second
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<tuple<ll,ll>> vtl;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

void solve(){
    //abc96c
    int h,w;
    cin>>h>>w;
    string board[60];
    rep(i,h)cin>>board[i];
    int dx[]={1,0,-1,0};
    int dy[]={0,1,0,-1};
    bool f=0;
    int cnt=0;
    rep(i,h){
        rep(j,w){
            if (c[i][j] == '#' && c[i][j - 1] != '#' && c[i - 1][j] != '#' && c[i][j + 1] != '#' && c[i + 1][j] != '#') cnt++;
        }
    }
    if(h==1&&w==1&&board[0][0]=='#'){
        cout<<"Yes"<<endl;
        return;
    }
    cout<<(cnt==0?"Yes":"No")<<endl;
}

int main(){
    cout<<std::fixed<<std::setprecision(10);
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:30:17: error: 'c' was not declared in this scope
   30 |             if (c[i][j] == '#' && c[i][j - 1] != '#' && c[i - 1][j] != '#' && c[i][j + 1] != '#' && c[i + 1][j] != '#') cnt++;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define fs first
#define sc second
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<tuple<ll,ll>> vtl;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

void solve(){
    //abc96c
    int h,w;
    cin>>h>>w;
    string board[60];
    rep(i,h)cin>>board[i];
    int dx[]={1,0,-1,0};
    int dy[]={0,1,0,-1};
    bool f=0;
    int cnt=0;
    rep(i,h){
        rep(j,w){
            if(board[i][j]=='#'){
                rep(k,4){
                    int x=i+dx[k];
                    int y=j+dy[k];
                    if(x>=0&&x<h&&y>=0&&y<w&&board[x][y]=='#')f=1;
                    else cnt++;
                    if(cnt==4){
                        cout<<"No"<<endl;
                        return;
                    }
                }
            }
        }
    }
    if(h==1&&w==1&&board[0][0]=='#'){
        cout<<"Yes"<<endl;
        return;
    }
    cout<<(f?"Yes":"No")<<endl;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

using namespace std;

int main() {
  int h, w;
  cin >> h >> w;
  
  char s[55][55];
  bool can[55][55];
  for(int i = 1; i <= h; i++) {
    for(int j = 1; j <= w; j++) {
      cin >> s[i][j];
      if(s[i][j] == '#') {
        can[i][j] = true;
      }
    }
  }
  
  
  
   bool check = false;
  for(int i = 1; i <= h; i++) {
    for(int j = 1; j <= w; j++) {
      if(can[i][j]) {
        if(!can[i+1][j] && !can[i-1][j] && !can[i][j-1] && !can[i][j+1]) {
          check = true;
          break;
        }
      }
    }
    if(check) break;
  }
  if(!check) cout << "Yes" << endl;
  else cout << "No" << endl;   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> h >> w;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:32:14: error: 'cout' was not declared in this scope
   32 |   if(!check) cout << "Yes" << endl;
      |              ^~~~
a.cc:32:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:31: error: 'endl' was not declared in this scope
   32 |   if(!check) cout << "Yes" << endl;
      |                               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:33:8: error: 'cout' was not declared in this scope
   33 |   else cout << "No" << endl;
      |        ^~~~
a.cc:33:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:24: error: 'endl' was not declared in this scope
   33 |   else cout << "No" << endl;
      |                        ^~~~
a.cc:33:24: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

int main() {
  int h, w;
  cin >> h >> w;
  
  char grd[55][55];
  bool can[55][55];
  for(int i = 1; i <= h; i++) {
    for(int j = 1; j <= w; j++) {
      cin >> grd[i][j];
      if(grd[i][j] == '#') {
        can[i][j] = false;
    }
  }
   bool check; 
  for(int i = 1; i <= h; i++) {
    for(int j = 0; j <= w; j++) {
      if(!can[i][j]) {
        if(can[i+1][j] && can[i-1][j] && !can[i][j-1] && !can[i][j+1]) {
          check = false;
          break;
        }
      }
    }
    if(!check) break;
  }
  if(check) cout << "Yes" << endl;
  else cout << "No" << endl;   
}

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

#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;

string s[50];
int dx[] = {0,0, 1, -1};
int dy[] = {1, -1, 0, 0};

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int h, w;
    cin >> h >> w;
    for (int i = 0; i < h; ++i)
        cin >> s[i];
    for (int i = 0; i < h; ++i)
    {
        for (int j = 0; j < w; ++j)
        {
            if (s[i][j] == '.') continue;
            bool can = false;
            for (int k = 0; k < 4; ++k)
            {
                int ii = i + dx[k];
                int jj = j + dy[k];
                if (ii < 0 || jj < 0 || ii == h || jj == w) continue;
                if (a[ii][jj] == '#')
                    can = true;
            }
            if (!can)
                return cout << "No\n", 0;
        }
    }
    cout << "Yes\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: 'a' was not declared in this scope
   32 |                 if (a[ii][jj] == '#')
      |                     ^