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

#include <stdio.h> 

int main() {

	int L, N, i, j, k, l = 0, weight = 0;

	cin >> L >> N;

	int x[5000], w[5000], xx[5000], ww[5000];

	for (i = 0; i < N; i++) {
		cin >> x[i] >> w[i];
		weight = weight + x[i] * w[i];
	}

	j = 0;

	if (weight > 0) {
		l = L * -1;
	}
	if (weight < 0) {
		weight = weight * -1;
	}

	for (i = l; i <= L; i++) {
		if (i == 0)
			i++;

		ww[j] = weight / i;

		if (ww[j] != 0) {
			xx[j] = i;
			j++;
			weight = weight % i;
			if (weight == 0)
				k = 1;
		}
		if (k == 1) {
			break;
		}
		
			cout << 0;
			return 0;
		
	}

	cout << j - 1 << "\n";
	for (i = 0; i < j; i++)
		cout << xx[i] <<" " << ww[i] << "\n";

	

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> L >> N;
      |         ^~~
a.cc:42:25: error: 'cout' was not declared in this scope
   42 |                         cout << 0;
      |                         ^~~~
a.cc:47:9: error: 'cout' was not declared in this scope
   47 |         cout << j - 1 << "\n";
      |         ^~~~
Language: C++

#include <iostream>


using namespace std;

int main() {

	int L, N, i, j, k, l = 0,  n = 1, weight = 0;

	cin >> L >> N;

	int x[5000], w[5000], xx[5000], ww[5000];

	for (i = 0; i < N; i++) {
		cin >> x[i] >> w[i];
		weight = weight + x[i] * w[i];
	}

	j = 0;

	if (weight > 0) {
		l = L * -1 n = -1;
	}
	if (weight < 0) {
		weight = weight * -1;
	}

	for (i = l; i <= L; i++) {
		if (i == 0)
			i++;

		ww[j] = weight / i * n;

		if (ww[j] != 0) {
			xx[j] = i;
			j++;
			weight = weight % i;
			if (weight == 0)
				k = 1;
		}
		if (k == 1) {
			break;
		}
		
			cout << 0;
			return 0;
		
	}

	cout << j  << "\n";
	for (i = 0; i < j; i++)
		cout << xx[i] <<" " << ww[i] << "\n";

	

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: expected ';' before 'n'
   22 |                 l = L * -1 n = -1;
      |                           ^~
      |                           ;
Language: C++

#include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define ll2(x, y) ll x, y; cin >> x >> y;
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int2(l, n);
    pri(n);
    for(;n--;){
      int2(x, w);
      pri(-x, w);
    }


/*/

//*/ break;
  }
  return 0;
}

Compiler output:
a.cc:60:16: error: macro "pri" passed 2 arguments, but takes just 1
   60 |       pri(-x, w);
      |                ^
a.cc:35:9: note: macro "pri" defined here
   35 | #define pri(x) cout << (x) << "\n"
      |         ^~~
a.cc: In function 'int main()':
a.cc:60:7: error: 'pri' was not declared in this scope
   60 |       pri(-x, w);
      |       ^~~
Language: C

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

int main(void) {
	int N;
	char X[1024];
	int D;
	char YakusimaruHiroko[1024];
	int YosinagaSayuri;
	int MinaseInori;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%s", X) != 1) return 1;
	if (scanf("%d", &D) != 1) return 1;
	YosinagaSayuri = D;
	for (MinaseInori = 0; MinaseInori < N; MinaseInori++) {
		if (X[MinaseInori] == '0') {
			if (YosinagaSayuri > 0) {
				YakusimaruHiroko[MinaseInori] = '1';
				YosinagaSayuri--;
			} else {
				YakusimaruHiroko[MinaseInori] = '0';
			}
		} else {
			YakusimaruHiroko[MinaseInori] = '1';
		}
	}
	YakusimaruHiroko[N] = '\0';
	for (MinaseInori = N - 1; YosinagaSayuri > 0 && MinaseInori >= 0; MinaseInori--) {
		if (YakusimaruHiroko[MinaseInori] == '1' && X[MinaseInori] == '1') {
			YakusimaruHiroko[MinaseInori] = '0';
			YosinagaSayuri--;
		}
	}
	puts(YakusimaruHiroko);
	return 0;
}
#include <stdio.h>
#include <string.h>

int main(void) {
	int N;
	char X[1024];
	int D;
	char YakusimaruHiroko[1024];
	int YosinagaSayuri;
	int MinaseInori;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%s", X) != 1) return 1;
	if (scanf("%d", &D) != 1) return 1;
	YosinagaSayuri = D;
	for (MinaseInori = 0; MinaseInori < N; MinaseInori++) {
		if (X[MinaseInori] == '0') {
			if (YosinagaSayuri > 0) {
				YakusimaruHiroko[MinaseInori] = '1';
				YosinagaSayuri--;
			} else {
				YakusimaruHiroko[MinaseInori] = '0';
			}
		} else {
			YakusimaruHiroko[MinaseInori] = '1';
		}
	}
	YakusimaruHiroko[N] = '\0';
	for (MinaseInori = N - 1; YosinagaSayuri > 0 && MinaseInori >= 0; MinaseInori--) {
		if (YakusimaruHiroko[MinaseInori] == '1' && X[MinaseInori] == '1') {
			YakusimaruHiroko[MinaseInori] = '0';
			YosinagaSayuri--;
		}
	}
	puts(YakusimaruHiroko);
	return 0;
}

Compiler output:
main.c:40:5: error: redefinition of 'main'
   40 | int main(void) {
      |     ^~~~
main.c:4:5: note: previous definition of 'main' with type 'int(void)'
    4 | int main(void) {
      |     ^~~~
Language: C++

#include<stdio.h>

int N, D;
char data[1010];
char aaa[1010];

void input(){
	scanf("%d\n", &N);
	gets(data);
	scanf("%d", &D);
}

void process(){
	int cnt = 0;
	for (int i = 0; i < N; ++i){
		aaa[i] = '1';
		cnt += aaa[i] != data[i];
	}

	if (cnt > D){
		for (int i = N - 1; i >= 0; --i){
			if (data[i] != aaa[i]) {
				aaa[i] = '0';
				--cnt;
				if (cnt == D) break;
			}
		}
	}
	else if (cnt < D){
		for (int i = N - 1; i >= 0; --i) {
			if (data[i] == aaa[i]) {
				aaa[i] = '0';
				++cnt;
				if (cnt == D) break;
			}
		}
	}
}

void output(){
	printf("%s\n", aaa);
}

int main() {
	input();
	process();
	output();
	return 0;
}

Compiler output:
a.cc: In function 'void input()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |         gets(data);
      |         ^~~~
      |         getw
Language: C++

#include<iostream>
#include<string>
using namespace std;
string S,T;int n,p;
int main(){
	cin>>n>>S>>p;T=S
	for(int i=0;i<S.size();i++){
		if(p>=1 && S[i]=='0'){T[i]='1';p--;}
	}
	for(int i=S.size()-1;i>=0;i--){
		if(p>=1 && S[i]=='1'){T[i]='0';p--;}
	}
	cout<<T<<endl;return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: expected ';' before 'for'
    6 |         cin>>n>>S>>p;T=S
      |                         ^
      |                         ;
    7 |         for(int i=0;i<S.size();i++){
      |         ~~~              
a.cc:7:21: error: 'i' was not declared in this scope
    7 |         for(int i=0;i<S.size();i++){
      |                     ^
Language: C++

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

int main() {
    int N;
    cin >> N;
    string num;
    cin >> num;
    int hum;
    cin >> hum;

    vector<int> used(N);
    int c = 0;
    for (int i = 0; i < N && c < hum; i++) {
        if (num[i] == '0') {
            num[i] = '1';
            c++;
            used[i] = true;
        }
    }

    int j = N-1;
    while (c < N) {
        if (!used[i]) {
            c++;
            num[j] = '0';
        }
        j--;
    }

    cout << num << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'i' was not declared in this scope
   24 |         if (!used[i]) {
      |                   ^
Language: C++

# -*- coding: utf-8 -*-

from collections import Counter

N = input()
S = input().split('+')

dic_chr_num = Counter(S)
dic_num_kind = Counter(dic_chr_num.values())

ans = 4 * len(dic_chr_num) - 1
for num, kind in dic_num_kind.items():
    if num == 1:
        ans -= 2 * kind
    elif kind >= 2:
        ans -= 2 * (kind - 2)

print(ans)

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:3:1: error: 'from' does not name a type
    3 | from collections import Counter
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int n,ans=0;string s;
cin>>n>>s;
int d[26]={};
int a[11]={};
for(int i=0;i<s.size();i++)d[s[i]-'a']++;
for(int i=0;i<26;i++){
if(d[i]){
ams++;
a[d[i]]++;
}
}
if(ans)ans--;
ans+=a[1]
for(int i=2;i<11;i++){
ans+=min(a[i]+4,a[i]*3);
}
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: 'ams' was not declared in this scope; did you mean 'ans'?
   11 | ams++;
      | ^~~
      | ans
a.cc:16:10: error: expected ';' before 'for'
   16 | ans+=a[1]
      |          ^
      |          ;
   17 | for(int i=2;i<11;i++){
      | ~~~       
a.cc:17:13: error: 'i' was not declared in this scope
   17 | for(int i=2;i<11;i++){
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,ans=0;string s;
  cin>>n>>s;
  int d[26]={};
  int a[11]={};
  for(int i=0;i<s.size();i++)d[s[i]-'a']++;
  for(int i=0;i<26;i++){
    if(d[i]){
ans++;
a[d[i]]++;
}
}
if(ans)ans--;
ans+=a[1]
for(int i=2;i<11;i++){
ans+=min(a[i]+4,a[i]*3);
}
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: expected ';' before 'for'
   16 | ans+=a[1]
      |          ^
      |          ;
   17 | for(int i=2;i<11;i++){
      | ~~~       
a.cc:17:13: error: 'i' was not declared in this scope
   17 | for(int i=2;i<11;i++){
      |             ^
Language: C++

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

int memo[50][860][860];
int N;
int sum = 0;
vector<int> t;

int dfs(int i, int x, int y){
	if(i == N){
		int z = sum - x - y;
		return max({x,y,z});
	}
	if(memo[i][x][y]>=0) return memo[i][x][y];
	int ans = INF;
	if(x+t[i]<860) ans = min(ans,dfs(i+1,x+t[i],y));
	if(y+t[i]<860) ans = min(ans,dfs(i+1,x,y+t[i]));
	if(sum-x-y+t[i]<860) ans = min(ans,dfs(i+1,x,y));
	memo[i][x][y] = ans;
	return ans;
}

int main(void){
	memset(memo,-1,sizeof(memo));
	cin >> N;
	t.resize(N);
	for(int i = 0; i < N; ++i){
		cin >> t[i];
		sum += t[i];
	}
	cout << dfs(0,0,0) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'memset' was not declared in this scope
   28 |         memset(memo,-1,sizeof(memo));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C++

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

int s=0;
int upper;
int N;
int T[51];
int dp[51][900][900];

int dfs(int idx,int a,int b) {
    if(idx==N) {
        int t=max({a,b,s-a-b});
        return t;
    }
    if(dp[idx][a][b]!=-1) return dp[idx][a][b];
    int ret=dfs(idx+1,a,b);
    if(upper>a+T[idx]) ret=min(ret,dfs(idx+1,a+T[idx],b));
    if(upper>b+T[idx]) ret=min(ret,dfs(idx+1,a,b+T[idx]));
    return dp[idx][a][b]=ret;
}

int main() {
    memset(dp,-1,sizeof(dp));
    cin>>N;
    rep(i,N) cin>>T[i];
    rep(i,N) s+=T[i];
    upper=s/3+51;
    cout<<dfs(0,0,0)<<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(dp,-1,sizeof(dp));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

ll n;

vector<ll> good;
set<ll> tmp[20];

vl select;

// map<ll,ll> dp;
// ll dfs(ll x){
//   if(dp.count(x))return dp[x];
//   int mx = lower_bound(ALL(good),x)-good.begin();
//   if(mx >= good.size()) mx = good.size()-1;
//   ll res = 1145141919810ll;
//   while(mx){
//     if(x%good[mx]){
//       ll d = dfs(x/good[mx]);
//       if(d!=-1)res = min(res,dfs(x/good[mx]));
//     }
//   }
//   if(res == 1145141919810ll) res = -1;
//   return dp[x] = res;
// }

int main(){
  cin>>n;
  if(n==1){
    cout<<-1<<endl;
    return 0;
  }
  // init good number
  tmp[0].insert(2);
  tmp[0].insert(8);
  set<ll>::iterator iter;
  REP(i,16){
    iter = tmp[i].begin();
    while(iter!=tmp[i].end()){
      ll x = *iter;
      tmp[i+1].insert(x*10ll+2ll);
      tmp[i+1].insert(x*10ll+8ll);
      ++iter;
    }
  }
  REP(_i,17){
    int i = 16-_i;
    iter = tmp[i].end(); --iter;
    tmp[i].erase(iter);
    iter = tmp[i].begin();
    while(iter!=tmp[i].end()){
      good.push_back(*iter);
      ++iter;
    }
  }
  // solve

  // select.push_back(2);
  // REPR(i,good.size()){
  //   ll x = __gcd(n,good[i]);
  //   if(__builtin_popcount(x)>1)select.push_back(good[i]);
  // }
  // DEBUG(good.size());
  // DEBUG(select.size());

  ll res = 0;
  REP(i,good.size()){
    // int i = good.size()-1-_i;
    ll val = good[i];
    while(n%val==0){
      res++;
      n/=val;
    }
  }
  if(n!=1)res=-1;
  cout<<res<<endl;
  return 0;
}

Compiler output:
a.cc:27:4: error: 'vl select' redeclared as different kind of entity
   27 | vl select;
      |    ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
                 from /usr/include/stdlib.h:514,
                 from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/sys/select.h:102:12: note: previous declaration 'int select(int, fd_set*, fd_set*, fd_set*, timeval*)'
  102 | extern int select (int __nfds, fd_set *__restrict __readfds,
      |            ^~~~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int d[2]={2,8},ans=-1;
vector<ll> v;

void func(int x,ll k){
  if(x) v.push_back(k);
  if(x==18) return ;
  for(int i=0;i<2;i++) func(x+1,k*10+d[i]);
}

void func2(int x,ll k,int sum){
  if(k==1&&sum) ans=max(ans,sum);
  if(v[x]>k) return ;
  if(k%!s[x]) func2(x,k/s[x],sum+1);
  if(x+1!=v.size()) func2(x+1,k,sum);
}

int main(){
  ll n;
  cin>>n;
  func(0,0);
  sort(v.begin(),v.end());
  func2(0,n,0);
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'void func2(int, ll, int)':
a.cc:18:9: error: 's' was not declared in this scope
   18 |   if(k%!s[x]) func2(x,k/s[x],sum+1);
      |         ^
Language: C++

#include <utility>
#include <tuple>
#include <algorithm>
#include <type_traits>
#include <queue>
#include <functional>
#include <vector>
#include <string>
#include <stack>
#include <iostream>
namespace lc {
template <typename EdgeType>
class AdjacencyList {
public:
	typedef std::vector<EdgeType> ListType;
private:
	std::vector<ListType> m_lists;
public:
	explicit AdjacencyList(int n = 0)
		: m_lists(n)
	{ }
};
}
using namespace std;
typedef lc::EdgeWithWeight<int> Edge;
lc::AdjacencyList<Edge> graph;

Compiler output:
a.cc:25:13: error: 'EdgeWithWeight' in namespace 'lc' does not name a template type
   25 | typedef lc::EdgeWithWeight<int> Edge;
      |             ^~~~~~~~~~~~~~
a.cc:26:19: error: 'Edge' was not declared in this scope
   26 | lc::AdjacencyList<Edge> graph;
      |                   ^~~~
a.cc:26:23: error: template argument 1 is invalid
   26 | lc::AdjacencyList<Edge> graph;
      |                       ^
Language: C++

#include<bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;

int n, ans;
int dp1[100000]; //????????§??????????????§??????
int dp2[100000]; //????????§??????????????§??????????????????
int dp3[100000]; //????????\????????¨?????¨?????´???
vector<vector<pi>> e;

void dfs(int c, int p){
	vector<pi> ls, rs;
	int iter = 0;
	for(pi i : e[c]) if(i.first != p){
		dfs(i.first, c);
		dp1[c] = max(dp1[c], max(i.second, dp1[i.first]));
		dp2[c] = max(dp2[c], i.second + dp2[i.first]);
		dp3[c] = max(dp3[c], dp3[i.first]);
		rs.pb(mp(dp3[i.first], i.first));
		ls.pb(mp(i.second + dp2[i.first], i.first));
		
		if(++iter % 100 == 0){
			sort(all(ls), greater<pi>()); ls.resize(2);
			sort(all(rs), greater<pi>()); rs.resize(2);
		}
	}z
	sort(all(ls), greater<pi>());
	sort(all(rs), greater<pi>());
	if(ls.size() > 0) dp3[c] = max(dp3[c], ls[0].first + (ls.size() > 1 ? ls[1].first : 0));
	
	for(pi i : e[c]) if(i.first != p){
		ans = max(ans, dp3[i.first] + i.second);
		int cnt = 2, sum = max(i.second, dp1[i.first]);
		for(pi j : ls) if(j.second != i.first){
			sum += j.first;
			if(--cnt == 0) break;
		}
		ans = max(ans, sum);
		for(pi j : rs) if(j.second != i.first){
			ans = max(ans, j.first + dp1[i.first]);
			break;
		}
	}
}
int main(){
	cin >> n;
	e.resize(n);
	for(int i = 1; i < n; i++){
		int a, b; cin >> a >> b;
		e[i].pb(mp(a, b));
		e[a].pb(mp(i, b));
	}
	if(n == 2) ans = e[0][0].second;
	dfs(0, 0);
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:39:10: error: 'z' was not declared in this scope
   39 |         }z
      |          ^
Language: C++

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

bool check(int N, vector<int>& a, int t) {
	for (int i = 0; i + t < N; i++)
		if (a[i] != a[i + t])
			return false;
	return true;
}

int main() {
	int N; cin >> N;
	vector<int> a(N);
	for (int i = 0; i < N; i++)
		scanf("%d", &a[i]);
	int mi = INT_MAX;
	for (int d = 1; d * d <= N; d++)
		if (N % d == 0) {
			if (check(N, a, d)) mi = min(mi, d);
			if (check(N, a, N / d)) mi = min(mi, N / d);
		}
	cout << N / mi << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: 'INT_MAX' was not declared in this scope
   17 |         int mi = INT_MAX;
      |                  ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

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

vector<int> divisors(int x) {
  vector<int> ret;
  int p = 1;
  while((long long)p*p <= x) {
    if(x % p == 0) {
      ret.push_back(p);
      ret.push_back(x/p);
    }
    p++;
  }
  return ret;
}

int N;

bool isvalid(int T,vector<int> s){
  vector<int> ans;
  rep(i,T)ans.push_back(s[i]);
  for(int i=T;i<s.size();i+=T){
    bool f=true;
    rep(j,T){
      if(ans[j]!=s[i+j])return false;
    }
  }
  return true;
}


int main() {

  cin >> N;
  vector<int> S(N);
  rep(i, N) {
    cin >> S[i];
  }

  auto yakusu = divisors(N);
  sort(yakusu.begin(),yakusu.end());

  rep(i, yakusu.size()) {
    int T = yakusu[i];
    if(isvalid(T,S)){
      cout<<N/T<<endl;
      return 0;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   46 |   sort(yakusu.begin(),yakusu.end());
      |   ^~~~
      |   short
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b))<EPS)
class Point{
  public:
  double x,y;
  Point(double x=0,double y=0):x(x),y(y){}
  Point operator + (Point p){return Point(x+p.x,y+p.y);}
  Point operator - (Point p){return Point(x-p.x,y-p.y);}
};
struct seg{Point p1,p2;};
double norm(Point p){return p.x*p.x+p.y*p.y;}
double abs(Point p){return sqrt(norm(p));}
double dot(Point a,Point b){return a.x*b.x+a.y*b.y;}
double cross(Point a,Point b){return a.x*b.y-a.y*b.x;}
double getDistancePP(Point a,Point b){return abs(a-b);}
double getDistanceLP(seg l,Point p){return abs(cross(l.p2-l.p1,p-l.p1)/abs(l.p2-l.p1));}
double getDistanceSP(seg s,Point p){
  if(dot(s.p2-s.p1,p-s.p1)<0.0)return abs(p-s.p1);
  if(dot(s.p1-s.p2,p-s.p2)<0.0)return abs(p-s.p2);
  return getDistanceLP(s,p);
}
int n,m,c=1,pre,fro,p;
Point a[5001];
bool vis[5001];
double d=1000000000,dis=0;
int main(){
  cin>>n>>m>>a[0].x>>a[0].y;
  r(i,n)scanf("%lf%lf"a[i+1].x,a[i+1].y);
  r(i,n){
    double t=abs(a[0]-a[i+1]);
    if(d>t)p=i+1,d=t;
  }
  dis+=d;
  vis[0]=1;vis[p]=1;
  vector<seg>s;
  seg w;w.p1=a[0];w.p2=a[p];
  s.push_back(w);
  while(c!=m){
    c++;d=10000000000;
    r(i,s.size())r(j,n+1)if(!vis[j]){
      double t=getDistanceSP(s[i],a[j]);
      if(t<d)d=t,fro=j;
    }
    d=1000000000;
    r(i,n+1)if(vis[i]){
      double t=abs(a[i]-a[fro]);
      if(d>t)d=t,pre=i;
    }
    w.p1=a[pre];w.p2=a[fro];
    s.push_back(w);
    dis+=d;
    vis[fro]=1;
  }
  printf("%.12f\n",dis);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: unable to find string literal operator 'operator""a' with 'const char [7]', 'long unsigned int' arguments
   31 |   r(i,n)scanf("%lf%lf"a[i+1].x,a[i+1].y);
      |               ^~~~~~~~~
Language: C++

#include <vector>
#include <cstdio>
using namespace std;
??
struct FenwickTree {
	typedef int T;
	vector<T> v;
	void init(int n) { v.assign(n, 0); }
	void add(int i, T x) {
		for(; i < (int)v.size(); i |= i + 1) v[i] += x;
	}
	T sum(int i) const {?????? //[0, i)
		T r = 0;
		for(-- i; i >= 0; i = (i & (i + 1)) - 1) r += v[i];
		return r;
	}
	T sum(int left, int right) const {?? //[left, right)
		return sum(right) - sum(left);
	}
};
??
int main() {
	int N;
	while(~scanf("%d", &N)) {
		vector<int> p(N);
		for(int i = 0; i < N; ++ i)
			scanf("%d", &p[i]), -- p[i];
		int BlockSize = 200, NumBlocks = N / BlockSize + 1;
		vector<vector<long long> > memo(NumBlocks, vector<long long>(N));
		FenwickTree ft;
		for(int bi = 0; bi < NumBlocks; ++ bi) {
			vector<long long> &v = memo[bi];
			int i = bi * BlockSize;
			{
				ft.init(N);
				long long sum = 0;
				for(int j = i; j < N; ++ j) {
					sum += (j - i) - ft.sum(p[j]);
					v[j] = sum;
					ft.add(p[j], 1);
				}
			}
			{
				ft.init(N);
				long long sum = 0;
				for(int j = i - 1; j >= 0; -- j) {
					sum += ft.sum(p[j]);
					v[j] = sum;
					ft.add(p[j], 1);
				}
			}
		}
		ft.init(N);
		int Q;
		scanf("%d", &Q);
		for(int ii = 0; ii < Q; ++ ii) {
			int l; int r;
			scanf("%d%d", &l, &r), -- l, -- r;
			int bl = (l + BlockSize - 1) / BlockSize, br = (r - 1) / BlockSize;
			long long ans = 0;
			if(bl > br) {
				for(int i = r; i >= l; -- i) {
					ans += ft.sum(p[i]);
					ft.add(p[i], 1);
				}
				for(int i = l; i <= r; ++ i)
					ft.add(p[i], -1);
			} else {
				int L = bl * BlockSize, R = br * BlockSize;
				ans += memo[bl][r];
				ans += memo[br][l];
				if(bl < br)
					ans -= memo[bl][R - 1];
				for(int i = R; i <= r; ++ i)
					ft.add(p[i], 1);
				for(int i = l; i < L; ++ i)
					ans += ft.sum(p[i]);
				for(int i = R; i <= r; ++ i)
					ft.add(p[i], -1);
			}
			printf("%lld\n", ans); fflush(stdout);
		}
	}
	return 0;
}

Compiler output:
a.cc:4:1: error: expected unqualified-id before '?' token
    4 | ??
      | ^
a.cc:21:1: error: expected unqualified-id before '?' token
   21 | ??
      | ^
Language: C

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <queue>
#include <cmath>
#include <tr1/unordered_map>
#include <bits/stdc++.h>
using namespace std;
using namespace std::tr1;

#define N 1010
#define M 1000010
#define LL long long
#define ULL unsigned long long 
#define eps 1e-8
#define pii pair<LL, int>
#define pdd pair<double, double>
#define MP make_pair
#define pb push_back
#define inf 0x3f3f3f3f
#define fi first
#define se second
#define md (ll+rr>>1)
#define lson ll, md
#define rson md+1, rr
#define mod 1000000007


LL ans;
char s[N];

int get_op(char c) {
	if(c == '+') return 0;
	else if(c == '-') return 1;
	else return 2;
}

struct node {
	LL x, len;
	int op;
	node () {};
	node (LL x, LL len, int op) : x(x), len(len), op(op) {}
};
struct Gao {
	vector<node> a;
	bool insert(char *s) {
		int len = strlen(s);
		a.clear();
		int op = -1;
		LL x = 0, len = 0;
		bool f = 0;
		for(i = 0; i <= len; ++i) 
			if('0' <= s[i] && s[i] <= '9')
				x = (x * 10 + s[i] - '0') % mod, len++;
			else{
				if(i < len) op = get_op(s[i]), f = 1;
			   	a.push_back(node(x, len, op));
				x = 0, y = -1, len = 0;
			}
		return f;
	}
	void mini() {
		int sz = a.size();
		if(sz == 0) return;
		vector<pii> b;
		b.push_back(a[0]);
		for(int i = 1; i < sz-1; ++i) 
			if(a[i].op == -1) {
				a[i+1].x = (a[i].x * qpow(10, a[i+1].len) + a[i+1].x)%mod;
				a[i+1].len += a[i].len;
			}
			else if(a[i].op == 2 && a[i+1].second != -1) {
				a[i+1].x = (a[i+1].x * a[i].x) % mod;
				a[i+1].len 
			}
			else {
				b.push_back(a[i]);
			}
		if(sz > 1) b.push_back(a[sz-1]);
		a = b;

	}
	void merge(node ot) {
		for(int i = 0; i < ot.a.size(); ++i)
			a.push_back(ot.a[i]);
	}
};

int main() {
	int n;
	while(~scanf("%d", &n)) {
		node ret, cur;
		for(int i = 0; i < n; ++i) {
			int x;
			scanf("%d %s", &x, s);
			bool f = cur.insert();
			while(x) {
				if(x & 1) ret.merge(cur);
				cur.merge(cur);
				x >>= 1;
			}
		}
		ret.cal();
		printf("%lld\n", ans);
	}
}

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

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#define MAXN 1010
using namespace std;

bool text(long long x)
{
	int a,b=-1;
	while(x>0)
	{
		a=x%10;
		if(b>=0 && a!=b-1)
			return false;
		b=a;
		x/=10;
	}
	return true;
}

int a[MAXN];

int main()
{
	int n;
	long long ans=-1;
	scanf("%d",&n);
	for(int i=0;i!=n;++i)
		scanf("%d",&a[i]);
	for(int i=0;i!=n;++i)
		for(int j=i+1;j<n;++j)
		{
			if(text((long long)(a[i]*a[j])))
				ans=max(ans,(long long)(a[i]*a[j]));
		}
	printf("%lld\n",ans);
}

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

#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<bitset>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1005;
int a[maxn],n;

bool check(int x)
{
    int temp = x%10;
    x /= 10;
    while(x){
        if(temp-x%10 != 1) return false;
        temp = x%10,x /= 10;
    }
    return true;
}

int main()
{
    while(~scanf("%d",&n)){
        for(int i=0;i<n;++i){
            scanf("%d",a+i);
        }
        int ans = -1;
        for(int i=0;i<n;++i){
            for(int j=0;j<n;++j){
                if(i == j) continue;
                if(a[i]*a[j] > ans && check(a[i]*a[j])) ans = a[i]*a[j];
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}

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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;


char str[100];
bool legal(int x){
	sprintf(str, "%d", x);
	int L = strlen(str);
	char b = str[0];
	for(int i=1;i<L;i++) if(str[i]!=b+i) return false;
	return true;
}

int a[1010];

int main(){
	int n;
	scanf("%d", &n);
	for(int i=1;i<=n;i++){
		scanf("%d", a+i);
	}
	int ans = -1;
	for(int i=1;i<n;i++)
		for(int j=i+1;j<=n;j++){
			int t = a[i]*a[j];
			
			if(legal(t)) ans = max(ans , t);
		}
	printf("%d\n", ans);
}
				

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

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <cmath>
#include <map>
#include <vector>
#include <cctype>
#include <set>
#include "iostream"
using namespace std;
#define FOP freopen("input.txt","r",stdin)
#define Met(x,y) memset(x,y,sizeof x)
typedef long long ll;
const ll MAXN = 1100;
const ll INF = 0x3f3f3f3f3f;

ll a[MAXN];

bool judge(ll num)
{
    ll last=num%10;
    num/=10;
    bool ret=1;
    while(num)
    {
        if((num%10)!=last-1)
        {

            ret=0;
            break;
        }
        last=num%10;
        num/=10;
    }
    return ret;
}
int main(int argc, char const *argv[]) {
    //FOP;
    ll n;
    //printf("%d\n",judge(345));
    while(cin>>n)
    {
        for(ll i=0;i<n;++i) scanf("%lld",&a[i]);
        ll ans=-1;
        for(ll i=0;i<n;++i)
            for(ll j=i+1;j<n;++j)
            {
                if(judge(a[i]*a[j]))
                    ans=max(ans,a[i]*a[j]);
            }
        printf("%lld\n",ans);
    }
    return 0;
}

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

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
vector<long long>num;
long long n,a[10000];
int main(){
	for(int i=1;i<=9;i++){
		for(int j=i;j<=9;j++){
			string S="";
			for(int k=i;k<=j;k++)S+=(char)('0'+k);
			num.push_back(stoll(S));
		}
	}
	cin>>n;for(int i=0;i<n;i++)cin>>a[i];
	int maxn=-1;
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			long long B=a[i]*a[j];
			bool flag=false;
			for(int k=0;k<vec.size();k++){
				if(vec[k]==B)flag=true;
			}
			if(flag==true)maxn=max(maxn,B);
		}
	}
	cout<<maxn<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:39: error: 'vec' was not declared in this scope
   22 |                         for(int k=0;k<vec.size();k++){
      |                                       ^~~
a.cc:25:47: error: no matching function for call to 'max(int&, long long int&)'
   25 |                         if(flag==true)maxn=max(maxn,B);
      |                                            ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:25:47: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   25 |                         if(flag==true)maxn=max(maxn,B);
      |                                            ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:25:47: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   25 |                         if(flag==true)maxn=max(maxn,B);
      |                                            ~~~^~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
vector<long long>num;
long long n,a[10000];
int main(){
	for(int i=1;i<=9;i++){
		for(int j=i;j<=9;j++){
			string S="";
			for(int k=i;k<=j;k++)S+=(char)('0'+k);
			num.push_back(stoll(S));
		}
	}
	cin>>n;for(int i=0;i<n;i++)cin>>a[i];
	int maxn=-1;
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			long long B=a[i]*a[j];
			bool flag=false;
			for(int k=0;k<num.size();k++){
				if(num[k]==B)flag=true;
			}
			if(flag==true)maxn=max(maxn,B);
		}
	}
	cout<<maxn<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:47: error: no matching function for call to 'max(int&, long long int&)'
   25 |                         if(flag==true)maxn=max(maxn,B);
      |                                            ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:25:47: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   25 |                         if(flag==true)maxn=max(maxn,B);
      |                                            ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:25:47: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   25 |                         if(flag==true)maxn=max(maxn,B);
      |                                            ~~~^~~~~~~~
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
using namespace std;

int n;
int a[1005];
char s[1005];

bool judge(int x)
{
	itoa(x,s,10);
	//puts(s);
	int l=strlen(s);
	for(int i=1; i<l; i++)
	{
		if(s[i]!=s[i-1]+1)
			return false;
	}
	return true;
}

int main()
{
	//freopen("1.txt","r",stdin);
	scanf("%d",&n);
	//while(scanf("%d",&n)==1)
	//{
		for(int i=1; i<=n; i++)
			scanf("%d",&a[i]);
		int ans=-1;
		for(int i=1; i<=n; i++)
		{
			for(int j=i+1; j<=n; j++)
			{
				if(judge(a[i]*a[j]))
				{
					ans=max(ans,a[i]*a[j]);
				}
			}
		}
		printf("%d\n",ans);
	//}
}

Compiler output:
a.cc: In function 'bool judge(int)':
a.cc:13:9: error: 'itoa' was not declared in this scope
   13 |         itoa(x,s,10);
      |         ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define MP(x, y) make_pair((x), (y))

const int MAX_HW = 200 + 5;
const int INF = 0x3f3f3f3f;

const int dir[4][2] = {{-1,0},{1,0},{0,-1},{0,1}};

int H, W;
char s[MAX_HW][MAX_HW];

int sdd[MAX_HW][MAX_HW], pnd[MAX_HW][MAX_HW];

inline bool mvable(int x, int y){
	return !(x < 0 || x >= H || y < 0 || y >= W || s[x][y] == '#');
}

queue<pair<int,int> > pnque, sdque;
inline bool solve(){
	memset(pnd, 0x3f, sizeof pnd);
	memset(sdd, 0x3f, sizeof sdd);
	pair<int,int> hatch;
	for (int i = 0; i < H; ++i){
		for (int j = 0; j  < W; ++j){
			if (s[i][j] == '@'){
				pnque.push(MP(i, j));
				pnd[i][j] = 0;
			}
			else if (s[i][j] == '$'){
				sdque.push(MP(i, j));
				sdd[i][j] = 0;
			}
			else if (s[i][j] == '%'){
				hatch = MP(i, j);
			}
		}
	}
	// calc pnd
	while (!pnque.empty()){
		pair<int,int> p = pnque.front(); pnque.pop();
		int curd = pnd[p.first][p.second];
		for (int i = 0; i < 4; ++i){
			int nx = p.first + dir[i][0];
			int ny = p.second + dir[i][1];
			if (mvable(nx, ny) && pnd[nx][ny] == INF){
				pnd[nx][ny] = curd + 1;
				pnque.push(MP(nx, ny));
			}
		}
	}
	// calc sdd
	while (!sdque.empty()){
		pair<int,int> p = sdque.front(); sdque.pop();
		int curd = sdd[p.first][p.second];
		for (int i = 0; i < 4; ++i){
			int nx = p.first + dir[i][0];
			int ny = p.second + dir[i][1];
			if (mvable(nx, ny) && sdd[nx][ny] == INF){
				sdd[nx][ny] = curd + 1;
				sdque.push(MP(nx, ny));
			}
		}
	}
	return pnd[hatch.first][hatch.second] < sdd[hatch.first][hatch.second];
}

int main(){
	scanf("%d%d", &H, &W);
	for (int i = 0; i < H; ++i) scanf(" %s", s[i]);
	bool ans = solve();
	printf("%s\n", ans?"Yes":"No");
	return 0;
}

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

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int h, w;
    cin >> h >> w;
    using P = pair<int, int>;
    P a, b;
    vector<vector<int>> v(h+2, vector<int> (w+2, 0));
    queue<P> Q, QQ;
    vector<vector<int>> dist1(h+2, vector<int> (w+2, INF<int>));

    auto dist2 = dist1;

    for (int i = 0; i < h; ++i) {
        string s;
        cin >> s;
        for (int j = 0; j < w; ++j) {
            v[i+1][j+1] = (s[j] != '#');
            if(s[j] == '@') {
                a = {i + 1, j + 1};
                dist1[i+1][j+1] = 0;
            }
            else if(s[j] == '%') b = {i+1, j+1};
            else if(s[j] == '$') {
                Q.emplace(i+1, j+1);
                dist2[i+1][j+1] = 0;
            }
        }
    }
    array<int, 4> di{0, 0, -1, 1}, dj{1, -1, 0, 0};

    QQ.emplace(a);
    while(!QQ.empty()){
        int i, j;
        tie(i, j) = QQ.front(); QQ.pop();
        for (int k = 0; k < 4; ++k) {
            if(v[i+di[k]][j+dj[k]] && dist1[i+di[k]][j+dj[k]] > dist1[i][j]+1){
                dist1[i+di[k]][j+dj[k]] = dist1[i][j]+1;
                QQ.emplace(i+di[k], j+dj[k]);
            }
        }
    }
    while(!Q.empty()){
        int i, j;
        tie(i, j) = Q.front(); Q.pop();
        for (int k = 0; k < 4; ++k) {
            if(v[i+di[k]][j+dj[k]] && dist2[i+di[k]][j+dj[k]] > dist2[i][j]+1){
                dist2[i+di[k]][j+dj[k]] = dist2[i][j]+1;
                Q.emplace(i+di[k], j+dj[k]);
            }
        }
    }
    puts((dist2[b.first][b.second] > dist1[b.first][b.second]) ? "Yes" : "No");
    return 0;
}


Compiler output:
a.cc:14:13: error: 'uint32_t' does not name a type
   14 | using u32 = uint32_t;
      |             ^~~~~~~~
a.cc:11:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   10 | #include <cmath>
  +++ |+#include <cstdint>
   11 | 
a.cc: In function 'int main()':
a.cc:46:19: error: variable 'std::array<int, 4> di' has initializer but incomplete type
   46 |     array<int, 4> di{0, 0, -1, 1}, dj{1, -1, 0, 0};
      |                   ^~
a.cc:11:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
   10 | #include <cmath>
  +++ |+#include <array>
   11 | 
a.cc:46:36: error: variable 'std::array<int, 4> dj' has initializer but incomplete type
   46 |     array<int, 4> di{0, 0, -1, 1}, dj{1, -1, 0, 0};
      |                                    ^~
a.cc:46:36: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
Language: C++

#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define mk make_pair
using namespace std;
int dx[]={0,0,1,-1},dy[]={1,-1,0,0};
int main(){
  int h,w,x,y,sol=0,pri=0;
  cin>>h>>w;
  bool b[h][w];
  string s[h];
  r(i,h)cin>>s[i];
  r(i,h)r(j,w){if(s[i][j]=='%')x=j,y=i;
  r(i,h)r(j,w)b[i][j]=0;
  queue<pair<pair<int,int>,int > >Q;
  Q.push(mk(mk(y,x),0));
  while(!Q.empty()){
    pair<pair<int,int > ,int >a=Q.front();Q.pop();
    int xx=a.first.second,yy=a.first.first;
    b[yy][xx]=1;
    if(pri&&pri<a.second)break;
    if(s[yy][xx]=='$'){sol=a.second;}
    if(s[yy][xx]=='@'){pri=a.second;}
    if(sol)break;
    r(i,4){
      int x1=xx+dx[i],y1=yy+dy[i];
      if(x1<0||x1>=w||y1<0||y1>=h||b[y1][x1]||s[y1][x1]=='#')continue;
          Q.push(mk(mk(y1,x1),a.second+1));
    }
  }
  if(sol==0)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

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

#include <iostream>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <stack>
#include <cctype>
#include <queue>
#include <string>
#include <vector>
#include<functional>
#include <set>
#include <map>
#include <climits>
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
#define fi first
#define se second
#define ping(x,y) ((x-y)*(x-y))
#define mst(x,y) ir(x,y,sizeof(x))
#define mcp(x,y) memcpy(x,y,sizeof(y))
using namespace std;
#define gamma 0.5772156649015328606065120
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define N 100005
#define maxn 10005
typedef long long int LL;
char x[220][220];
int bu[220][220];
int pr[220][220];
int f[5][5]={{1,0},{-1,0},{0,-1},{0,1}};
queue<pair<int,int > >qe;
pair<int,int > pa;
int n,m;
int a,b,c,d;
void bfs(int i,int j)
{
int k;
        qe.push(pair<int,int>(i,j));
        while(!qe.empty())
        {
            pa=qe.front();
            i=pa.fi;
        j=pa.se;
        for(k=0;k<4;k++)
        {
            int i1=i+f[k][0];
            int j1=j+f[k][1];
            if(i1>=0&&i1<n&&j1>=0&&j1<m)
            {

                if(bu[i1][j1]>bu[i][j]+1)
                {
                    bu[i1][j1]=bu[i][j]+1;
                     if(x[i1][j1]=='.')
           qe. push(pair<int,int>(i1,j1));
                }
            }
        }
            qe.pop();
        }
}
int bfsp(int i,int j)
{
    int k;
    qe. push(pair<int,int>(i,j));
     while(!qe.empty())
        {
            i=qe.front().fi;
        j=qe.front().se;
        for(k=0;k<4;k++)
        {
            int i1=i+f[k][0];
            int j1=j+f[k][1];
            if(i1>=0&&i1<n&&j1>=0&&j1<m&&(x[i1][j1]=='.'||x[i1][j1]=='%'))
            {

                if((pr[i1][j1]>pr[i][j]+1)&&(bu[i1][j1]>min(pr[i][j]+1,pr[i1][j1])))
                {
                                         if(x[i1][j1]=='%')
                    return 1;
                    pr[i1][j1]=pr[i][j]+1;

           qe. push(pair<int,int>(i1,j1));
                }
            }
        }
            qe.pop();
        }
        return 0;
}
int main()
{
    int i,j;
    memset(bu,63,sizeof(bu));
    memset(pr,63,sizeof(pr));
    int lo=bu[0][0];
    scanf("%d %d",&n,&m);
getchar();
for(i=0;i<n;i++)
    gets(x[i]);
    int f=0;
    for(i=0;i<n;i++)
        for(j=0;j<m;j++)
        {
                if(x[i][j]=='$')
            {
                f=1;
                bu[i][j]=0;
                bfs(i,j);
            }
             else  if(x[i][j]=='%')
            {
                a=i,b=j;
            }
            else  if(x[i][j]=='@')
            {
                pr[i][j]=0;
              c=i,d=j;
            }
        }
       int s= bfsp(c,d);
        if(s==1||f==0)
        printf("Yes\n");
        else
                    printf("No\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:104:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
  104 |     gets(x[i]);
      |     ^~~~
      |     getw
Language: C++

#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
using namespace std;
struct atom{
	int w,t;
};
int operator < (atom k1,atom k2){
	return k1.w>k2.w||(k1.w==k2.w&&k1.t>k2.t);
}
set<atom>S;
map<string,int>M;
int n,m,len,t,w[110000],si;
string na[110000];
char ch[30];
set<atom>::iterator k;
void print0(string k,int pd=0){
	if (pd) return;
	for (int i=0;i<k.length();i++) putchar(k[i]);
	printf(" is not working now.\n");
}
void print1(string k,int pd=0){
	if (pd) return;
	for (int i=0;i<k.length();i++) putchar(k[i]);
	printf(" is working hard now.\n");
}
void insert(int k1,int pd=0){
//	cout<<"insert "<<k1<<endl;
	string s=""; int L=strlen(ch+1); si++;
	for (int i=1;i<=L;i++) s=s+ch[i];
	len++; na[len]=s; M[s]=len; atom k2=(atom){k1,len}; S.insert(k2);
	if (k2<(*k)){
		print1(s,pd);// cout<<si<<endl;
		if (si%5!=0){
			print0(na[(*k).t],pd); k--;
		}
	} else if (si%5==0){
		k++; //cout<<"fa "<<(*k).t<<endl;
		if ((*k).t==k2.t) print1(s,pd);
		else {
			print0(s,pd); print1(na[(*k).t],pd);
		}
	} else print0(s,pd); 
	w[len]=k1;
}
void del(){
	string s=""; int L=strlen(ch+1); si--;
	for (int i=1;i<=L;i++) s=s+ch[i];
	int where=M[s]; atom k2=(atom){w[where],where};
	if ((*k).t==k2.t){
		if (si%5==4) k--;
		else {
			k++; print1(na[(*k).t]);
		}
	} else if (k2<(*k)){
		if (si%5!=4){
			k++; print1(na[(*k).t]);
		}
	} else if (si%5==4){
		print0(na[(*k).t]); k--;
	}
	S.erase((atom){w[where],where});
}
int main(){
	scanf("%d",&n); S.insert((atom){1e9,1e9}); k=S.begin();
	for (;n;n--){
		t++;
		scanf("%s",ch+1); int k1; scanf("%d",&k1); insert(k1,1);
	//	cout<<(*k).t<<endl;
	}
	scanf("%d",&m);
	for (;m;m--){
		t++; scanf("%s",ch+1);
		if (ch[1]=='+'){
			scanf("%s",ch+1); int k1; scanf("%d",&k1); insert(k1);
		} else {
			scanf("%s",ch+1); del();
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:41: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing]
   69 |         scanf("%d",&n); S.insert((atom){1e9,1e9}); k=S.begin();
      |                                         ^~~