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

#include<cstdio>
#include<vector>
#include<queue>
#include<utility>
#include<climits>

using namespace std;

typedef long long ll;
typedef pair<long, pair<int, int> > P;

int main(){
    int n,d;
    while(scanf("%d%d", &n, &d) && n){
        vector<ll> missile[n];
        int m;
        ll min_ = LLONG_MAX, max_ = 0LL;
        bool ans = true;
        vector<ll> v(n);
        priority_queue<P> que;
        for(int i=0;i<n;i++){
            scanf("%d", &m);
            ll c[m], total = 0;
            for(int j=0;j<m;j++){
                scanf("%lld", &c[j]);
                total += c[j];
            }
            missile[i].resize(m+1);
            missile[i][0] = total;
            for(int j=0;j<m;j++) missile[i][j+1] = missile[i][j] - c[j];

            que.push(P(total, pair<int, int>(i, 0)));
            v[i] = total;
            min_ = min(total, min_);
            max_ = max(total, max_);
        }

        if(max_ - min_ > d){
            ans = false;
        }

        while(ans && !que.empty()){
            P t = que.top(); que.pop();
            int i = t.second.first;
            int j = t.second.second;
            if(missile[i][j+1]){
                que.push(P(missile[i][j+1], pair<int, int>(i, j+1)));
                v[i] = missile[i][j+1];
            }else{
                v[i] = 0LL;
                min_ = 0LL;
            }
        
            if(t.first == min_){
                min_ = *min_element(v.begin(), v.end());
            }
            if(t.first == max_){
                max_ = *max_element(v.begin(), v.end());
            }
            if(max_ - min_ > d){
                ans = false;
            }
            // for(int i=0;i<n;i++) printf("%3lld", v[i]);
            // printf("\n");
        }
        printf("%s\n", ans?"Yes":"No");
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:25: error: 'min_element' was not declared in this scope
   55 |                 min_ = *min_element(v.begin(), v.end());
      |                         ^~~~~~~~~~~
a.cc:58:25: error: 'max_element' was not declared in this scope
   58 |                 max_ = *max_element(v.begin(), v.end());
      |                         ^~~~~~~~~~~
Language: Java


public class Main {
 
        private void run() {
                Scanner sc = new Scanner(System.in);
                
                                
                for(;;) {
                        long n = sc.nextLong();
                        int k = sc.nextInt();
                        if(n+k==0)
                                break;
                        int sum = 0;
                        int d=1;
                        long num = 1;
                        long cnt = 1;
                        
                        long g2 = 0;
                        {
                            long n2 = n;
                            long dig = 10;
                        	
                            for(int i = 1; ;i++){
               //            	System.out.println(dig*i +" "+n2+ " " + i);
                            	if(n2 < dig*i){
                            		num = n2 / i ;
                            		g2 =  (n2)%i;
                            	
                            		break;
                            	}
                            	n2+=dig;
                            	dig *= 10;
                            }
                        }
                        long nums = num;
                        long gs = g2;

                        {
                            long n2 = n+k;
                            long dig = 10;
                        	
                            for(int i = 1; ;i++){
               //            	System.out.println(dig*i +" "+n2+ " " + i);
                            	if(n2 < dig*i){
                            		num = n2 / i ;
                            		g2 =  (n2)%i;
                            	
                            		break;
                            	}
                            	n2+=dig;
                            	dig *= 10;
                            }
                        }

                        System.out.print((nums+"").substring((int)gs));
                        for(int i = (int)nums+1 ; i < num; i++){
                        	System.out.print(i);
                        }
                        System.out.print((""+num).substring(0,(int)g2));
                       System.out.println();
                }
                sc.close();
        }
 
        public static void main(String args[]) {
                new Main().run();
        }
}

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

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

import sys
import math
while True:
    a,b = map(int,raw_input().split(' '))
    if (a == 0 and b == 0):
        sys.exit()
    res = ""
    for i in range(a,a+b):
        res += str(i);
    ans = ""
    for i in range(a,a+b):
        ans+=res[i-a]
    print ans
            

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:3:1: error: 'import' does not name a type
    3 | import sys
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:12:5: error: 'ans' does not name a type
   12 |     ans = ""
      |     ^~~
Language: C++

#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

int main() {
	int border[] = { 1, 10, 190, 2890, 38890, 488890, 5888890, 68888890, 788888890, 8888888890 };
	int n, k;
	while (cin >> n >> k, n){
		REP(i, 10){
			if (n < border[i]){
				int mod = n % i;
				int dif = (n - border[i - 1])/(i);
				string s = "";
				int count = 0;
				while (s.length() < 110){
					s += to_string((int)pow(10, i - 1) + dif + count);
					count++;
				}
				s = s.substr(mod, k);
				cout<< s<<endl;
				break;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:89: error: narrowing conversion of '8888888890' from 'long int' to 'int' [-Wnarrowing]
   47 |         int border[] = { 1, 10, 190, 2890, 38890, 488890, 5888890, 68888890, 788888890, 8888888890 };
      |                                                                                         ^~~~~~~~~~
Language: C++

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys

sys.setrecursionlimit(1000000)

def d_num(num):
    ret = 0
    s = str(num)
    d = len(s)
    if d == 1:
        return num
    for i in range(d - 1):
        ret += (i + 1) * 9 * 10 ** i
    return ret + d * (num - 10 ** (d - 1) + 1)

def search(num, l, r):
    if r - l <= 1:
        return l, num - d_num(l)
    mid = (l + r) / 2
    if d_num(mid) > num:
        r = mid
    else:
        l = mid
    return search(num, l, r)

while True:
    K, N = map(int, raw_input().split())
    if K == 0:
        break
    '''
    S = ''
    for i in range(10000):
        S += str(i)
    print S[K:K + N]
    '''
    p = search(K - 1, 0, 10 ** 18)

    S = ''
    for i in range(p[0] + 1, p[0] + 101):
        S += str(i)
    print S[p[1]:p[1] + N]



Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
a.cc:33:5: error: empty character constant
   33 |     '''
      |     ^~
a.cc:33:7: warning: missing terminating ' character
   33 |     '''
      |       ^
a.cc:33:7: error: missing terminating ' character
a.cc:34:9: error: empty character constant
   34 |     S = ''
      |         ^~
a.cc:38:5: error: empty character constant
   38 |     '''
      |     ^~
a.cc:38:7: warning: missing terminating ' character
   38 |     '''
      |       ^
a.cc:38:7: error: missing terminating ' character
a.cc:41:9: error: empty character constant
   41 |     S = ''
      |         ^~
a.cc:3:1: error: 'from' does not name a type
    3 | from collections import deque
      | ^~~~
Language: C++

#include<map>
#include<cstdio>
#include<vector>

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

using namespace std;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

struct Point{
	int x,y;
	bool operator<(const Point &p)const{ return make_pair(x,y)<make_pair(p.x,p.y); }
};

typedef pair<Point,Point> Futon;

int n,mark[40000];
vector<int> adj[40000];

// u Æ v ª¯¶ÓÆñÉ®·é©Ç¤©
bool issame(int u,int v){ return abs(u-v)==n; }

bool dfs(int u){
	bool ok=true;
	rep(i,adj[u].size()){
		int v=adj[u][i];
		if(mark[v]==-1){
			if(issame(u,v)) mark[v]=1-mark[u];
			else            mark[v]=mark[u];
			if(!dfs(v)){
				ok=false;
				break;
			}
		}
		else{
			if(!issame(u,v) && mark[u]!=mark[v]){
				ok=false;
				break;
			}
		}
	}

	mark[u]=-1;
	return ok;
}

int main(){
	for(;scanf("%d",&n),n;){
		Point futon[40000];
		map<Point,int> f;
		rep(j,n){
			int x,y;
			char dir; scanf("%d%d %c",&x,&y,&dir);

			futon[j]=(Point){x,y};
			if(dir=='x') futon[n+j]=(Point){x+1,y};
			if(dir=='y') futon[n+j]=(Point){x,y+1};

			f[futon[ j ]]=j;
			f[futon[n+j]]=n+j;
		}

		rep(u,2*n){
			adj[u].clear();
			rep(k,4){
				int x=futon[u].x+dx[k];
				int y=futon[u].y+dy[k];
				Point p={x,y};
				if(f.count(p)) adj[u].push_back(f[p]);
			}
		}

		bool ok=true;
		rep(u,2*n) mark[u]=-1;
		rep(u,2*n) if(mark[u]==-1) {
			mark[u]=0;
			if(!dfs(u)){ ok=false; break; }
		}

		puts(ok?"Yes":"No");
	}

	return 0;
}

Compiler output:
a.cc: In function 'bool issame(int, int)':
a.cc:22:34: error: 'abs' was not declared in this scope
   22 | bool issame(int u,int v){ return abs(u-v)==n; }
      |                                  ^~~
Language: C

// AOJ 2180: Water Tank
// 2017.11.03 bal4u@uu

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

#define EPS 1e-9
int n, l, s[86402], t[86402], u[86402];

int check(double *v, double a)
{
	int i, x;
	double e;

	for (e = *v, x = 0, i = 0; i < n; i++) {
		e = min(l, e + a*(s[i]-x));
		x = s[i];
		e = min(l, e + (t[i]-x)*(a-u[i]));
		if (e < 0) { *v = e; return 1; }
		x = t[i];
	}
	*v = min(l, e + a*(86400-x));
	return 0;
}

int calc(double a)
{
	int i;
	double v[3];
	for (v[0] = l, i = 0; i < 2; i++) {
		if (check(v+i, a)) return 0;
		v[i+1] = v[i];
	}
	return fabs(v[0]-v[1]) <= EPS;
}

int main()
{
	int i;
	double up, low, mid;

	while (scanf("%d%d", &n, &l) && n > 0) {
		for (i = 0; i < n; i++) scanf("%d%d%d", s+i, t+i, u+i);
		low = 0, up = 1e7;

		while (fabs(low - up) > EPS) {
			mid = (low + up)/2;
			if (calc(mid)) up = mid; else low = mid;
		}
		printf("%.8lf\n", up);
	}
}

Compiler output:
main.c: In function 'check':
main.c:17:21: error: implicit declaration of function 'min'; did you mean 'fmin'? [-Wimplicit-function-declaration]
   17 |                 e = min(l, e + a*(s[i]-x));
      |                     ^~~
      |                     fmin
Language: C

#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

template<class T> T lower_search(T lb, T ub, bool (*C)(T)) {
  REP(i,100) {
    T mid = (lb+ub)/2;
    if (C(mid)) ub = mid;
    else lb = mid;
  }
  return ub;
}

int N;
double L;
const int NUM = 100000;
int s[NUM], t[NUM], u[NUM];

bool C(double x) {
  int now = 0;
  double vol = L;
  REP(i,N) {
    vol = min(x*(s[i]-now)+vol, L);
    vol = min((x-u[i])*(t[i]-s[i])+vol, L);
    if (vol<0) return 0;
    now = t[i];
  }
  vol = min(x*(86400-t[N-1])+vol, L);
  double hoge = vol;
  now = 0;
  REP(i,N) {
    vol = min(x*(s[i]-now)+vol, L);
    vol = min((x-u[i])*(t[i]-s[i])+vol, L);
    if (vol<0) return 0;
    now = t[i];
  }
  vol = min(x*(86400-t[N-1])+vol, L);
  if(vol+EPS<hoge) return 0;
  return 1;
}

int main() {
  while(cin>>N>>L,N||L) {
    REP(i,N) cin>>s[i]>>t[i]>>u[i];
    double ans = lower_search<double>(0,INF,C);
    printf("%.10f\n", ans);
  }
}

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>
#define MAX 86400
#define inf 1e17
using namespace std;

int n;
int s[MAX];
double lim;

bool ok(double m){
  double c=0;
  for(int i=0;i<MAX;i++){
    c-=s[i];
    c+=m;
    c=min(c,lim)
    if(c<0)return false;
  }
  return true;
}

int main()
{
  while(1){
    cin>>n>>lim;
    if(n+lim==0)break;
    for(int i=0;i<MAX;i++)s[i]=0;
    for(int i=0;i<n;i++){
      int a,b,c;
      cin>>a>>b>>c;
      for(int j=a;j<b;j++)s[j]=c;
    }

    double l=0,r=inf,m;
    for(int i=0;i<100;i++){
      m=(r+l)/2.0;
      if(ok(m))r=m;
      else l=m;
    }
    printf("%.10f",l);
    cout<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool ok(double)':
a.cc:15:17: error: expected ';' before 'if'
   15 |     c=min(c,lim)
      |                 ^
      |                 ;
   16 |     if(c<0)return false;
      |     ~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

const ld day = 86400;

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	int n, l;
	while (cin >> n >> l, n)
	{
		vector<pair<pii, int>> v;
		vi use(day);
		REP(i, n)
		{
			int s, t, u; cin >> s >> t >> u;
			FOR(j, s, t) use[j] = u;
		}
		ld lb = 0, ub = 1000000;
		REP(bs, 200)
		{
			ld mid = (lb + ub) / 2.0;
			ld vol = l;
			REP(i, day)
			{
				vol -= use[i];
				vol += mid;
				if (vol > l) vol = l;
				if (vol < 0)
				{
					lb = mid;
					goto end;
				}
			}
			ld tmp = vol;
			REP(i, day)
			{
				vol -= use[i];
				vol += mid;
				if (vol > l) vol = l;
				if (vol < 0)
				{
					lb = mid;
					goto end;
				}
			}
			if (tmp > vol) lb = mid;
			else ub = mid;
		end:;
		}
		cout << lb << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:17: error: jump to label 'end'
   65 |                 end:;
      |                 ^~~
a.cc:48:46: note:   from here
   48 |                                         goto end;
      |                                              ^~~
a.cc:51:28: note:   crosses initialization of 'ld tmp'
   51 |                         ld tmp = vol;
      |                            ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
signed main(){
  Int n;
  double l;
  while(cin>>n>>l,n){
    vector<double> s(n),t(n),u(n);
    for(Int i=0;i<n;i++) cin>>s[i]>>t[i]>>u[i];
    auto check2=[&](double x,double y){
      y=min(y+x*s[0],l);
      for(Int i=0;i<n;i++){
	y+=(x-u[i])*(t[i]-s[i]);
	if(y<=0) return -1;
	y=min(y,l);
	if(i+1<n)
	  y=min(y+x*(s[i+1]-t[i]),l);
      }
      y=min(y+x*(86400-t[n-1]),l);
      return y;
    };
    auto check=[&](double x){
      if(check2(x,l)<0) return false;
      Int lb=0,ub=l;
      for(Int i=0;i<50;i++){
	double mid=(ub+lb)/2;
	if(check2(x,mid)<=0) lb=mid;
	else ub=mid;
      }
      return check2(x,ub)>ub;
    };
    double lb=0,ub=*max_element(u.begin(),u.end());
    for(Int i=0;i<50;i++){
      double mid=(ub+lb)/2;
      if(check(mid)) ub=mid;
      else lb=mid;
    }
    cout<<fixed<<setprecision(12)<<ub<<endl;
  }
  return 0;
}



Compiler output:
a.cc: In lambda function:
a.cc:20:14: error: inconsistent types 'int' and 'double' deduced for lambda return type
   20 |       return y;
      |              ^
Language: C++

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max()/2;
const int MOD = 1e9+7;

vector<double> cap(200000,0);

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    while(cin>>n,n){
        double l;cin>>l;
        double low=0,high=10000000;
        vector<double> v(200000,0);
        for(int i=0;i<n;i++){
            int st,gt;cin>>st>>gt;
            double u;cin>>u;
            for(int j=st+1;j<=gt;j++){
                v[j]=v[j+86400]=u;
            }
            
            for(k=0;k<50;k++){
                cap[0]=l;
                double mid=(low+high)/2;
                bool f=true;
                for(int i=1;i<=86400*2;i++){
                    cap[i]=min(l,cap[i-1]+(mid-v[i]));
                    if(cap[i]<0) f=false;
                }
                if(cap[86400]<=cap[86400*2] && f){
                    high=mid;
                }
                else{
                    low=mid;
                }
            }
        }
        cout<<fixed<<setprecision(10)<<low<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'k' was not declared in this scope
   29 |             for(k=0;k<50;k++){
      |                 ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
const double eps = 1e-7;
class Info{
public:
  int s,e,c,time;
  double consume;
  Info(){};
  Info(int ts,int te,int tc):s(ts),e(te),c(tc){
    consume=e-s;
    consume*=(double)c;
    time=e-s;
  };
};

double can_water(vector<Info >&in,double L,double p,double ini){
  double vol=ini;
  int lasttime=0;//last time that scheduled
  rep(i,in.size()){
    vol=min(L,vol+(double)(in[i].s-lasttime)*p);
    vol=vol+in[i].time*p-in[i].consume;
    if ( vol<=eps)return -1;
    vol=min(vol,L);
    lasttime=in[i].e;
  }

  vol=vol+(86400-lasttime)*p;
  vol=min(vol,L);
  return vol;
}

double solve(vector<Info > &in,double L){
  double mini=0,maxi=100000000,ret=0,mid;
  while(mini+eps<maxi){
    double mid = (mini+maxi)/2;
    double day1=can_water(in,L,mid,L);
    if ( day1<=0){mini=mid+eps;continue;}
    
    double day2 = can_water(in,L,mid,day1);
    //printf("%.6lf %.6lf %.6lf\n",mid,day1,day2);
    if (day2>0 && day2-day1>=0)maxi=mid-eps,ret=mid;
    else mini=mid+eps;
  }
  assert(ret>eps);
  return ret;
}

main(){
  int n,L;
  while(cin>>n>>L&&n){
    vector<Info> in;
    int s,t,c;
    rep(i,n){
      cin>>s>>t>>c;
      in.push_back(Info(s,t,c));
    }
    printf("%.8lf\n",solve(in,L));
  }
}

Compiler output:
a.cc: In function 'double solve(std::vector<Info>&, double)':
a.cc:48:3: error: 'assert' was not declared in this scope
   48 |   assert(ret>eps);
      |   ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    3 | #include<algorithm>
  +++ |+#include <cassert>
    4 | using namespace std;
a.cc: At global scope:
a.cc:52:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   52 | main(){
      | ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
const double eps = 1e-10;
class Info{
public:
  int s,e,c,time;
  double consume;
  Info(){};
  Info(int ts,int te,int tc):s(ts),e(te),c(tc){
    consume=e-s;
    consume*=(double)c;
    time=e-s;
  };
};

double can_water(vector<Info >&in,double L,double p,double ini){
  double vol=ini;
  int lasttime=0;//last time that scheduled
  rep(i,in.size()){
    vol=min(L,vol+(double)(in[i].s-lasttime)*p);
    vol=vol+in[i].time*p-in[i].consume;
    if ( vol<=eps)return -1;
    vol=min(vol,L);
    lasttime=in[i].e;
  }

  vol=vol+(86400-lasttime)*p;
  vol=min(vol,L);
  return vol;
}

double solve(vector<Info > &in,double L){
  double mini=0,maxi=100000000,ret=0,mid;
  while(mini+eps<maxi){
    double mid = (mini+maxi)/2;
    double day1=can_water(in,L,mid,L);
    if ( day1<=0){mini=mid+eps;continue;}
    
    double day2 = can_water(in,L,mid,day1);
    //printf("%.6lf %.6lf %.6lf\n",mid,day1,day2);
    if (day2>0 && day2-day1>=0)maxi=mid-eps,ret=mid;
    else mini=mid+eps;
  }

  return ret;
}

main(){
  int n,L;
  while(cin>>n>>L&&n){
    vector<Info> in;
    int s,t,c;
    rep(i,n){
      cin>>s>>t>>c;
      in.push_back(Info(s,t,c));
    }
    printf("%.8lf\n",solve(in,L));
  }
}


main(){
  int n,L;
  while(cin>>n>>L&&n){
    vector<Info> in;
    int s,t,c;
    rep(i,n){
      cin>>s>>t>>c;
      in.push_back(Info(s,t,c));
    }
    printf("%.8lf\n",solve(in,L));
  }
}

Compiler output:
a.cc:52:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   52 | main(){
      | ^~~~
a.cc:66:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   66 | main(){
      | ^~~~
a.cc:66:1: error: redefinition of 'int main()'
a.cc:52:1: note: 'int main()' previously defined here
   52 | main(){
      | ^~~~
Language: C++

(auto g : goals) {
			ans = max(ans, g.second);
		}
		cout << ans << endl;
	}
	
	return 0;
}

Compiler output:
a.cc:1:2: error: expected unqualified-id before 'auto'
    1 | (auto g : goals) {
      |  ^~~~
a.cc:1:2: error: expected ')' before 'auto'
    1 | (auto g : goals) {
      | ~^~~~
      |  )
a.cc:4:17: error: 'cout' does not name a type
    4 |                 cout << ans << endl;
      |                 ^~~~
a.cc:5:9: error: expected declaration before '}' token
    5 |         }
      |         ^
a.cc:7:9: error: expected unqualified-id before 'return'
    7 |         return 0;
      |         ^~~~~~
a.cc:8:1: error: expected declaration before '}' token
    8 | }
      | ^
Language: Java

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

import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;

/**
 * Eleven Lover
 */
public class Main {

	static String sub;

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = br.readLine()) != null && !line.isEmpty()) {

			if (line.equals("0")) break;
			line += "_";

			int count = 0;
			for (int i = 0; i < line.length() - 2; i++) {
				for (int j = i + 2; j < line.length(); j++) {
					if (line.charAt(0) == '0') continue;
					//
					long mod = 0;
					if (j - i > 18) {
						mod = mod(line.substring(i, j));
					} else {
						mod = parseLong(line.substring(i, j)) % 11;
					}
					if (mod == 0) {
						count++;
					}
				}
			}
			System.out.println(count);
		} //end while
	} //end main

	static long mod(String sub) {

		String mod = "0";
		for (int i = 0; i < sub.length(); i += 17) {
			P2182.sub = "";
			if (i + 17 <= sub.length()) {
				P2182.sub = mod + sub.substring(i, i + 17);
			} else {
				P2182.sub = mod + sub.substring(i);
			}
			mod = String.valueOf(parseLong(P2182.sub) % 11);
		}
		return parseLong(mod);
	}
}

Compiler output:
Main.java:48: error: cannot find symbol
			P2182.sub = "";
			^
  symbol:   variable P2182
  location: class Main
Main.java:50: error: cannot find symbol
				P2182.sub = mod + sub.substring(i, i + 17);
				^
  symbol:   variable P2182
  location: class Main
Main.java:52: error: cannot find symbol
				P2182.sub = mod + sub.substring(i);
				^
  symbol:   variable P2182
  location: class Main
Main.java:54: error: cannot find symbol
			mod = String.valueOf(parseLong(P2182.sub) % 11);
			                               ^
  symbol:   variable P2182
  location: class Main
4 errors
Language: C

#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int main() {
  string s;
  while(cin>>s,s!="0") {
    int dp[11] = {};
    int ans = 0;
    for (int i=s.size()-1; i>=0; --i) {
      int next[11] = {};
      dp[0]++;
      REP(j,11) {
        next[(j+(s[i]-'0')*(i%2?1:-1)+11)%11] += dp[j];
      }
      REP(j,11) dp[j]=next[j];
      // REP(j,11) cout << dp[j] << " "; cout << endl;
      if (s[i]!='0') ans += dp[0];
    }
    cout << ans << endl;
  }
}

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

#include <algorithm>
#include <iostream>
#include <string>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <stack>
#include <vector>

#define FOR(i,k,n) for(int (i) = (k); (i) < (n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define all(v) begin(v), end(v)
#define debug(x) cerr << #x << ": " << x << endl
#define debug2(x,y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<i_i, int> p_i;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
template<class T> using vv=vector<vector<T>>;
typedef deque<int> di;
typedef deque<deque<int>> ddi;


int main() {
    while(1) {
        char s[80000] = {};
        int l;
        scanf("%s",s);
        if(s[0] == '0') {
            break;
        }
        l = (int)strlen(s);
        int dp[80001][11] = {};
        int sum = 0;
        dp[0][(int)(s[0]-'0')] = 1;
        FOR(i,1,l) {
            int t = (int)(s[i]-'0');
            rep(j,11){
                if(t-j>=0) {
                    dp[i][t-j] = dp[i-1][j];
                } else {
                    dp[i][11-j+t] = dp[i-1][j];
                }
            }    
            if(t!= 0) {
                dp[i][t] += 1;
            }
            sum += dp[i][0];
        }
        cout << sum << endl;
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: 'strlen' was not declared in this scope
   43 |         l = (int)strlen(s);
      |                  ^~~~~~
a.cc:14:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <stack>
  +++ |+#include <cstring>
   14 | #include <vector>
Language: C++

#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;
long long int INF = 1e18;
/*
int main(){
	while(true){
		int n, d;
		cin >> n >> d;
		
		if(n == 0){
			break;
		}
		
		vector<long long int> v[110];
		long long int S[110] = {};
		
		for(int i = 0; i < n; i++){
			int m;
			cin >> m;
			v[i].push_back(INF);
			for(int j = 0; j < m; j++){
				int num;
				cin >> num;
				v[i].push_back(num);
				S[i] += num;
			}
		}
		
		while(true){
			vector<P> vs;
			for(int i = 0; i < n; i++){
				vs.push_back(make_pair(S[i], i));
			}
			sort(vs.begin(), vs.end());
			bool flag = true;
			for(int i = 0; i < n; i++){
				int index = n - 1;
				if(i == vs[n - 1].second){
					index--;
				}
				if(vs[index].first - d <= S[i] - v[i][v[i].size() - 1]){
					S[i] -= v[i][v[i].size() - 1];
					v[i].pop_back();
					flag = false;
				}
			}
			if(flag){
				break;
			}
		}
		
		int SS = 0;
		for(int i = 0; i < n; i++){
			SS += v[i].size();
		}
		
		if(SS == n){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}
	return 0;
}
*/
char S[80001]
int A, B[11];
 
int char_to_int(char c){
    return (int)c - (int)'0';
}
 
int main(){
    int N, i, j, ans;
    while(1){
        scanf("%s", S);
        for(N = 0; S[N] != '\0'; N++){}
        if(N == 1 && S[0] == '0'){
            return 0;
        }
        for(j = 0; j < 11; j++){
            B[j] = 0;
        }
        B[0] = 1;
        A = 0;
        ans = 0;
        for(i = N - 1; i >= 0; i--){
            if(i % 2 == 0){
                A = (A + char_to_int(S[i])) % 11;
            }
            else{
                A = (A - char_to_int(S[i]) + 11) % 11;
            }
            if(S[i] != '0'){
                ans += B[A];
            }
            B[A]++;
        }
        printf("%d\n", ans);
    }
}


Compiler output:
a.cc:81:1: error: expected initializer before 'int'
   81 | int A, B[11];
      | ^~~
a.cc: In function 'int main()':
a.cc:90:21: error: 'S' was not declared in this scope
   90 |         scanf("%s", S);
      |                     ^
a.cc:96:13: error: 'B' was not declared in this scope
   96 |             B[j] = 0;
      |             ^
a.cc:98:9: error: 'B' was not declared in this scope
   98 |         B[0] = 1;
      |         ^
a.cc:99:9: error: 'A' was not declared in this scope
   99 |         A = 0;
      |         ^
Language: C++

while True:
 S = raw_input()
 if S == '0':break
 m = [1] + [0 for i in range(10)]
 d = A = 0
 e = 1
 S = reversed(S)
 for c in S:
  d = (d + int(c) * e) % 11  
  if int(c) != 0:A += m[d]
  m[d] += 1
  e *= -1
 print A


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while True:
      | ^~~~~
Language: C++

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

using namespace std;

char buf[100000];
long long cnt[11],i,j,val,ans,s,pos;

int main() {
*
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
*/
	while(gets(buf))
	{
		if(buf[0]=='0'&&buf[1]==0)
			break;

		memset(cnt,0,sizeof(cnt)); cnt[0]++;
		for((pos=strlen(buf)-1),s=ans=0;pos>=0;pos--)
		{
			val=buf[pos]-'0';

			if(pos&1)
				s=(s+val)%11;
			else s=(s-val+11)%11;
			/*
			for(j=0;j<11;j++)
				cout<<j<<' '<<cnt[j]<<endl;
			cout<<endl;
			*/
			if(val!=0)
				ans+=cnt[s];
			cnt[s]++;
		}

		cout<<ans<<endl;

	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:2: error: expected primary-expression before '/' token
   14 | */
      |  ^
a.cc:15:9: error: expected primary-expression before 'while'
   15 |         while(gets(buf))
      |         ^~~~~
Language: C

#include<stdio.h>

int main(){
  int x,y,w,h,a,i,j,n,k,l,t;
  int catx[101],caty[101],nekokazu[101];

  for(t=0;t<101;t++){
    nekokazu[t]=0;
  }
  
  scanf("%d",&a);

  for(i=0;i<a;i++){
   
    scanf("%d %d %d %d",&x,&y,&w,&h);
    scanf("%d",&n);
    
    for(j=0;j<n;j++){
      scanf("%d %d",&catx[j],&caty[j]);
    }
    
    for(k=0;k<n;k++){
      if( catx[k]<= x+w  && caty[k]<=y+h){
	nekokazu[i]=nekokazu[i]+1;
        
      }
    }
  }

Compiler output:
main.c: In function 'main':
main.c:28:3: error: expected declaration or statement at end of input
   28 |   }
      |   ^
Language: C++

#include<iostream>
using namespace std;
int X,Y,W,H;
serch(int x,y){
	if(X<=x&&(X+W)>=x&&Y<=y&&(Y+H)>=y)return 1;
}	
int main(){
	int N,x,y,count;
	cin>>X>>Y>>W>>H>>N;
	for(int i;i=0;i++){
		cin>>x>>y;
		if(serch(x,y)=1)count++;
	}
	cout<<count<<"\n";
	return 0;
}

Compiler output:
a.cc:4:13: error: 'y' has not been declared
    4 | serch(int x,y){
      |             ^
a.cc:4:1: error: ISO C++ forbids declaration of 'serch' with no type [-fpermissive]
    4 | serch(int x,y){
      | ^~~~~
a.cc: In function 'int serch(int, int)':
a.cc:5:31: error: 'y' was not declared in this scope
    5 |         if(X<=x&&(X+W)>=x&&Y<=y&&(Y+H)>=y)return 1;
      |                               ^
a.cc: In function 'int main()':
a.cc:12:25: error: lvalue required as left operand of assignment
   12 |                 if(serch(x,y)=1)count++;
      |                    ~~~~~^~~~~
a.cc: In function 'int serch(int, int)':
a.cc:6:1: warning: control reaches end of non-void function [-Wreturn-type]
    6 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int X,Y,W,H;
int serch(int x,int y){
	if(X<=x&&(X+W)>=x&&Y<=y&&(Y+H)>=y)return 1;
}	
int main(){
	int n;
	cin>>n;
	for(int j=0;j<n;j++){
	int N,x,y,count=0;
	cin>>X>>Y>>W>>H>>N;
	for(int i=;i<N;i++){
		cin>>x>>y;
		if(serch(x,y)==1)count++;
	}
	cout<<count<<"\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected primary-expression before ';' token
   13 |         for(int i=;i<N;i++){
      |                   ^
a.cc: In function 'int serch(int, int)':
a.cc:6:1: warning: control reaches end of non-void function [-Wreturn-type]
    6 | }
      | ^
Language: Java

import java.util.*;
public class main {
	private static Scanner sc;
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int a = sc.nextInt();
		for (int l=0; l<a; l++){
			int gx=sc.nextInt();
			int gy=sc.nextInt();
			int No [][] = new int [gx+1][gy+1];
			int b = sc.nextInt();
			for (int k=0; k<b; k++){
				int x1=sc.nextInt();
				int y1=sc.nextInt();
				int x2=sc.nextInt();
				int y2=sc.nextInt();
				
				if (x1 == x2) {
					No [x1][(Math.max(y1, y2))]+=1;
				}
				else {No[(Math.max(x1,x2))][y1]+=2;}			
			}
			int Total[][] = new int [gx+1][gy+1];
			Total[0][0] = 1;
			for (int i=0; i<=gx; i++){
				for (int j=0; j<=gy; j++){
					if (No[i][j] == 0){
						if (i>0 & j>0){
							Total[i][j]=Total[i-1][j]+Total[i][j-1];
						}
						else if (i>0){
							Total[i][j]=Total[i-1][j];
						}
						else if (j>0){
							Total[i][j]=Total[i][j-1];
						}
						else;
					}
					else if(No[i][j] == 1){
						if (i>0){
							Total[i][j]=Total[i-1][j];
							}
						else Total[i][j]=0;
					}
					else if(No[i][j] == 2){
						if (j>0){
						Total[i][j]=Total[i][j-1];
						}
						else Total[i][j]=0;
					}
					else {
						Total[i][j]=0;
					}
				}
				
		
			}
			if (Total[gx][gy]==0){
				System.out.println("Miserable Hokusai!");
			}
			else {System.out.println(Total[gx][gy]);
			}
		}
	}
}

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

#include<iostream>

#if 0
08-182020の方のものを参照。

#endif


using namespace std;

int a[10000];
int s;
int n;
int p;
int gx,gy;
int T[15+10][15+10];
int Verz[15+10][15+10], Horiz[15+10][15+10];
/*
pair<int, int> pd;
int matatabix[10000],matatabiy[10000];
pair<int, int> matatabi1[10000], matatabi2[10000];
int Verz[10000][10000], Horiz[10000][10000];
*/

int main(){
  cin >> n;
  while(n!=0){
    n = n - 1;
    for(int i = 0; i < 15+10; ++i){
      for(int j = 0; j < 15+10; ++j){
        T[i][j] = (i == 0 && j == 0);
        Verz[i][j] = (j != 0);
        Horiz[i][j] = (i != 0);
      }
    }
    cin >> gx >> gy;//秘密の場所の座標
    cin >> p;
    int x1,x2,y1,y2;
    for(int i = 0; i < p; ++i){
      cin >> x1 >> y1 >> x2 >> y2;
      if(x1 == x2){
        Verz[max(x1, x2)][max(y1,y2)] = false;
      }
      if(y1 == y2){
        Horiz[max(x1, x2)][max(y1, y2)] = false;
      }
    }
    for (int x = 0; x <= gx; x++) {
      for (int y = 0; y <= gy; y++) {
        if (!(x == 0 && y == 0)) {
          T[x][y] = (Horiz[x][y] ? T[x-1][y] : 0) + (Verz[x][y] ? T[x][y-1] : 0);
        }
      }
    }
    cout << (T[gx][gy] ? to_string(T[gx][gy]) : "Miserable Hokusai!") << endl;
    /*
    cin >> pd.first >> pd.second;
    cin >> p;
    for(int i = 0; i < p; ++i){
      cin >> matatabi1[i].first >> matatabi1[i].second >> matatabi2[i].first >> matatabi2[i].second;
    }
    for(int i = 0; i < pd.first; ++i){
      for(int j = 0; j < pd.second; ++j){
        Verz[i][j] = true;
        Horiz[i][j] = true;
      }
    }
    for(int i = 0; i < pd.first; ++i){
      for(int j = 0; j < pd.second; ++j){
        if(matatabi1[j].second == matatabi2[j].second){
          Horiz[matatabi1[i].first ][max(matatabi1[j].second, matatabi2[j].second) ] = false;
        }
        if(matatabi1[i].first == matatabi2[i].first){
          Verz[max(matatabi1[i].first , matatabi2[i].first)][matatabi2[j].second] = false; 
        }
      }
    }
    for(int i = 0; i < pd.first; ++i){
      for(int j = 0; j < pd.second; ++j){
        T[0][0] = 1;
        if(i < 0 || j < 0){
          T[i][j] = 0;
        }
        else if(i ==0 && j == 0){
          T[i][j] = 1;
        }
        else if(Verz[i][j] == false && Horiz[i][j] == false){
          T[i][j] = 0;
        }
        else if(Verz[i][j] == false && Horiz[i][j] == true){
          T[i][j] = T[i - 1][j];
        }
        else if(Horiz[i][j] == false && Verz[i][j] ==true){
          T[i][j] = T[i][j - 1];
        }
        else{
          T[i][j] =T[i - 1][j] +T[i][j - 1];
        }
      }
    }
    if(T[pd.first][pd.second] != 0){
      cout << T[pd.first][pd.second] << endl;
    }
    else{
      cout << "Miserable Hokusai!" << endl;
      
    }
    */
  }
}


Compiler output:
a.cc:4:4: error: extended character 。 is not valid in an identifier
    4 | 08-182020の方のものを参照。
      |    ^
Language: C++

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int N;
  cin >> N;
  while (N>0) {
    int goalx, goaly;
    cin >> goalx >> goaly;
    int T[goaly+1][goalx+1];
    int n;
    cin >> n;
    while (n>0) {
      int x1,y1,x2,y2;
      cin >> x1 >> y1 >> x2 >> y2;
      if (x1==x2) T[max(y1,y2)+1][x1+1]="up";
      if (y1==y2) {
	if (T[y1][max(x1,x2)] == "up") {
	  T[y1][max(x1,x2)] = "upleft";
	}
	else {
	  T[y1][max(x1,x2)] = "left";
	}
	n--;
      }
    }
    T[0][0] = 1;
    for (int i=0; i<goaly+2; i++) {
      for (int j=0; j<goalx+2; j++) {
	if (T[i][j] == "upleft") {
	  T[i][j] = 0;
	}
	else if (T[i][j] == "up") {
	  T[i][j] = T[i][j-1];
	}
	else if (T[i][j] == "left") {
	  T[i][j] = T[i-1][j];
	}
	else {
	  T[i-1][j] + T[i][j-1];
	}
      }
    }
    if (T[goaly+1][goalx+1] == 0) {
      cout << "Miserable Hokusai!" << endl;
    }
    else {
      cout << T[goaly+1][goalx+1] << endl;
    }
    N--;
  }
}

int max(a,b) {
  if (a<b) {
    b;
  }
  else a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:41: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   16 |       if (x1==x2) T[max(y1,y2)+1][x1+1]="up";
      |                                         ^~~~
      |                                         |
      |                                         const char*
a.cc:18:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |         if (T[y1][max(x1,x2)] == "up") {
      |             ~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:19:31: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   19 |           T[y1][max(x1,x2)] = "upleft";
      |                               ^~~~~~~~
      |                               |
      |                               const char*
a.cc:22:31: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   22 |           T[y1][max(x1,x2)] = "left";
      |                               ^~~~~~
      |                               |
      |                               const char*
a.cc:30:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |         if (T[i][j] == "upleft") {
      |             ~~~~~~~~^~~~~~~~~~~
a.cc:33:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |         else if (T[i][j] == "up") {
      |                  ~~~~~~~~^~~~~~~
a.cc:36:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   36 |         else if (T[i][j] == "left") {
      |                  ~~~~~~~~^~~~~~~~~
a.cc: At global scope:
a.cc:54:9: error: 'a' was not declared in this scope
   54 | int max(a,b) {
      |         ^
a.cc:54:11: error: 'b' was not declared in this scope
   54 | int max(a,b) {
      |           ^
a.cc:54:12: error: expression list treated as compound expression in initializer [-fpermissive]
   54 | int max(a,b) {
      |            ^
Language: C++

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int N;
  cin >> N; //????????????????????°
  while (N>0) {
    int goalx, goaly; //?§?????????´????????§?¨?
    cin >> goalx >> goaly;
    int T[goaly+1][goalx+1]; //????????????????????°
    int n;
    cin >> n;
    while (n>0) { //?????????????????\???
      int x1,y1,x2,y2; 
      cin >> x1 >> y1 >> x2 >> y2;
      if (x1==x2) T[max(y1,y2)+1][x1+1]=-1; //??????????????????
      if (y1==y2) {
	if (T[y1][max(x1,x2)] == -1) {
	  T[y1][max(x1,x2)] = -2; //?????¨??????????????????
	}
	else {
	  T[y1][max(x1,x2)] = -3; //??????????????????
	}
	n--;
      }
    }
    T[0][0] = 1;
    for (int i=0; i<goaly+2; i++) { //???????¨???????
      for (int j=0; j<goalx+2; j++) {
	if (T[i][j] == -2) {
	  T[i][j] = 0;
	}
	else if (T[i][j] == -1) {
	  T[i][j] = T[i][j-1];
	}
	else if (T[i][j] == -3) {
	  T[i][j] = T[i-1][j];
	}
	else {
	  T[i-1][j] + T[i][j-1];
	}
      }
    }
    if (T[goaly+1][goalx+1] == 0) {
      cout << "Miserable Hokusai!" << endl;
    }
    else {
      cout << T[goaly+1][goalx+1] << endl;
    }
    N--;
  }
}

int max(a,b) {
  if (a<b) {
    b;
  }
  else a;
}

Compiler output:
a.cc:54:9: error: 'a' was not declared in this scope
   54 | int max(a,b) {
      |         ^
a.cc:54:11: error: 'b' was not declared in this scope
   54 | int max(a,b) {
      |           ^
a.cc:54:12: error: expression list treated as compound expression in initializer [-fpermissive]
   54 | int max(a,b) {
      |            ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int p,i,j,k,l,m,n,gx,gy,dp[17][17],map[17][17][17][17];
  int N;
 
  
  cin >> n;
  for( N = 0; N < n; N++){

    for(i = 0; i < 17; i++){
      for(j = 0; j < 17; j++){
	dp[i][j]=0;
	for(k = 0; k < 17; k++){
	  for(l = 0; l < 17; l++){
	    map[i][j][k][l]=0;
	  }
	}
      }
    }
    
    dp[1][1]=1;
    
    cin >> gx >> gy;
    gx++;
    gy++;

    cin >> p;
    for(m  = 0; m < p; m++){
      cin >> i >> j >> k >> l;
      map[i+1][j+1][k+1][l+1]=1;
      map[k+1][l+1][i+1][j+1]=1;
      
    }
    for(i = 1; i < gx+1; i++){
      for(j = 1; j < gy+1; j++){
	if(map[i][j][i-1][j]!=1){
	  dp[i][j]+=dp[i-1][j];
	  
	}
	if(map[i][j][i][j-1]!=1){
	  dp[i][j]+=dp[i][j-1];
	}
      }
    }
    if( dp[gx][gy]==0){
      cout<<"Miserable Hokusai!"<<endl;
    }else{
      cout << dp[gx][gy] << endl;
    }
  }

  

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

#include <iostream>


using namespace std;


struct obstacles {
  bool above; // true if obstacle above
  bool left; // true if obstacle to the left
  int value; // no. of ways to get to this box
};



int main() {

  int input;
  cin >> input;

  for (int j = 0; j < input; j++) {
    int goalx, goaly;
    cin >> goalx >> goaly;
    
    obstacles grid[goalx + 1][goaly + 1]; // create grid

    //initialize grid
    for (int xi = 0; xi <= goalx; xi++) { // xi increases to the right
      for (int yi = 0; yi <= goaly; yi ++) { // yi increase downwards
	if (yi == 0) { 
	  grid[xi][yi].above = true; // top boundary
	} else {
	  grid[xi][yi].above = false;
	}
	if (rowi == 0) {
	  grid[xi][yi].left =  true; // left boundary
	} else {
	  grid[xi][yi].left = false;
	}
	grid[xi][yi].value = 0;
      }
    }

    
    int n_matatabi; // number of matatabis
    
    cin >> n_matatabi;
    
     for (int m = 0; m < n_matatabi; m++) {
      int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;

      //initialize obstacles for matatabis
      if (x1 == x2) { // vertical link |
	if (y1 > y2) {
	  grid[x1][y1].above = true;
	} else {
	  grid[x1][y2].above = true;
	} 
      }
      if (y1 == y2) { //horizontal link -
	if (x1 > x2) {
	  grid[x1][y1].left = true;
	} else {
	  grid[x2][y1].left = true;
	}
      }
      }

  
    //dynamic programming
    for (int x = 0; x <= goalx; ++x) {
      for (int y = 0; y <= goaly; ++y) {
	if (x == 0 && y == 0) {
	  grid[0][0].value = 1;
	  continue;
	}
	int above = 0, left = 0;
	if (grid[x][y].above == false) {
	  above = grid[x][y-1].value;
	}
	if (grid[x][y].left == false) {
	  left = grid[x - 1][y].value;
	}
	grid[x][y].value = above + left;
      }
    }
    /*
    //function for printing
    for (int rowtest = 0; rowtest <= goalx; ++rowtest) {
      for (int coltest = 0; coltest <= goaly; ++coltest) {
	cout << grid[rowtest][coltest].value << " ";
      }
      cout << endl;
    }
    */
    
     
    if (grid[goalx][goaly].value == 0) { 
      cout << "Miserable Hokusai!" << endl; // if no path
    } else {
      cout << grid[goalx][goaly].value << endl;
    }
  }
}
  
 


  
  
  
 

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'rowi' was not declared in this scope
   34 |         if (rowi == 0) {
      |             ^~~~