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

#include <iostream>
#include <vector>
#include <utility>
#include <cmath>
#include <cstdio>
#define EPS (1e-10)
using namespace std;
typedef pair<int,int> pii;

struct P{
  double X, Y, Z;
};

namespace std{
  P operator- (const P& a, const P& b){
    P ret = {a.X-b.X, a.Y-b.Y,a.Z-b.Z};
    return ret;
  }
}

double norm_3d(P a){
  return a.X*a.X + a.Y*a.Y + a.Z*a.Z;
}

double dot(P a, P b){
  return a.X*b.X + a.Y*b.Y + a.Z*b.Z;
}

int n;

vector<double> solve(vector<P> &p, vector<P> &v, vector<double> &r, vector<double> &vr){
  vector<double> vanish;
  vector< pair<double, pii> > collision;
  for(int i = 0; i < n; ++i)
    vanish.push_back(r[i]/vr[i]);
  for(int i = 0; i < n; ++i){
    for(int j = 0; j < i; ++j){
      P d_p = p[i]-p[j], d_v = v[i]-v[j];
      double A = norm_3d(d_v) - (vr[i]+vr[j])*(vr[i]+vr[j]),
	B = dot(d_p,d_v) + (r[i]+r[j])*(vr[i]+vr[j]),
	C = norm_3d(d_p) - (r[i]+r[j])*(r[i]+r[j]),
	m  = min(vanish[i],vanish[j]);
      if(abs(A) > EPS && B*B - A*C > 0){
	double
	  t1 = (-B+sqrt(B*B - A*C))/A,
	  t2 = (-B-sqrt(B*B - A*C))/A;
	if(t1 > 0 && t1 < m) collision.push_back(make_pair(t1,pii(i,j)));
	if(t2 > 0 && t2 < m) collision.push_back(make_pair(t2,pii(i,j)));
      }else if(abs(A) < EPS){
	double t1 = -C/2.0/B;
	if(t1 > 0 && t1 < m) collision.push_back(make_pair(t1,pii(i,j)));
      }
    }
  }
  sort(collision.begin(), collision.end());
  int k = (int)collision.size();
  for(int i = 0; i < k; ++i){
    double t = collision[i].first;
    int p = collision[i].second.first, q = collision[i].second.second;
    if(t < vanish[p] && t < vanish[q]){
      vanish[p] = t;
      vanish[q] = t;
    }
  }
  return vanish;
}

int main(){
  while(cin >> n, n){
    vector<P> p, v;
    vector<double> r(n), vr(n);
    double px, py, pz, vx, vy, vz;
    for(int i = 0; i < n; ++i){
      cin >> px >> py >> pz >> vx >> vy >> vz >> r[i] >> vr[i];
      P pi = {px,py,pz}, vi = {vx,vy,vz};
      p.push_back(pi);
      v.push_back(vi);
    }
    vector<double> ans = solve(p,v,r,vr);
    for(int i = 0; i < n; ++i)
      printf("%.10f\n",ans[i]); 
  }
  return 0;
}

Compiler output:
a.cc: In function 'std::vector<double> solve(std::vector<P>&, std::vector<P>&, std::vector<double>&, std::vector<double>&)':
a.cc:55:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   55 |   sort(collision.begin(), collision.end());
      |   ^~~~
      |   sqrt
Language: C

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

int main(){
  while(1){
    int i, j;
    vector<int> judge;
    string S;
    cin >> S;

    if(S == "#") break;

    for(i = 0; i < (int)S.size(); i++){
      if(S[i] == 'o') judge.push_back(0);
      else if(S[i] == 'e') judge.push_back(1);
    }


    int a;
    int sz = judge.size();
    if(judge[sz - 1] == 0) a = 0;
    else a = 90;
    int n = 1;

    for(j = sz - 2; j >= 0; j--){
      if(judge[j] == 0) a = (a * 2) - 90;
      else a = (a * 2) + 90;
      n *= 2;
    }

    int g;
    g = __gcd(a, n);
    a /= g;
    n /= g;


    if(n == 1) cout << a << endl;
    else cout << a << '/' << n << endl;

  }

  return 0;

}


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

#include<stdio.h>
#include<string.h>
#include<math.h>
char S[105];
int res,n;
 
int dfs(int p,int q)
{
    if(S[p]==0)
    {
        n=q/2;
        return 0;
    }
    return dfs(p+(S[p]=='n'?5:4),q*2)+(S[p]=='n'?-1:1)*90*q;
}
 
int main()
{
    for(;gets(S),S[0]!='#';memset(S,0,sizeof(S))
    {
        if(!strcmp(S,"north"))puts("0");
        else
        {
            res=dfs(0,1);
            for(;n>1&&!(res%2);res/=2,n/=2);
            if(n>1)
                printf("%d/%d\n",res<0?360+res:res,n);
            else
                printf("%d\n",res);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: 'gets' was not declared in this scope; did you mean 'getw'?
   19 |     for(;gets(S),S[0]!='#';memset(S,0,sizeof(S))
      |          ^~~~
      |          getw
a.cc:19:49: error: expected ')' before '{' token
   19 |     for(;gets(S),S[0]!='#';memset(S,0,sizeof(S))
      |        ~                                        ^
      |                                                 )
   20 |     {
      |     ~
Language: C++

nclude<iostream>
using namespace std;

int main()
{
  string s;
  for(;cin>>s,s!="#";)
    {
      double sum=0;
      int cnt=1;
      for(int i=s.size()-1;i>=0;i--)
	{
	  if(cnt==1)
	    {
	      if(s[i]=='n')
		{
		  sum=0;
		  cnt++;
		}
	      else if(s[i]=='w')
		{
		  sum=90;
		  cnt++;
		}

	    }
	  else
	    {
	      if(s[i]=='n')
		{
		  sum-=90.0/cnt;
		  cnt*=2;
		}
	      else if(s[i]=='w')
		{
		  sum+=90.0/cnt;
		  cnt*=2;
		}
	    }
	}
      // cerr<<"origi:"<<sum<<endl;
      if(((int)sum)-sum==0)
	cout<<sum<<endl;
      else
	{
	  int x=2;
	  sum*=2;
	  while(((int)sum)-sum!=0)
	    {
	      x*=2;
	      sum*=2;
	    }
	  cout<<sum<<"/"<<x<<endl;
	}
    }
}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<iostream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:7:8: error: 'cin' was not declared in this scope
    7 |   for(;cin>>s,s!="#";)
      |        ^~~
a.cc:7:13: error: 's' was not declared in this scope
    7 |   for(;cin>>s,s!="#";)
      |             ^
a.cc:43:9: error: 'cout' was not declared in this scope
   43 |         cout<<sum<<endl;
      |         ^~~~
a.cc:43:20: error: 'endl' was not declared in this scope
   43 |         cout<<sum<<endl;
      |                    ^~~~
a.cc:53:11: error: 'cout' was not declared in this scope
   53 |           cout<<sum<<"/"<<x<<endl;
      |           ^~~~
a.cc:53:30: error: 'endl' was not declared in this scope
   53 |           cout<<sum<<"/"<<x<<endl;
      |                              ^~~~
Language: C++

#include<iostream>
#include<cmath>
#include<cstring>
#include<vector>
using namespace std;
int gcd(int x,int y){ 
  if(y==0){
    return x;
  }else{
   return gcd(y,x%y);
  }
}

bool next(string &s){
  if(s[0]=='h'){
    s=s.substr(5);
    return 1;
  }
  s=s.substr(4);
  return 0;
}

int main(){
  string n;
  while(cin>>n){
    int above=0;
    int under=1;
    if(n=="#")break;
    reverse(n.begin(), n.end());
    if(!next(n))above=90;
    while(!n.empty()){
      under=under<<1;
      if(!next(n)){
	above=2*above + 90;
      }else{
	above=2*above - 90;
      }
    }
    int g=gcd(above,under);
    cout << above/g;
    if(under/g!=1){
      cout << "/" << under/g << endl;
    }else{
      cout << endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'reverse' was not declared in this scope
   29 |     reverse(n.begin(), n.end());
      |     ^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<map>
using namespace std;
pair<int,int>tasu(pair<int,int>a,pair<int,int>b){
	int a1=a.first,a2=a.second,b1=b.first,b2=b.second;
	int ta2=a2,tb2=b2;
	a1*=tb2,a2*=tb2;
	b1*=ta2,b2*=ta2;
	int c1=a1+b1,c2=a2;
	for(int i=2;i<=10000;i++){
	if(i==0||i==1||i==-1)continue;
	if(c1%i==0&&c2%i==0){
		c1/=i,c2/=i;
		i=-2;
	}
	}
	pair<int,int>c=make_pair(c1,c2);
	return c;
}
int main(){
	string n;
	//pair<int,int>a1,a2;
	//a1=make_pair(2,5);
	//a2=make_pair(3,6);
//	pair<int,int> tmp=tasu(a1,a2);
	//cout<<tmp.first<<" "<<tmp.second<<endl;

	while(true){
	cin>>n;
	if(n=="#")break;
	bool f1;
	int cnt=0;
	pair<int,int>ans;
	if(n.substr(0,5)=="north")f1=1;
	else f1=0;//初めが北なら1,東なら0

	if(f1){
	ans=make_pair(45,1);
	for(int i=1;i<(int)n.size()-5;i++){
	if(n.substr(i,5)=="north"){cnt++;}
	}
	for(int i=1;i<=cnt;i++){
		pair<int,int>tmp=make_pair(-90,pow(2,i+1));
		ans=tasu(ans,tmp);
	}
	}
	else{
	ans=make_pair(45,1);
	int cnt=0;
	for(int i=1;i<n.size()-4;i++)if(n.substr(i,4)=="west")cnt++;
	for(int i=1;i<=cnt;i++){
	pair<int,int>tmp=make_pair(90,pow(2,i+1));
	ans=tasu(ans,tmp);
	}
	}
	if(n=="north")cout<<0<<endl;
	else if(n=="west")cout<<90<<endl;
	else cout<<ans.first<<"/"<<ans.second<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:48: error: 'pow' was not declared in this scope
   44 |                 pair<int,int>tmp=make_pair(-90,pow(2,i+1));
      |                                                ^~~
a.cc:53:39: error: 'pow' was not declared in this scope
   53 |         pair<int,int>tmp=make_pair(90,pow(2,i+1));
      |                                       ^~~
Language: C++

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

int main()
{
	string line;
	while (cin >> line)
	{
		if (line.compare("#") == 0)break;
		int index = line.size() - 1;
		vector<char> v;
		while (index >= 0)
		{
			if (line.at(index) == 'h')
			{
				index -= 5;
				v.push_back('h');
			}
			else if (line.at(index) == 't')
			{
				index -= 4;
				v.push_back('t');
			}
		}

			int angle = 0;
			int l = pow(2, v.size() - 1);
			if (v.at(0) == 't')
			{
				angle = 90 * l;
			}
			for (int i = 1; i < v.size(); i++)
			{
				if (v.at(i) == 'h')
				{
					angle -= 90 * l / pow(2, i);
				}
				else
				{
					angle += 90 * l / pow(2, i);
				}
			}

			while (l != 1 && angle % 2 == 0)
			{
				angle /= 2;
				l /= 2;
			}

			if (l > 1)
			{
				cout << angle << "/" << l << endl;
			}
			else
			{
				cout << angle << endl;
			}
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:33: error: 'pow' was not declared in this scope
   29 |                         int l = pow(2, v.size() - 1);
      |                                 ^~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<stdlib.h>
using namespace std;

int main()
{
	string line;
	while (cin >> line)
	{
		if (line.compare("#") == 0)break;
		int index = line.size() - 1;
		vector<char> v;
		while (index >= 0)
		{
			if (line.at(index) == 'h')
			{
				index -= 5;
				v.push_back('h');
			}
			else if (line.at(index) == 't')
			{
				index -= 4;
				v.push_back('t');
			}
		}

			int angle = 0;
			int l = pow(2, v.size() - 1);
			if (v.at(0) == 't')
			{
				angle = 90 * l;
			}
			for (int i = 1; i < v.size(); i++)
			{
				if (v.at(i) == 'h')
				{
					angle -= 90 * l / pow(2, i);
				}
				else
				{
					angle += 90 * l / pow(2, i);
				}
			}

			while (l != 1 && angle % 2 == 0)
			{
				angle /= 2;
				l /= 2;
			}

			if (l > 1)
			{
				cout << angle << "/" << l << endl;
			}
			else
			{
				cout << angle << endl;
			}
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:33: error: 'pow' was not declared in this scope
   30 |                         int l = pow(2, v.size() - 1);
      |                                 ^~~
Language: C++

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

int main() {
while(1) {
string a, str;
cin >> a;
if(a=="#")break;

for(int i=0;i<a.size();i++) 
if(a[i] == 'w' || a[i] == 'n' ) str += a[i];

int size = str.size();
int ans = 0;
for(int i=0;i<size;i++) {
if(str[i] == 'w')  ans += (1<<i)*90;
else ans -= (1<<i)*90
}
size--;
if(ans < 0 ) ans = (1<<size)*90-ans;

while(size != 0) 
if( ans. % 2 == 0 ) ans /= 2;
else break;

if(size == 0) cout << ans << endl;
else cout << ans << "/" << size << endl;

}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected ';' before '}' token
   19 | else ans -= (1<<i)*90
      |                      ^
      |                      ;
   20 | }
      | ~                     
a.cc:25:10: error: expected unqualified-id before '%' token
   25 | if( ans. % 2 == 0 ) ans /= 2;
      |          ^
Language: C++

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

int main() {
while(1) {
string a, str;
cin >> a;
if(a=="#")break;

for(int i=0;i<a.size();i++) 
if(a[i] == 'w' || a[i] == 'n' ) str += a[i];

int size = str.size();
int ans = 0;
for(int i=0;i<size;i++) {
if(str[i] == 'w')  ans += (1<<i)*90;
else ans -= (1<<i)*90;
}
size--;
if(ans < 0 ) ans = (1<<size)*90-ans;

while(size != 0) 
if( ans. % 2 == 0 ) ans /= 2;
else break;

if(size == 0) cout << ans << endl;
else cout << ans << "/" << size << endl;

}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:10: error: expected unqualified-id before '%' token
   25 | if( ans. % 2 == 0 ) ans /= 2;
      |          ^
Language: C++

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

int main() {
while(1) {
string a, str;
cin >> a;
if(a=="#")break;

for(int i=0;i<a.size();i++) 
if(a[i] == 'w' || a[i] == 'n' ) str += a[i];

int size = str.size();
int ans = 0;
for(int i=0;i<size;i++) {
if(str[i] == 'w')  ans += (1<<i)*90;
else ans -= (1<<i)*90
}
size--;
if(ans < 0 ) ans = (1<<size)*90-ans;

while(size != 0) 
if( ans% 2 == 0 ) ans /= 2;
else break;

if(size == 0) cout << ans << endl;
else cout << ans << "/" << size << endl;

}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected ';' before '}' token
   19 | else ans -= (1<<i)*90
      |                      ^
      |                      ;
   20 | }
      | ~
Language: C++

from fractions import *
while True:
	s=input()
	if s=='#':break
	angle=Fraction(45)
	cnt=n=w=0
	while cnt<len(s):
		if s[cnt]=='n':
			n+=1
			angle-=Fraction(90/2**n)
			cnt+=5
		else:
			w+=1
			angle+=Fraction(90/2**w)
			cnt+=4
	print(angle)

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

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

unordered_map<string, int>U;
int main() {
	U["west"] = 90;
	U["north"] = 0;
	string a;
	while (cin >> a, a != "#") {
		vector<string>V;
		for (int b = 0; b < a.length(); b++) {
			if (a[b] == 'w') {
				b += 3;
				V.push_back("west");
			}
			else {
				b += 4;
				V.push_back("north");
			}
		}
		reverse(V.begin(), V.end());
		double b = U[V[0]];
		for (int c = 1; c < V.size(); c++) {
			b = (U[V[c]] + b) / 2;
		}
		for (int c = 1;; c *= 2) {
			double d = c*b;
			if (d == (int)d) {
				cout << d << "/" << c << endl;
				break;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'reverse' was not declared in this scope
   24 |                 reverse(V.begin(), V.end());
      |                 ^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
#define int long long
using namespace std;

unordered_map<string, int>U;
signed main() {
	U["west"] = 90;
	U["north"] = 0;
	string a;
	while (cin >> a, a != "#") {
		vector<string>V;
		for (int b = 0; b < a.length(); b++) {
			if (a[b] == 'w') {
				b += 3;
				V.push_back("west");
			}
			else {
				b += 4;
				V.push_back("north");
			}
		}
		reverse(V.begin(), V.end());
		int b = U[V[0]];
		int c = 1;
		for (int d = 1; d < V.size(); d++) {
			int e = b + c*U[V[d]];
			if (e & 1) {
				b = e;
				c *= 2;
			}
			else {
				b = e / 2;
			}
		}
		cout << b;
		if (c != 1) { cout << "/"; cout << c; }
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'reverse' was not declared in this scope
   25 |                 reverse(V.begin(), V.end());
      |                 ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
 
int main(){
    string a;
    while(cin>>a,a!="#"){
	vector<bool>b;
	for(char c:a){
	    if(c=='n')b.push_back(0);
	    else if(c=='w')b.push_back(1);
	    }
	reverse(b.begin(),b.end());
	int x=b[0]*90,y=1;
	for(int c=1;c<b.size();c++){
              int z=x;
	      z+=b[c]*90*y;
	      if(z&1){
		  x=z;
		  y*=2;
		  }
	      else{
		  x=z/2;
		  }	  
	    
	    }
	    cout<<x;
	    if(y!=1)cout<<"/"<<y;
	    puts("");
	    }}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){string s;
	while(cin>>s&&s!="#"){
		int a=1,b=(s[0]=='w')?90:0,i;
		for(i=s.size()-1;i;i--){
			if(s[i]=='n')a*=2,b=2*b-90;
			if(s[i]=='w')a*=2,b=2*b+90;
		}while(!a%2&&!b%2))a/=2,b/=2;
		cout<<b;if(a-1&&b)cout<<"/"<<a;cout<<endl;
	}return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: expected primary-expression before ')' token
   10 |                 }while(!a%2&&!b%2))a/=2,b/=2;
      |                                   ^
Language: C++

def inv(bit,m)
    bs = bit.to_s(2)
    if bs.length < m
        bs = "0" * (m - bs.length) + bs
    end
    ret = ""
    bs.each_char do |c|
        ret << (c == "0" ? "1" : "0")
    end
    ret.to_i(2)
end
conv = ('0'..'9').to_a + ('A'..'Z').to_a
loop do
    n, m, q = gets.split.map(&:to_i)
    break if n == 0 && m == 0 && q == 0
    cor = Array.new(m,2**n-1)
    prev = 0
    q.times do
        input = gets.chomp.split
        s = input[0].to_i(2)
        b = prev ^ input[1].to_i(2)
        bs = b.to_s(2)
        if bs.length < m
            bs = "0" * (m - bs.length) + bs
        end
        inv = inv(s,m)
        bs.each_char.with_index do |bit,i|
            if bit == "1"
                cor[i] &= s
            else
                cor[i] &= inv
            end
        end
        prev = input[1].to_i(2)
    end
    ret = ""
    cor.each do |c|
        if c & (c-1) != 0
            ret << "?"
        else
            t = n - 1 - Math.log2(c).to_i
            ret << conv[t]
        end
    end
    puts ret
end

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def inv(bit,m)
      | ^~~
Language: C++

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

using namespace std;

int main()
{
	int n, m, q;
	while (cin >> n >> m >> q && n != 0 || m != 0 || q != 0)
	{
		vector<string> S, B;
		for (int i = 0; i < q; i++)
		{
			char chars[40];
			char charb[1100];
			cin >> chars >> charb;
			S.push_back(chars);
			B.push_back(charb);
		}

		int SL[1100];
		memset(SL, -1, sizeof SL);
		for (int i = 0; i < m; i++)//light
		{
			for (int j = 0; j < n; j++)//switch
			{
				bool status = false;
				bool flag = true;
				for (int k = 0; k < q; k++)//query
				{
					if (S[k][j] == '1')
					{
						status = !status;
					}

					if (status && B[k][i] == '1' || !status && B[k][i] == '0')continue;
					flag = false;
					break;
				}
				if (flag)
				{
					if (SL[i] == -1)SL[i] = j;
					else SL[i] = -2;
				}
			}
		}

		for (int i = 0; i < m; i++)
		{
			if (SL[i] < 0)
			{
				cout << "?";
			}
			else
			{
				if (SL[i] < 10)
				{
					cout << SL[i];
				}
				else
				{
					cout << (char)((SL[i] - 10) + 'A');
				}
			}
		}
		cout << endl;
	}
	return 0;
}

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

#include <string>
#include <iostream>
#define to36(x) (x < 10 ? (char)(x + 48) : (char)(x + 55))
#ifdef _MSC_VER
#define __builtin_popcount __popcnt
#endif
using namespace std;
int N, M, Q; long long a[1009], b[1009]; string s[1009], t;
int main() {
	while (cin >> N >> M >> Q, N) {
		fill(a, a + Q, 0);
		fill(b, b + M, (1LL << N) - 1);
		s[0] = string(M, '0');
		for (int i = 0; i < Q; i++) {
			cin >> t >> s[i + 1];
			for (int j = N - 1; j >= 0; j--) a[i] = a[i] * 2 + t[j] - 48;
		}
		for (int i = 0; i < Q; i++) {
			for (int j = 0; j < M; j++) b[j] &= (s[i][j] == s[i + 1][j]) ? ~a[i] : a[i];
		}
		for (int i = 0; i < M; i++) {
			if (__builtin_popcount(b[i]) == 1) cout << to36((int)(log2(b[i])));
			else cout << '?';
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:79: error: 'log2' was not declared in this scope
   22 |                         if (__builtin_popcount(b[i]) == 1) cout << to36((int)(log2(b[i])));
      |                                                                               ^~~~
a.cc:3:18: note: in definition of macro 'to36'
    3 | #define to36(x) (x < 10 ? (char)(x + 48) : (char)(x + 55))
      |                  ^
Language: C

#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=100010;
int n,W,vw[maxn],pf[maxn],vf[maxn],th[maxn];
double calc(double a)
{
    double cost=0;
    for(int i=1;i<=n;i++)
    {
        double F=th[i]-a*vw[i];
        if(F<=0) continue;
        F/=vf[i];
        cost+=F*pf[i];
    }
    return cost+a*W;
}
int main()
{
    while(scanf("%d",&n))
    {
        if(n==0)break;scanf("%d",&W);
        for(int i=1;i<=n;i++){
            scanf("%d%d%d%d",&vw[i],&pf[i],&vf[i],&th[i]);
        }
        double l=0,r=1e9,ml,mr;
        for(int i=1;i<=400;i++)
        {
            ml=(2*l+r)/3.0;
            mr=(l+2*r)/3.0;
            if(calc(ml)<calc(mr)){
                r=mr;
            }
            else
                l=ml;
        }
        printf("%.6f\n",calc(l));

    }

    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef double flt;
const int MAXN = 100000 + 10;
const flt eps = 1e-9;

int vw[MAXN], pf[MAXN], vf[MAXN], th[MAXN];
int N, pw;

flt calc(flt W) {
  flt cost = W * pw;
  for (int i = 0; i < N; ++ i) {
    flt need = th[i] - W * vw[i];
    if (need <= -eps) continue;
    flt f = need / vf[i];
    cost += f * pf[i];
  }
  return cost;
}

int main() {
  while (scanf("%d", &N) == 1 && N) {
    scanf("%d", &pw);
    for (int i = 0; i < N; ++ i) {
      scanf("%d%d%d%d", vw + i, pf + i, vf + i, th + i);
    }
    flt left = 0, right = INT_MAX;
    for (int _ = 0; _ < 200; ++ _) {
      flt m1 = (left + left + right) / 3.0;
      flt m2 = (left + right + right) / 3.0;
      flt c1 = calc(m1), c2 = calc(m2);
      if (c1 < c2) right = m2;
      else left = m1;
    }
    printf("%.10f\n", calc(left);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:33: error: expected ')' before ';' token
   37 |     printf("%.10f\n", calc(left);
      |           ~                     ^
      |                                 )
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

const int My_Inf = 2147483647;
const long long int My_LInf = 9223372036854775807;

struct plant {
	double fertrate;

	double lovewater;
	double vital;
};
double pw;
vector<plant>plants;

double getmon(const double water) {
	double ans = water*pw;
	for (auto p:plants) {
		double rest = p.vital - water*p.lovewater;
		if (rest < 0) {
			ans += 0;
		}
		else {
			ans += rest / p.fertrate;
		}
	}
	return ans;
}

int main() {
	while (1) {
		plants.clear();
		int N; cin >> N; if (!N)break;
		cin >> pw;
		for (int i = 0; i < N; ++i) {
			double vw, pf, vf, t; cin >> vw >> pf >> vf >> t;
			double fertrate = vf / pf;
			double water= vw;
			plants.push_back(plant{ fertrate,water,t });

		}
		double amin = 0;
		double amax = 100;
		while (amin < amax - 1e-5) {
			double amid1 = (amin * 2 + amax) / 3;
			double amid2 = (amin + amax * 2) / 3;

			double mon1 = getmon(amid1);
			double mon2 = getmon(amid2);
			if (mon1 < mon2) {
				amax = amid2;
			}
			else {
				amin = amid1;
			}
		}
		double ans = getmon(amin);
		cout <<setprecison(22)<<fixed<< ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:24: error: 'setprecison' was not declared in this scope
   60 |                 cout <<setprecison(22)<<fixed<< ans << endl;
      |                        ^~~~~~~~~~~
Language: C++

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

int main(){

    while(1){
        int n; cin >> n;
        if(!n) break;
        double pw; cin >> pw;
        vector<double> vw(n);
        vector<double> pf(n);
        vector<double> vf(n);
        vector<double> th(n);
        for(int i = 0; i < n; i++){
            cin >> vw[i] >> pf[i] >> vf[i] >> th[i];
        }

        double ans;
        double l = 0.0, r = 10000000000000.0;

        while(r - l >= 0.0000001){

            double p1 = (r + 2*l) / 3;
            double p2 = (2*r + l) / 3;

            //cout << l << " " << r << " " << p1 << " " << p2 << endl;            

            double cost1 = (double)(p1 * pw);
            double cost2 = (double)(p2 * pw);
            
            for(int i = 0; i < n; i++){
                double F1 = (double)((th[i] - p1 * vw[i]) / vf[i]);
                double F2 = (double)((th[i] - p2 * vw[i]) / vf[i]);
                F1 = max(F1, 0.0);
                F2 = max(F2, 0.0);
                
                
                cost1 += (double)(F1 * pf[i]);
                cost2 += (double)(F2 * pf[i]);                                                
            }


            if(cost1 < cost2) r = p2;
            else l = p1;

            ans = cost1;
        }

        printf("%.10f\n", ans);
    }

    return 0
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:13: error: expected ';' before '}' token
   52 |     return 0
      |             ^
      |             ;
   53 | }
      | ~
Language: C++

#include<iostream>
using namespace std;
typedef unsigned long long ll;
const int mod=1000000007;
int main(){
    int n,d,x;
    while(cin>>n>>d>>x,n){
        ll dp[2][2002];
        memset(dp,0,sizeof(dp));
        for(int i=0;i<x;i++){
            dp[0][i]=1;
        }
        for(int da=1;da<d;da++){
            for(int i=0;i<=n;i++){
                dp[da%2][i]=0;
            }
            for(int i=0;i<=n;i++){
                if(dp[(da-1)%2][i]!=0){
                    for(int j=0;j<x&&i+j<=n;j++){
                        dp[da%2][i+j]=(dp[da%2][i+j]+(dp[(da-1)%2][i]))%mod;
                    }
                }
            }
        }
        cout<<dp[(d-1)%2][n]<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'memset' was not declared in this scope
    9 |         memset(dp,0,sizeof(dp));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,d,x,dp[2001][2001];
const ll mod = 1e9+7;
  
ll mod_pow(ll x,ll n){
  ll res=1;
  while(n){
    if(n%2) res=res*x%mod;
    x=x*x%mod;
    n/=2;
  }
  return res;
}
 

ll factorial(int i){
  static vector<ll> k(1e6);
  if(!k[0]){k[0]=1;for(int i=1;i<k.size();i++)k[i]=i*k[i-1]%mod;}
  return k[i];
}

ll nCr(ll n,ll r){
  ll a = mod_pow( factorial(r) * factorial(n-r) % mod ,mod-2);
  return factorial(n) * a 
}


  
int main(){
  while(1){
    cin>>n>>d>>x;
    if(!n&&!d&&!x) break;
  
    memset(dp,0,sizeof(dp));  
    for(int i=0;i<x;i++) dp[0][i]=1;
  
    
    for(int i=1;i<=min(d,n);i++){
      ll sum=0;
      for(int j=i+1;j<=n;j++){
    if(j-x>=i)sum=(sum-dp[i-1][j-x]+mod)%mod;
    sum=(sum+dp[i-1][j-1])%mod; 
    dp[i][j]=sum;
      }
    }
      
    ll ans=0;
    for(int i=0;i<min(d,n);i++)
      if(dp[i][n]) ans=(ans+dp[i][n]*nCr(d,i+1)%mod)%mod;
    cout <<ans<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'll nCr(ll, ll)':
a.cc:26:26: error: expected ';' before '}' token
   26 |   return factorial(n) * a
      |                          ^
      |                          ;
   27 | }
      | ~
Language: Java

public class Main {

	private static int[] a;
	private static int[] entranceIndex;
	private static int[] exitIndex;
	private static int[] boukaIndex;
	
	
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		// ???????????±??°
		int w = sc.nextInt();

		a = new int[w];
		entranceIndex = new int[w];
		exitIndex = new int[w];
		boukaIndex = new int[w];

		int entranceNum = 0;
		int exitNum = 0;
		int boukaNum = 0;

		for(int i=0; i<w; i++) {

			a[i] = sc.nextInt();
			if(a[i] == 0) {
				exitIndex[exitNum] = i;
				exitNum++;
				continue;
			}

			if(a[i] > 0) {
				entranceIndex[entranceNum] = i;
				entranceNum++;
			}else {
				boukaIndex[boukaNum] = i;
				boukaNum++;
			}
		}

		sc.close();
		
		int temp = moveCostToRightExit(entranceIndex[1]);
		System.out.println(temp);
		temp = moveCostToLeftExit(entranceIndex[1]);
		System.out.println(temp);		

	}
	
	
	public static int moveCostToRightExit(int ent) {
		
		for(int e : exitIndex) {
			
			if(e > ent) {
				return e - ent;
			}
		}
		
		return 0;
	}
	
	public static int moveCostToLeftExit(int ent) {
		
		for(int e : exitIndex) {
			
			if(e < ent) {
				return Math.abs(e - ent);
			}
		}
		
		return 0;
	}	
	
}

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

#include <stdio.h>

#define N_MAX   100000
#define W_MAX   100000
#define H_MAX   100000

int MIN(int a,int b){return a<b?a:b;}
int MAX(int a,int b){return a<b?b:a;}

int width[W_MAX+2]    = {};
int height[H_MAX+2]   = {};

int main(void){
    int N,W,H,x,y,w;
    int i,j;
    int M;
    
    scanf("%d %d %d",&N,&W,&H);
    for( i=0; i<N; i++){
        scanf("%d %d %d",&x,&y,&w);
        x[MAX(0,x-w)]++;
        x[MIN(H+1,x+w)]--;
        y[MAX(0,y-w)]++;
        y[MIN(W+1,y+w)]--;
    }
    
    M=N;
    for( i=0; i<W; i++){
        if( M > width[W+i] ){
            M = width[W+i];
        }
        width[i+1] += width[i];
    }
    
    if( M <= 0 ){
        M = N;
        for( i=0; i<H+1; i++){
            if( M > height[H+i] ){
                M = height[H+i];
            }
            height[i+1] += height[i];
        }
    }
    
    if( M <= 0 ){
        printf("No\n");
    }else{
        printf("Yes\n");
    }
}




Compiler output:
main.c: In function 'main':
main.c:21:10: error: subscripted value is neither array nor pointer nor vector
   21 |         x[MAX(0,x-w)]++;
      |          ^
main.c:22:10: error: subscripted value is neither array nor pointer nor vector
   22 |         x[MIN(H+1,x+w)]--;
      |          ^
main.c:23:10: error: subscripted value is neither array nor pointer nor vector
   23 |         y[MAX(0,y-w)]++;
      |          ^
main.c:24:10: error: subscripted value is neither array nor pointer nor vector
   24 |         y[MIN(W+1,y+w)]--;
      |          ^
Language: C++

#include<iostream>
using namespace std;

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

  int wifi_x[w + 1], wifi_y[h + 1];
  memset(wifi_x, 0, sizeof(wifi_x));
  memset(wifi_y, 0, sizeof(wifi_y));
  for (int i = 0; i < n; i++){
    int x, y, w;
    cin >> x >> y >> w;
    
    wifi_x[x - w] += 1;
    wifi_x[x + w] += -1;
    wifi_y[y - w] += 1;
    wifi_y[y + w] += -1;
  }
  int mx, my, tmp = 0;
  mx = my = 1e9;
  for (int i = 0; i < w; i++){
    tmp += wifi_x[i];
    mx = min(tmp, mx);
  }
  tmp = 0;
  for (int i = 0; i < w; i++){
    tmp += wifi_y[i];
    my = min(tmp, my);
  }
  if(mx > 0 || my > 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
    
  return 0;
}

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

#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 10;

int main() {
	int N, W, H;
	cin >> N >> W >> H;
	
	int x, y, w;
	vector<pii> xl, yl;
	REP(i, N) {
		cin >> x >> y >> w;
		xl.push_back(pii(x - w, x + w));
		yl.push_back(pii(y - w, y + w));
	}
	xl.push_back(pii(0, 0));
	xl.push_back(pii(W, W));
	yl.push_back(pii(0, 0));
	yl.push_back(pii(H, H));
	sort(ALL(xl));
	sort(ALL(yl));

	bool xok = true, yok = true;
	int xm = 0, ym = 0;
	REP(i, 0, N + 2) {
		if (xm < xl[i].first) {
			xok = false;
		}
		else {
			xm = max(xm, xl[i].second);
		}
		if (ym < yl[i].first) {
			yok = false;
		}
		else {
			ym = max(ym, yl[i].second);
		}
	}

	cout << (xok|yok ? "Yes" : "No") << endl;
	return 0;
}

Compiler output:
a.cc:56:24: error: macro "REP" passed 3 arguments, but takes just 2
   56 |         REP(i, 0, N + 2) {
      |                        ^
a.cc:31:9: note: macro "REP" defined here
   31 | #define REP(i,n) FOR(i,0,(n)-1)
      |         ^~~
a.cc: In function 'int main()':
a.cc:56:9: error: 'REP' was not declared in this scope
   56 |         REP(i, 0, N + 2) {
      |         ^~~
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;
typedef pair<int,int> P;
int tbl[100010];
bool chk(int w,vector<P> c){
  int n = c.size();
  memset(tbl,0,sizeof(tbl));
  for(int i=0;i<n;++i){
    tbl[c[i].first]++;
    tbl[c[i].second+1]--;
  }
  for(int i=0;i<=w;;+i) tbl[i+1]+=tbl[i];
  for(int i=1;i<=w;++i)
    if(tbl[i]<=0) return false;
  return true;
}

int main(){
  int n,w,h;
  scanf("%d%d%d",&n,&w,&h);
  vector<P> rng1,rng2;
  for(int i=0;i<n;++i){
    int x,y,d;
    scanf("%d%d%d",&x,&y,&d);
    rng1.push_back(P(max(1,x-d+1),min(w,x+d)));
    rng2.push_back(P(max(1,y-d+1),min(h,y+d)));
  }
  if(chk(w,rng1) || chk(h,rng2)) printf("Yes\n");
  else printf("No\n");
  return 0;
}

Compiler output:
a.cc: In function 'bool chk(int, std::vector<std::pair<int, int> >)':
a.cc:16:20: error: expected primary-expression before ';' token
   16 |   for(int i=0;i<=w;;+i) tbl[i+1]+=tbl[i];
      |                    ^
a.cc:16:20: error: expected ')' before ';' token
   16 |   for(int i=0;i<=w;;+i) tbl[i+1]+=tbl[i];
      |      ~             ^
      |                    )
a.cc:16:22: error: 'i' was not declared in this scope
   16 |   for(int i=0;i<=w;;+i) tbl[i+1]+=tbl[i];
      |                      ^
Language: C++

#include <stdio.h>

typedef struct {
    unsigned int a: 1;
} OneBit_t;
int main()
{
  int N,W,H;
  int i,j,k;
  int start,end;
  char t_error, y_error;
  OneBit_t tate[100000] ={0};
  OneBit_t yoko[100000] ={0};
  int x,y,w;
  scanf("%d %d %d",&N,&W,&H);
  for (i = 0;i < N;i++) {
    scanf("%d %d %d",&x,&y,&w);
   
    start = (x-w < 0) ? 0 : x-w;
    end = (x+w > W) ? W : x+w;
    for (j = start; j < end; j++) tate[j].a = 1;
   
    start = (y-w < 0) ? 0 : y-w;
    end = (y+w > H) ? H : y+w;
    for (j = start; j < end; j++) yoko[j].a = 1;        
  }
  t_error = 0;
  for (i = 0; i < W; i++) {
    if (tate[i].a == 0) {
      t_error = 1; break;
    }
  }
  y_error = 0;
  for (i = 0; i < H; i++) {
    if (yoko[i] ==.a 0) {
      y_error = 1; break;
    }
  }
  if (t_error && y_error) printf("No\n");
  else printf("Yes\n");
        
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: expected primary-expression before '.' token
   35 |     if (yoko[i] ==.a 0) {
      |                   ^
a.cc:35:21: error: expected ')' before numeric constant
   35 |     if (yoko[i] ==.a 0) {
      |        ~            ^~
      |                     )
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int N, W, H, x, y, w, ox[1 << 20], oy[1 << 20];

void main()
{
	std::cin >> N >> W >> H;

	for (int i = 0; i < N; i++)
	{
		std::cin >> x >> y >> w;

		for (int j = 0; j <= w; j++)
		{
			ox[max(x - j, 0)] = 1;
			ox[min(x + j, W - 1)] = 1;
			oy[max(y - j, 0)] = 1;
			oy[max(y + j, H - 1)] = 1;
		}
	}

	for (int i = 0; i < H; i++)
	{
		if (!oy[i]) 
		{
			printf("No\n"); return;
		}
	}

	for (int i = 0; i < W; i++)
	{
		if (!ox[i])
		{
			printf("No\n"); return;
		}
	}

	printf("Yes\n");
}

Compiler output:
a.cc:8:1: error: '::main' must return 'int'
    8 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:29:41: error: return-statement with no value, in function returning 'int' [-fpermissive]
   29 |                         printf("No\n"); return;
      |                                         ^~~~~~
a.cc:37:41: error: return-statement with no value, in function returning 'int' [-fpermissive]
   37 |                         printf("No\n"); return;
      |                                         ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <bitset>
#include <map>
#include <list>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <tuple>
#include <utility>

#include <cstdio>
#include <cstdint>

using namespace std;

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

	list<int> x_coords(w), y_coords(h);
	iota(x_coords.begin(), x_coords.end(), 0);
	iota(y_coords.begin(), y_coords.end(), 0);

	for(int i = 0; i < n; i++){
		int x, y, koto;
		scanf("%d %d %d", &x, &y, &koto);

		auto min = -koto+x, max = koto-1+x;
		auto first = lower_bound(x_coords.begin(), x_coords.end(), min);
		if(first != x_coords.end()){
			auto last = upper_bound(x_coords.begin(), x_coords.end(), max);
			x_coords.erase(first, last);
		}
		if(x_coords.empty())
			break;

		min = -koto+y, max = koto-1+y;
		first = lower_bound(y_coords.begin(), y_coords.end(), min);
		if(first != y_coords.end()){
			last = upper_bound(y_coords.begin(), y_coords.end(), max);
			y_coords.erase(first, last);
		}
		if(y_coords.empty())
			break;
	}

	cout << ( (x_coords.empty() || y_coords.empty()) ? "Yes" : "No" ) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'iota' was not declared in this scope
   24 |         iota(x_coords.begin(), x_coords.end(), 0);
      |         ^~~~
a.cc:43:25: error: 'last' was not declared in this scope
   43 |                         last = upper_bound(y_coords.begin(), y_coords.end(), max);
      |                         ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e8;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
int main(){
	int n,W,H;
	cin>>n>>W>>H;
	vi w(200100);
	vi h(200100);
	while(n--){
		int a,b,c;
		cin>>a>>b>>c;
		w[max(0,a-c)]++;
		w[a+c+1]--;
		h[max(0,b-c)]++;
		h[b+c+1]--;
	}
	bool out=true;
	int co=0;
	rep(i,W+1){
		co+=w[i];
		if(!co)out=false;
		if(!out)break;
	}
	if(h){
		cout<<"Yes"<<endl;
		return 0;
	}
	co=0;
	rep(i,H+1){
		co+=h[i];
		if(!co)out=false;
		if(!out)break;
	}
	cout<<(out?"Yes":"No")<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:12: error: could not convert 'h' from 'vi' {aka 'std::vector<int>'} to 'bool'
   43 |         if(h){
      |            ^
      |            |
      |            vi {aka std::vector<int>}
Language: C++

#include <cstdio>

#define MAX(X,Y) (((X)>(Y)) ? (X) : (Y))
#define MIN(X,Y) (((X)<(Y)) ? (X) : (Y))

int x[20000], y[20000];

int main(void) {
    int n,w,h;
    scanf("%d%d%d",&n,&w,&h);
    for(int i=0; i<n; i++) {
        int xi,yi,wi;
        scanf("%d%d%d",&xi,&yi,&wi);
        x[MAX(0,xi-wi)]++; x[MIN(xi+wi,w)+1]--;
        y[MAX(0,yi-wi)]++; y[MIN(yi+wi,h)+1]--;
    }
    bool flag = true;
    for(int i=0; i<=w; i++) {
        x[i+1]+=x[i];
        if(x[i]<=0) flag=false;
    }
    bool flag2
    for(int i=0; i<=h; i++) {
        y[i+1]+=y[i];
        if(y[i]<=0) flag2=false;
    }
    printf((flag || flag2) ? "Yes\n" : "No\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: expected initializer before 'for'
   23 |     for(int i=0; i<=h; i++) {
      |     ^~~
a.cc:23:18: error: 'i' was not declared in this scope
   23 |     for(int i=0; i<=h; i++) {
      |                  ^
a.cc:27:21: error: 'flag2' was not declared in this scope; did you mean 'flag'?
   27 |     printf((flag || flag2) ? "Yes\n" : "No\n");
      |                     ^~~~~
      |                     flag
Language: C++

#include <iostream>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
using namespace std;

int N, W, H, X, Y, K;
int vx[100010], vy[100010];

int main(void) {
  cin >> N >> W >> H;
  REP(i, 0, 100010) vx[i] = vy[i] = 0;
  REP(i, 0, N) {
    cin >> X >> Y >> K;
    vx[max(X - K, 0)]++;
    vx[min(X + K, W) + 1]--;
    vy[max(X - K, 0)]++;
    vy[min(X + K, H) + 1]--;
  }
  REP(i, 0, W) vx[i + 1] += vx[i];
  REP(i, 0, H) vy[i + 1] += vy[i];

  int mx = *min_element(vx, vx + W + 1);
  int my = *min_element(vy, vy + H + 1);

  cout << (mx > 0 || my > 0 ? "Yes" : "No") << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'min_element' was not declared in this scope
   21 |   int mx = *min_element(vx, vx + W + 1);
      |             ^~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#define Max 100000
using namespace std;
int main(void){
int n,w,h;
cin>>n>>w>>h;
vector<int> x(n),y(n),r(n);
vector<bool> xl(w+1,true),yl(h+1,true);
for(int i=0;i<n;i++){
	cin>>x[i]>>y[i]>>r[i];
	for(int j=x[i]-r[i];j<=x[i]+r[i];j++){
	if(j<=w&&j>=0)	xl[j]=false;
	}
		for(int j=y[i]-r[i];j<=y[i]+r[i];j++){
	if(j<=h&&j>=0)	yl[j]=false;
	}
}
bool ansx=true,ansy=true;
for(int i=0;i<w+1;i++){
	if(xl[i])ansx=false;
}
for(int i=0;i<h+1;i++){
	if(yl[i])ansy=false;
}
if(ansx||ansy){
	cout<<"Yes"<<endl;
}else{
	cout<<"No"<<endl;
}

return 0;
}}

Compiler output:
a.cc:33:2: error: expected declaration before '}' token
   33 | }}
      |  ^
Language: C++

#include<iostream>
#define inf 100000001
using namespace std;

int main()
{
  int w,a[100001],b[100001],c[100001];
  cin>>w;
  for(int i=0;i<w;i++)cin>>a[i];
  for(int i=0;i<w;i++){
    if(a[i]==0){
      b[i]=inf;
      c[i]=inf;
    }
    else {
      b[i]=0;
      c[i]=0;
    }
  }
  for(int i=0;i<w-1;i++){
    if(a[i+1]==0)continue;
    if(a[i+1]>0){
      b[i+1]=max(0,min(b[i]-1,a[i+1]));
    }else {
      b[i+1]=min(b[i],(-1)*a[i+1]);
    }
  }
  /*
  for(int i=0;i<w;i++){
    if(b[i]!=inf)cout<<b[i]<<" ";
    else cout<<'a'<<" ";
  }
  cout<<endl;*/
  for(int i=w-1;i>=1;i--){
    if(a[i-1]==0)continue;
    if(a[i-1]>0){
      c[i-1]=max(0,min(c[i]-1,a[i-1]));
    }else {
      c[i-1]=max(0,min(c[i]-1,(-1)*a[i-1]));
    }
  }
  for(int i=0;i<w;i++){
    if(c[i]!=inf)cout<<c[i]<<" ";
    else cout<<'a'<<" ";
  }/*
  cout<<endl;
  int ans=0;
  for(int i=0;i<w;i++){
    if(a[i]>0)ans+=max(b[i],c[i]);
    }*/
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   51 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: Java

import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	long MODULO = 1_000_000_000 + 7;

	void run() {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] t = new int[n];
		int[] p = new int[n];
		int[] x = new int[s];
		for (int i = 0; i < s; ++i) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < n; ++i) {
			t[i] = sc.nextInt();
			p[i] = sc.nextInt();
			--p[i];
		}
		int[] w = new int[n];
		for (int i = 0; i < n; ++i) {
			w[i] = t[i] - x[p[i]];
		}
		Arrays.sort(w);
		long ans = 0;
		for (long v : w) {
			ans -= v;
		}
		long[][] f = new long[n + 1][m + 1];
		for (int i = 0; i < f.length; ++i) {
			for (int j = 0; j < f[i].length; ++j) {
				f[i][j] = Integer.MAX_VALUE / 16;
			}
		}
		for (int i = 1; i < f.length; ++i) {
			f[i][1] = w[i - 1] * i;
		}

		for (int j = 2; j <= m; ++j) {
			// j??????????????????
			// h[i][k]:=f[k][j-1]+w[i-1]*(i-k)???Monge??§???????????¨?????¨????????????
			// min(h[i][])???n*log(n)??§?¨?????????????
			// f[i][j]=min(h[i][])
//			calc(f, w, j);
			for (int i = 1; i <= n; ++i) {
				for (int k = 1; k <= i - 1; ++k) {
					f[i][j] = Math.min(f[i][j], h(f, w, i, j, k));
				}
			}
		}

		long min = Integer.MAX_VALUE / 16;
		for (int j = 1; j <= m; ++j) {
			min = Math.min(min, f[n][j]);
		}
		ans += min;
		System.out.println(ans);
	}

	long[] calc(long[][] f, long[] w, int j) {
		int n = f.length;
		int m = f[0].length;
		long[] ret = new long[n];
		Arrays.fill(ret, Integer.MAX_VALUE / 16);

	}

	long h(long[][] f, int[] w, int i, int j, int k) {
		return f[k][j - 1] + w[i - 1] * (i - k);
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

Compiler output:
Main.java:73: error: missing return statement
	}
	^
1 error
Language: C++

#include <vector>
#include <iostream>

#define mod 1000000007

using namespace std;

long long gcd(long long, long long);
long long lcm(long long, long long);

class SegTree
{
private:

	int size;

	vector<long long> lcmvalue;

	long long _query(int a, int b, int k, int l, int r)
	{
		if (r <= a || b <= l) { return 1; }
		if (a <= l && r <= b) { return lcmvalue[k]; }

		long long vl = _query(a, b, 2 * k, l, (l + r) / 2);
		long long vr = _query(a, b, 2 * k + 1, (l + r) / 2, r);

		return lcm(vl, vr) % mod;
	}

public:

	SegTree(int size_)
	{
		for (size = 1; size < size_;) { size <<= 1; }

		lcmvalue = vector<long long>(size * 2, 1);
	}

	void update(int i, long long x)
	{
		i += size;

		lcmvalue[i] = x;

		while (i > 1)
		{
			i = i / 2;

			lcmvalue[i] = lcm(lcmvalue[2 * i], lcmvalue[2 * i + 1]) % mod;
		}
	}

	long long query(int s, int t)
	{
		return _query(s, t, 1, 0, size);
	}
};


long long gcd(long long a, long long b)
{
	if (a == 0) { return b; }
	if (b == 0) { return a; }

	if (a > b) { return gcd(b, a % b); }

	return gcd(a, b % a);
}

long long lcm(long long a, long long b)
{
	return (a / gcd(a, b) * b) % mod;
}

int extgcd(int a, int b, int &x, int &y)
{
	int d = a;

	if (b != 0)
	{
		d = extgcd(b, a % b, y, x);

		y -= (a / b) * x;
	}
	else
	{
		x = 1; y = 0;
	}

	return d;
}

int mod_inv(int a)
{
	int x, y;

	extgcd(a, mod, x, y);

	return (m + x % m) % m;
}

vector<int> G; // i --> G[i] Graph

vector<bool> visited;

vector<vector<int> > cycles;

void rec(int p)
{
	visited[p] = true;

	cycles.back().push_back(p);

	if (!visited[G[p]])
	{
		rec(G[p]);
	}
}

int main()
{
	int V, Q;

	scanf("%d", &V);
	scanf("%d", &Q);

	G = vector<int>(V);

	for (int i = 0; i < V; i++)
	{
		scanf("%d", &G[i]); G[i]--; // 1 -> 0 indexed
	}

	visited = vector<bool>(V, false);

	for (int i = 0; i < V; i++)
	{
		if (!visited[i])
		{
			cycles.push_back(vector<int>());

			rec(i);
		}
	}

	vector<long long> val(V, 0), num(V, 0);

	for (int i = 0; i < cycles.size(); i++)
	{
		long long sum = 0;

		for (int j = 0; j < cycles[i].size(); j++)
		{
			sum = (sum + cycles[i][j] + 1) % mod;
		}

		for (int j = 0; j < cycles[i].size(); j++)
		{
			val[cycles[i][j]] = sum;

			num[cycles[i][j]] = cycles[i].size();
		}
	}

	SegTree s(V);

	for (int i = 0; i < V; i++)
	{
		s.update(i, num[i]);
	}

	int l, r;

	for (int i = 0; i < Q; i++)
	{
		scanf("%d", &l); l--; // 1 -> 0 indexed
		scanf("%d", &r); r--;

		long long rep = s.query(l, r + 1);

		long long ret = 0;

		for (int j = l; j <= r; j++)
		{
			ret = (ret + (val[j] * rep) % mod * mod_inv(num[j])) % mod;
		}

		printf("%lld\n", ret);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int mod_inv(int)':
a.cc:99:17: error: 'm' was not declared in this scope
   99 |         return (m + x % m) % m;
      |                 ^