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

// AOJ1056 Ben Toh

#include <iostream>

using namespace std;

int main(){
	int n;
	double dp[100001];
	dp[0] = 0.0; dp[1] = 1.0; dp[2] = 1.5;
	for(int i=3;i<=100000;i++){
		dp[i] = 0.0;
		double cur = 1.0, mul = 0.5;
		for(int j=2;j<=min(i,20);j++){
			dp[i] += cur*(1-mul)*(j-1+dp[i-j]);
			cur *= mul;
			mul *= 0.5;
		}
		if(i<=20) dp[i] += cur*i;
	}
//	printf("double ans[100001] = {");
//	for(int i=0;i<100001;i++) printf("%.2lf, ", dp[i]);
//	printf("};");
	while(cin >> n, n){
		printf("%.2lf\n", ans[n]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:35: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |                 printf("%.2lf\n", ans[n]);
      |                                   ^~~
      |                                   abs
Language: C++

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

using namespace std;

const int MAX_N=100001;


int main(){
	// iツ嘉アツ姪堋づ泳ツ古つ連ツ堕アツつオツづ偲ヲツづェツづゥツ確ツ猟ヲツづーツ格ツ納
	vector<vector<double> > dp;
	vector<double> v(51,0.0);
	for(int i = 0; i < MAX_N; i++){
		dp.push_back(v);
	}

	//double dp[MAX_N][51];
	//for(int i = 0; i < MAX_N; i++)
	//	fill(dp[i],dp[i]+51,0.0);
	dp[1][1]=1.0;
	for(int i = 2; i < MAX_N; i++){
		// iツ嘉アツ姪堋づ泳ツ古つ連ツ堕アツつオツづ偲ヲツづェツづゥツ確ツ猟ヲツづーツ計ツ算
		for(int j = 0; j <= min(i,50); j++){
			// ツ債。ツ嘉アツミツス
			if(j==0){
				for(int k = 1; k <= min(i-1,50); k++){
					dp[i][j]+=dp[i-1][k]*(1-pow(0.5,k));
				}
			}
			// ツ連ツ堕アツ偲ヲツ督セ
			else{
				dp[i][j]=dp[i-1][j-1]*(pow(0.5,j-1));
			}
		}
	}

	int n;
	while(cin>>n&&n!=0){
		double sum=0;
		for(int j = 1; j <= n; j++){
			for(int i = 1; i <= j; i++){
				sum+=dp[j][i];
			}
		}
		cout<<sum<<endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:65: error: 'pow' was not declared in this scope
   28 |                                         dp[i][j]+=dp[i-1][k]*(1-pow(0.5,k));
      |                                                                 ^~~
a.cc:33:56: error: 'pow' was not declared in this scope
   33 |                                 dp[i][j]=dp[i-1][j-1]*(pow(0.5,j-1));
      |                                                        ^~~
Language: C++

#include <iostream>
#include <math.h>

#define TABLE 100

double psb( int n )
{
	return pow(0.5,n-1);
}


int main()
{
	int n;
	double sum;
	double dp[TABLE][TABLE];

	while(std::cin >> n, n)
	{
		sum = 0;
		for( int i = 0; i <= n+3; i++)
			memset( dp, 0, sizeof(dp));

		for( int j = 1; j <= n; j++)
			dp[1][j] = 1.0f;

		for( int i = 2; i <= n; i++)
			for( int j = i; j <= n; j++)
			{

				dp[i][j] = /*dp[i-1][j-1]*psb(j) +*/ dp[i][j-1];

				for( int k = 1; k < i; k++)
				{
					dp[i][j] += dp[k][j-1]*psb(j);
				}
			}

		for( int i = 1; i <= n; i++)
			sum += dp[i][n];


		printf("%lf\n",sum);

		for( int i = 0; i <= n; i++)
		{
			for( int j = 0; j <= n; j++)
			{
				std::cout << "  " << dp[j][i] << "  ";
			}
			std::cout << std::endl;
		}

	}

	return 0;
}

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

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

public class Main {

	static Scanner sc = new Scanner(System.in);
	static int N;
	static double[] exp = new double[100001];

	public static void main(String[] args) {
		precalc();
		while (true) {
			N = sc.nextInt();
			if (N == 0) break;
			System.out.println(solve());
		}
	}

	static double solve() {
		return exp[N];
	}

	static void precalc() {
		int pos = 0;
		double[][] prob = new double[2][101];
		double[][] v = new double[2][101];
		prob[pos][0] = 1;
		double[] success = new double[101];
		success[0] = 1;
		for (int i = 1; i < success.length; ++i) {
			success[i] = success[i - 1] / 2;
		}
		for (int i = 0; i <= 100000; ++i) {
			double sum = 0;
			Arrays.fill(prob[1 - pos], 0);
			Arrays.fill(v[1 - pos], 0);
			for (int j = 0; j < 100; ++j) {
				sum += v[pos][j];
				prob[1 - pos][j + 1] += prob[pos][j] * success[j];
				prob[1 - pos][0] += prob[pos][j] * (1 - success[j]);
				v[1 - pos][j + 1] += (v[pos][j] + prob[pos][j]) * success[j];
				v[1 - pos][0] += v[pos][j] * (1 - success[j]);
			}
			exp[i] = sum;
			pos = 1 - pos;
		}
	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Arrays;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#include <cstdio>
#include <algorithm>
using namespace std;
#define EPS (1e-13)
double dp[100001];
int main() {
	dp[1]=1;
	for(int n=2;n<=100000;n++) {
		double p=1,win=0.5;
		int k=1;
		while(EPS<p&&k<n) {
			double not=p*(1-win);
			dp[n]+=not*(k+dp[max(n-k-1,0)]);
			p*=win; win/=2; k++;
		}
		dp[n]+=n*p;
	}
	int n;
	while(scanf("%d",&n),n) {
		printf("%lf\n",dp[n]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:32: error: expected unqualified-id before 'not' token
   12 |                         double not=p*(1-win);
      |                                ^~~
a.cc:13:35: error: invalid type argument of unary '*' (have 'double')
   13 |                         dp[n]+=not*(k+dp[max(n-k-1,0)]);
      |                                   ^~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#define EPS (1e-13)
#define MAX(A,B)((A)>=(B)?(A):(B))
double dp[1000001];
int main() {
	int n;
	while(scanf("%d",&n),n) {
		for(int i=0;i<=1000000;i++) dp[i]=0;
		dp[1]=1;
		for(int i=2;i<=n;i++) {
			double p=1.0,win=0.5;
			for(int j=1;j<i && EPS<p;j++) {
				double not=p*(1-win);
				dp[i]+=not*(j+dp[MAX(0,n-1-j)]);
				p*=win; win/=2;
			}
			dp[i]+=p*i;
		}
		printf("%lf\n",dp[n]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:40: error: expected unqualified-id before 'not' token
   14 |                                 double not=p*(1-win);
      |                                        ^~~
a.cc:15:43: error: invalid type argument of unary '*' (have 'double')
   15 |                                 dp[i]+=not*(j+dp[MAX(0,n-1-j)]);
      |                                           ^~~~~~~~~~~~~~~~~~~~~
Language: C

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

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

struct Dice{
	int t,b,n,s,e,w;
	int y,x;
	
	int c;
	Dice(int top,int bottom,int north,int south,int east,int west,int sx,int sy,int cost){
		t=top,b=bottom,n=north,s=south,e=east,w=west;
		x=sx,y=sy,c=cost;
	}
	bool operator<(const Dice &r)const
	{
		return c>r.c;
	}
	void roll(int d)
	{
		int tmp;
		y+=dy[d],x+=dx[d];
		
		if(d==0)
		{
			tmp=t; t=s; s=b; b=n; n=tmp;
		}else if(d==1)
		{
			tmp=t; t=e; e=b; b=w; w=tmp;
		}else if(d==2)
		{
			tmp=t; t=n; n=b; b=s; s=tmp;
		}else
		{
			tmp=t; t=w; w=b; b=e; e=tmp;
		}
	}
};

int w,h;
bool in(int x,int y){
	if(x<0 || y<0 || x>=w || y>=h) return false;
	return true;
}

int main(){
	int p[10][10];
	while(cin>>h>>w && h!=0){
		priority_queue<Dice> que;
		for(int y=0;y<h;y++)
			for(int x=0;x<w;x++)
				cin>>p[y][x];

		int gx,gy,sx,sy;
		cin>>sy>>sx>>gy>>gx;
		que.push(Dice(1,6,5,2,3,4,sx,sy,0));
		while(!que.empty()){
			Dice now=que.top();
			que.pop();
//			cout<<now.x<<" "<<now.y<<" "<<now.b<<" "<<now.c<<endl;
			if(now.x==gx && now.y==gy) {cout<<now.c<<endl; break;}
			for(int r=0;r<4;r++){
				Dice copy=now;
				copy.roll(r);
				if(in(copy.x,copy.y)){
					copy.c+=copy.b*p[copy.y][copy.x];
					que.push(copy);
				}
			}
		}
	}
	return 0;
}

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

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

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

struct Dice{
	int t,b,n,s,e,w;
	int y,x;
	
	int c;
	Dice(int top,int bottom,int north,int south,int east,int west,int sx,int sy,int cost){
		t=top,b=bottom,n=north,s=south,e=east,w=west;
		x=sx,y=sy,c=cost;
	}
	bool operator<(const Dice &r)const
	{
		return c>r.c;
	}
	void roll(int d)
	{
		int tmp;
		y+=dy[d],x+=dx[d];
		
		if(d==0)
		{
			tmp=t; t=s; s=b; b=n; n=tmp;
		}else if(d==1)
		{
			tmp=t; t=e; e=b; b=w; w=tmp;
		}else if(d==2)
		{
			tmp=t; t=n; n=b; b=s; s=tmp;
		}else
		{
			tmp=t; t=w; w=b; b=e; e=tmp;
		}
	}
};

int w,h;
bool in(int x,int y){
	if(x<0 || y<0 || x>=w || y>=h) return false;
	return true;
}

int main(){
	int p[10][10],memo[10][10][100];
	while(cin>>h>>w && h!=0){
		priority_queue<Dice> que;
		for(int y=0;y<h;y++)
			for(int x=0;x<w;x++){
				cin>>p[y][x];
			}
		memset(memo,-1,sizeof(memo));

		int gx,gy,sx,sy;
		cin>>sy>>sx>>gy>>gx;
		que.push(Dice(1,6,5,2,3,4,sx,sy,0));
		while(!que.empty()){
			Dice now=que.top();
			que.pop();
//			cout<<now.x<<" "<<now.y<<" "<<now.b<<" "<<now.c<<endl;
			if(now.x==gx && now.y==gy) {cout<<now.c<<endl; break;}
			if(memo[now.y][now.x][now.e*7+now.b]>=0 && memo[now.y][now.x][now.e*7+now.b]<=now.c) continue;


			for(int r=0;r<4;r++){
				Dice copy=now;
				copy.roll(r);
				if(in(copy.x,copy.y)){
					copy.c+=copy.b*p[copy.y][copy.x];
					que.push(copy);
				}
			}
		}
	}
	return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

struct edge
{
  int to, cost;
};

typedef pair< int, int > Pi;
const int INF = 1LL << 30;

int N, M, P;
int v1[100], v2[100];
double dp1[100], dp2[100];
vector< vector< edge > > g;

void Dijkstra(int s, int *v, int *dp)
{
  priority_queue< Pi, vector< Pi >, greater< Pi > > que;
  fill_n(v, N, INF);
  fill_n(dp, N, 0);

  que.emplace(0, s);
  v[s] = 0;
  dp[s] = 1;

  while(!que.empty()) {
    auto p = que.top();
    que.pop();
    if(p.first > v[p.second]) continue;
    for(auto &e : g[p.second]) {
      if(p.first + e.cost < v[e.to]) {
        v[e.to] = p.first + e.cost;
        dp[e.to] = dp[p.second];
        que.emplace(v[e.to], e.to);
      } else if(p.first + e.cost == v[e.to]) {
        dp[e.to] += dp[p.second];
      }
    }
  }
}

int main()
{
  cout << fixed << setprecision(10);

  while(cin >> N >> M >> P, N) {
    g.resize(N);

    while(M--) {
      int X, Y, Z;
      cin >> X >> Y >> Z;
      g[X].emplace_back((edge) {Y, Z});
      g[Y].emplace_back((edge) {X, Z});
    }
    Dijkstra(0, v1, dp1);
    Dijkstra(N - 1, v2, dp2);

    while(P--) {
      int A;
      cin >> A;
      if(v1[A] + v2[A] == v1[N - 1])
        cout << (double) dp1[A] * dp2[A] / dp1[N - 1] << endl;
      else
        cout << 0 << endl;
    }
    cout << endl;

    g.clear();
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:21: error: cannot convert 'double*' to 'int*'
   57 |     Dijkstra(0, v1, dp1);
      |                     ^~~
      |                     |
      |                     double*
a.cc:18:35: note:   initializing argument 3 of 'void Dijkstra(int, int*, int*)'
   18 | void Dijkstra(int s, int *v, int *dp)
      |                              ~~~~~^~
a.cc:58:25: error: cannot convert 'double*' to 'int*'
   58 |     Dijkstra(N - 1, v2, dp2);
      |                         ^~~
      |                         |
      |                         double*
a.cc:18:35: note:   initializing argument 3 of 'void Dijkstra(int, int*, int*)'
   18 | void Dijkstra(int s, int *v, int *dp)
      |                              ~~~~~^~
Language: C++

// AOJ1058 Winter Bells

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

using namespace std;

typedef vector< vector<int> > graph;

void visit(graph &g, vector<int> &order, vector<bool> &mark, int pos){
	for(int i=0;i<g[pos].size();i++){
		int next = g[pos][i];
		if(mark[next]) continue;
		visit(g, order, mark, next);
	}
	mark[pos] = true;
	order.push_back(pos);
}

vector<int> topologicalSort(graph &g){
	vector<int> res;
	vector<bool> mark(g.size(), false);
	for(int i=0;i<g.size();i++){
		if(mark[i]) continue;
		visit(g, res, mark, i);
	}
	reverse(res.begin(), res.end());
	return res;
}

int main(){
	int n, m, r;
	int cost[100][100];
	while(cin >> n >> m >> r, n){
		vector< vector< pair<int, int> > > g(n);
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)
				cost[i][j] = i==j ? 0 : 100000000;
		for(int i=0;i<m;i++){
			int p, q, c; cin >> p >> q >> c;
			cost[p][q] = cost[q][p] = min(cost[p][q], c);
			g[p].push_back(make_pair(q,c));
			g[q].push_back(make_pair(p,c));
		}
		for(int k=0;k<n;k++)
			for(int i=0;i<n;i++)
				for(int j=0;j<n;j++)
					cost[i][j] = min(cost[i][j], cost[i][k]+cost[k][j]);
		graph h(n);
		for(int i=0;i<n;i++){
			if(cost[0][i]+cost[i][n-1]!=cost[0][n-1]) continue;
			for(int j=0;j<g[i].size();j++){
				if(cost[i][n-1]==cost[g[i][j].first][n-1]+g[i][j].second){
					h[i].push_back(g[i][j].first);
				}
			}
		}
		vector<int> ord = topologicalSort(h);
		vector<double> prob(n, 0.0);
		prob[0] = 1.0;
		for(int i=0;i<ord.size();i++){
			for(int j=0;j<h[ord[i]].size();j++)
				prob[h[ord[i]][j]] += (double)prob[ord[i]]/h[ord[i]].size();
		}
		for(int i=0;i<r;i++){
			int t; cin >> t;
			printf("%.8lf\n", prob[t]);
		}
		puts("");
	}
}

Compiler output:
a.cc: In function 'std::vector<int> topologicalSort(graph&)':
a.cc:28:9: error: 'reverse' was not declared in this scope
   28 |         reverse(res.begin(), res.end());
      |         ^~~~~~~
Language: Java

import java.io.*;
import java.util.*;
public class Myon
{
    public static void main(String args[]) throws Exception
    { new Myon();}
  
    static int MAX = 9999;
    
    Myon(){
    	Scanner cin = new Scanner(System.in);
    	int i,j,k,num;
    	while(true){
    		int n;
    		n = cin.nextInt();
    		if(n==0) break;
    		int input[] = new int[n];
    		for(i=0;i<n;i++){
    			input[i] = 0;
    			for(j=0;j<n;j++){
    				if(cin.nextInt()!=0) input[i] += 1<<j;
    			}
    		}
    		
    		num = n*(n+1)/2;
    		int range[] = new int[num];
    		int count = 0;
    		for(i=0;i<=n;i++){
    			for(j=i+1;j<=n;j++){
    				range[count++] = (1<<j)- (1<<i);
    			}
    		}
    		int memo[] = new int[1<<num];
    		int plus[] = new int[1<<num];
    		for(i=0;i<(1<<num);i++){
    			memo[i] = 0;
    			plus[i] = 0;
    			for(j=0;j<num;j++){
    				if(((1<<j)&i)!=0){
    					memo[i] ^= range[j];
    					plus[i]++;
    				}
    			}
    		}
    		//System.out.println("start!");
    		int dp[] = new int[1<<num];
    		for(j=0;j<(1<<num);j++) dp[j] = MAX;
    		dp[0] = 0;
    		for(i=0;i<n;i++){
    			int newdp[] = new int[1<<num];
    			for(j=0;j<(1<<num);j++) newdp[j] = MAX;
    			for(j=0;j<(1<<num);j++){
    				if(dp[j]==MAX) continue;
    				int need = memo[j] ^ input[i];
    				//System.out.println("test");
    				for(k=0;k<(1<<num);k++){
    					if(need != memo[k]) continue;
    					//System.out.println("test");
    					newdp[j ^ k] = Math.min(newdp[j ^ k], dp[j]+plus[k]);
    				}
    			}
    			dp = newdp.clone();
    		}
    		int res = MAX;
    		for(j=0;j<(1<<num);j++) res = Math.min(res, dp[j]+Integer.bitCount(j));
    		//System.out.println(res);
    		for(j=0;j<res/2;j++) System.out.print("myon");
    		System.out.println();
    	}
    }
}

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

#include <iostream>
#include <queue>

using namespace std;

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

int n;

struct State {
    int step, g;
    State(int step, int g)
        :step(step), g(g){}

    void flip(int x, int y, int w, int h){
        int t = (((1 << w) - 1) << x);
        rep(i, h){
            g ^= t << (n*(i + y));
        }
    }

    void print(){
        rep(i, n){
            rep(j, n){
                cout << ((g >> (i*n + j)) & 1);
            }
            cout << endl;
        }
    }
};

int main(){
    while (cin >> n && n){
        State init(0, 0);
        rep(i, n)rep(j, n){
            int x; cin >> x;
            if (x)init.flip(j, i, 1, 1);
        }
        queue<State> q;
        q.push(init);
        static bool vis[1 << 25];
        memset(vis, 0, sizeof(vis));
        vis[init.g] = true;
        int res = -1;
        while (q.size()){
            State s = q.front();
            q.pop();
            if (s.g == 0) {
                res = s.step;
                break;
            }
            vis[s.g] = true;
            rep(i, n){
                rep(j, n){
                    if ((s.g >> (i*n + j)) & 1){
                        rep(h, n - i){
                            rep(w, n - j){
                                s.flip(j, i, w + 1, h + 1);
                                s.step++;
                                if (!vis[s.g]) q.push(s);
                                s.flip(j, i, w + 1, h + 1);
                                s.step--;
                            }
                        }
                    }
                }
            }
        }
        rep(i, res)cout << "myon";
        cout << endl;
    }
}

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

#include <iostream>
#include <string>
#include <algorithm>
#include <memory.h>
#include <cstdio>
#include <cmath>
using namespace std;
#define MAX 999999999
int xorMemo[5][5][5][5][5];
short n, f[1<<25];         

inline short min(short a, short b){
	return a < b ? a : b;
}
inline short solve(int bit){
	if (bit == 0) return 0;
	if (f[bit] != -1) return f[bit];
	short li, lj;
	for (li=0;li<n;li++){
		for (lj=0;lj<n;lj++)
			if ((bit & (1<<(n*li+lj))) != 0) break;	
		if (lj != n) break;
	}
	int res = MAX;
	for (short hi=li;hi<n;hi++)
		for (short hj=lj;hj<n;hj++){
			int next = (bit ^ xorMemo[n-1][li][lj][hi][hj]);
			res = min(res, solve(next)+1);
		}
	return f[bit] = res;
}

short main(){
	memset(xorMemo,0,sizeof(xorMemo));
	memset(f,-1,sizeof(f));
	for (short m=1;m<6;m++)
		for (short li=0;li<m;li++)
			for (short lj=0;lj<m;lj++)
				for (short hi=li;hi<m;hi++)
					for (short hj=lj;hj<m;hj++)
						for (short i=li;i<hi+1;i++)
							for (short j=lj;j<hj+1;j++){
								xorMemo[m-1][li][lj][hi][hj] |= (1<<(i*m+j));
								//cout << xorMemo[m-1][li][lj][hi][hj] << " ";
							}
	
	while (scanf("%d",&n) && n != 0){
		int bit = 0;
		for (short i=0;i<n;i++)
			for (short j=0;j<n;j++){
				short x;
				scanf("%d",&x);
				if(x == 1) bit |= (1<<(i*n+j));
			}
		short ans = solve(bit);
		for (short i=1;i<=ans;i++) printf("myon");
		printf("\n");
	}
	return 0;
}

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

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

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

int n,g,bit,res;
int dis[1<<20];
vector<int> mask[5][5];

int rec(int g, int t){
  if(t == 5){
    if( (g & 31) )return 1000000;
    return dis[g>>5];
  }
  int res = rec(g,t+1);
  for(int i=0;i<mask[0][t].size();i++)res = min(res,rec(g^mask[0][t][i],t+1)+1);
  return res;
}
    
int main(){
  REP(i,0,5)REP(j,0,5)REP(k,i,5)REP(l,j,5){
    int tmp = 0;
    REP(y,i,k+1)REP(x,j,l+1)tmp |= 1<<(y*5+x);
    mask[i][j].push_back(tmp);
  }

  for(int i=0;i<(1<<20);i++)dis[i] = -1;
  dis[0] = 0;
  queue<int> q; q.push(0);
  while(q.size()){
    int p = q.front(); q.pop();
    REP(i,0,4)REP(j,0,5)REP(k,0,mask[i][j].size()){
      if(mask[i][j][k]>=1<<20)continue;
      int nxt = p^mask[i][j][k];
      if(dis[nxt]<0){
	dis[nxt] = dis[p] + 1;
	q.push(nxt);
      }
    }
  }

  while(cin >> n,n){
    g = 0;
    REP(i,0,5)REP(j,0,5)
      if(i<n && j<n){
	cin >> bit;
	g |= bit<<(i*5+j);
      }
    
    if(n<5)res = dis[g];
    else res = rec(g,0);
    
    for(int i=0;i<tmp;i++)cout << "myon";
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:19: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   56 |     for(int i=0;i<tmp;i++)cout << "myon";
      |                   ^~~
      |                   tm
Language: C

#include<stdio.h>
#define u_llint unsigned long long int

u_llint euclid(u_llint m,u_llint n);

int main(void){
  u_llint l,i,j,c;
  while(scanf("%llu",&l)&&l!=0){
    c=0;
    for(i=1;i<=l;i++){
      if(l%i!=0) continue;
      for(j=i;j<=l;j++){
        if(l%j!=0) continue;
        c+=(i*j==l*euclid(i,j)) ? 1:0;
    }
  printf("%llu\n",c);
  }
  return 0;
}

u_llint euclid(u_llint m,u_llint n){
  if(n==0) return m;
  return euclid(n,m%n);
}

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

#include<iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<vector>
using namespace std;
typedef long long ll;

vector<ll> getDiv(ll n){
  vector<ll> res;
  for(ll i=1;i*i<=n;i++)
    if(n%i == 0)
	{
	  res.push_back(i);
	  if(i*i != n)
	    res.push_back(n/i);
	}
  return res;
}

int main()
{
  long long n;
  while(cin >> n,n)
    {
      int cnt = 0;
      vector<ll> s = getDiv(n);
      for(int i= 0;i<s.size();i++)
	{
	  for(int j=i;j<s.size();j++)
	    {
	      ll a,b;
	      a = s[i];
	      b = s[j];
	      if(a/__gcd(a,b)*b == n)
		cnt++;
	    }
	}
      cout << cnt << 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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>

#define REP(i,n) for(i=0; i < (n); i++)
#define REPONE(i, n) for(i=1; i <= (n); i++)
#define LOOP(n) for(int loopCount=1; loopCount <= (n); loopCount++)
#define ITER(c) __typeof((c).begin())
#define EACH(c,it) for(ITER(c) it =(c).begin(); it!=(c).end(); it++)
#define SZ(c) ((int) (c).size())
#define ALL(c) c.begin(), c.end()
#define SUM(c) accumulate(ALL(c), 0)
#define EXIST(c,v) (find(ALL(c), (v)) != (c).end())
#define PB push_back
#define MP make_pair

using namespace std;
static const double EPS = 1e-9;
static const double PI = 3.141592653589793238462643383279;
typedef long long ll;

vector<int> primeTable(int n){
    vector<int> ps;
    vector<int> table(n+1, 0);
    for(int i=2; i<=n; i++){
        if(!table[i]){
            ps.push_back(i);
        if(i <= sqrt(n)) table[i*i] = i;
        }
        else{
        int j = i, step = table[i];
            while(j+step<=n){
                if(!table[j+step]) {
                    table[j+step] = step;
                    break;
                }
                else {
                    int tmp = step;
                    step = table[j+step];
                    table[j+tmp] = tmp;
                    j += tmp;
                }
            }
        }
    }
    return ps;
}

int main(){
    ll n;
    vector<int> ps=primeTable(1100000);
    int s = SZ(ps);
    while(cin>>n){
        if(n==0) break;
        vector<int> es;
        for(int i=0;n!=1 && i<s;i++){
            if(n%ps[i]==0){
                int cnt=1;
                n/=ps[i];
                while(n%ps[i]==0){
                    n /= ps[i];
                    cnt++;
                }
                es.PB(cnt);
            }
        }
        if(i==s-1 && n!=1) es.PB(1);
        ll ans=1;
        for(int i=0;i<SZ(es);i++){
            ans *= (2*es[i]+1);
        }
        cout << ans/2 + 1 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:84:12: error: 'i' was not declared in this scope
   84 |         if(i==s-1 && n!=1) es.PB(1);
      |            ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#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()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

template<int m>
class Prime{
  std::vector<bool> p;
  std::vector<int> ps;
public:
  Prime(){
    p = std::vector<bool>(m,true);
    assert(m>1);
    p[0]=p[1]=false;
    for(int i=4;i<m;i+=2)
      p[i]=false;
    ps.push_back(2);
    for(int i=3;i<m;i+=2){
      if(p[i]){
        ps.push_back(i);
        for(int j=i+i;j<m;j+=i)
          p[j]=false;
      }
    }
  }

  bool isPrime(int n){
    assert(m>n);
    return p[n];
  }

  int operator [] (int n){
    if(n<ps.size()) return ps[n];
    else return 0;
  }

  int size(){
    return ps.size();
  }
};

int main(){
  Prime<1000000+100> p;
  ll n;
  while(cin>>n, n){
    long long ans = 1;

    for(int i=0; p[i] <= n; i++){
      int cc = 0;
      while(n % p[i] == 0){
	cc++;
	n /= p[i];
      }
      if(cc != 0)
	ans *= (cc + 1) + (cc + 1) - 1;
    }

    if(n != 1)
      ans *= 3;

    cout << (ans - 1) / 2 + 1 << endl;
  }
  return 0;
}

Compiler output:
a.cc: In constructor 'Prime<m>::Prime()':
a.cc:33:5: error: there are no arguments to 'assert' that depend on a template parameter, so a declaration of 'assert' must be available [-fpermissive]
   33 |     assert(m>1);
      |     ^~~~~~
a.cc:33:5: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
a.cc: In member function 'bool Prime<m>::isPrime(int)':
a.cc:48:5: error: there are no arguments to 'assert' that depend on a template parameter, so a declaration of 'assert' must be available [-fpermissive]
   48 |     assert(m>n);
      |     ^~~~~~
a.cc: In instantiation of 'Prime<m>::Prime() [with int m = 1000100]':
a.cc:63:22:   required from here
   63 |   Prime<1000000+100> p;
      |                      ^
a.cc:33:11: error: 'assert' was not declared in this scope
   33 |     assert(m>1);
      |     ~~~~~~^~~~~
a.cc:12:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   11 | #include<sstream>
  +++ |+#include <cassert>
   12 |
Language: C++

#include <iostream>
#include <set>
#include <algorithm>
#include <map>
#include <cstdlib>
#include <cstdio>
#include <vector>

using namespace std;

typedef long long ll;

map<int,int> decomposition(ll L){
	map<int,int> cnt;
	for(ll i = 2; i*i <= L; i++){
		if(L%i==0){
			while(1){
				if(L%i==0){
					cnt[i]++;
					//cnt[L/i]++;
					L/=i;
				}
				else
					break;
			}
		}
	}
	if(L!=1)
		cnt[L]++;
	return cnt;
}

map<int,int> res;

pair<int,int> nums[10001];
pair<int,int> divNum[10001];
int cn;

int ct=0;

void dfs(map<int,int>::iterator cp){
	if(cp==res.end()){
		// ツ仰、ツ津環閉板閉ェツづーツ個按づ淞つスツづァツ、ツ残ツづィツづ個要ツ素ツづ個閉ェツ環づ個陛サツ法ツづ個堕債青板づーツ青板つヲツづゥ
		//vector<int> v;
		set<int> s;
		for(int i = 0; i < cn; i++){
			if(divNum[i].second-nums[i].second>0)
				s.insert(i);
		}
		int mul=(int)pow(2.0,(int)s.size());
		if(mul!=1)
			mul/=2;
		ct+=mul;
	}
	else{
		for(int i = 0; i <= cp->second; i++){
			nums[cn].first=cp->first;
			nums[cn].second=i;
			cn++;
			cp++;
			dfs(cp);
			cp--;
			cn--;
		}
	}
}

int main(){

	ll L;
	while(cin>>L&&L!=0){
		res.clear();
		res=decomposition(L);
		cn=0;
		for(map<int,int>::iterator it = res.begin(); it != res.end(); it++){
			divNum[cn].first=it->first;
			divNum[cn].second=it->second;
			cn++;
		}
		// ツ仰、ツ津環閉板閉ェツづ個個按津ィ
		cn=0;
		ct=0;
		dfs(res.begin());
		cout<<ct<<endl;
	}


	return 0;
}

Compiler output:
a.cc: In function 'void dfs(std::map<int, int>::iterator)':
a.cc:50:30: error: 'pow' was not declared in this scope
   50 |                 int mul=(int)pow(2.0,(int)s.size());
      |                              ^~~
Language: C++

#include<stdio.h>
#include<math.h>
#include<string.h>
#define N 500001
#define M 50000
//M=(N)/ln(N)
bool is[N];
int p[M];
int pnum;
int getprm(int n)
{
    int i,j,k=0;
    int s,e=(int)(sqrt(0.0+n)+1);
    memset(is,1,sizeof(is));
    p[k++]=2;is[0]=is[1]=0;
    for(i=4;i<n;i+=2) is[i]=0;
    for(i=3;i<e;i+=2) if(is[i])
    {
        p[k++]=i;
        for(s=i*2,j=i*i;j<n;j+=s)
            is[j]=0;
    }
    for(;i<n;i+=2) if(is[i])
        p[k++]=i;
    return k;
}
int pf[60],pfnum=0,lim[60];
void pfact(__int64 n){
    pfnum=0;
    for(int i=0;i<pnum&&p[i]*p[i]<=n;++i)
        if(n%p[i]==0){
            lim[pfnum]=0;
            while(n%p[i]==0)n/=p[i],++lim[pfnum];
            pf[pfnum++]=p[i];
        }
    if(n!=1) lim[pfnum]=1,pf[pfnum++]=n;
}
int main()
{
    __int64 sum1,sum2,n,res;
    int i,j;
    pnum=getprm(200001);
    while(scanf("%I64d",&n)&&n)
    {
        pfact(n);
        res=1;
        for(i=0;i<pfnum;i++)
            res*=(2*lim[i]+1);
        res++;
        printf("%I64d\n",res/2);
    }
}

Compiler output:
a.cc:28:6: error: variable or field 'pfact' declared void
   28 | void pfact(__int64 n){
      |      ^~~~~
a.cc:28:12: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   28 | void pfact(__int64 n){
      |            ^~~~~~~
      |            __ynf64
a.cc: In function 'int main()':
a.cc:40:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   40 |     __int64 sum1,sum2,n,res;
      |     ^~~~~~~
      |     __ynf64
a.cc:43:26: error: 'n' was not declared in this scope
   43 |     while(scanf("%I64d",&n)&&n)
      |                          ^
a.cc:45:9: error: 'pfact' was not declared in this scope
   45 |         pfact(n);
      |         ^~~~~
a.cc:46:9: error: 'res' was not declared in this scope
   46 |         res=1;
      |         ^~~
Language: C++


    
    printf("%d\n",ans);
  }
}

Compiler output:
a.cc:3:11: error: expected constructor, destructor, or type conversion before '(' token
    3 |     printf("%d\n",ans);
      |           ^
a.cc:4:3: error: expected declaration before '}' token
    4 |   }
      |   ^
a.cc:5:1: error: expected declaration before '}' token
    5 | }
      | ^
Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
using namespace std;
vector<long long int>p;
int a[1000001];
int main()
{
	int flag;int l;
	p.push_back(2);p.push_back(3);p.push_back(5);
	p.push_back(7);p.push_back(11);p.push_back(13);
	p.push_back(17);p.push_back(19);p.push_back(23);
	p.push_back(29);p.push_back(31);p.push_back(37);
	p.push_back(41);p.push_back(43);p.push_back(47);
	p.push_back(53);p.push_back(59);p.push_back(61);
	for(long long int i=7;i<1000;i+=2)
	{
		l=p.size();flag=1;
		for(int j=17;p[j]<=sqrt(i*1.0) && j<l;j++)
			if(i%p[j]==0){flag=0;break;}
		if(flag==1)p.push_back(i);
	}
	l=p.size();
	memset(a,1,sizeof(a));
	for(int i=1;i<l;i++)
		for(long long int j=p[i];j<1000000;j+=p[i])
			a[j]=0;
	for(int i=63;i<1000000;i+=2)
		if(a[i])p.push_back(a[i]);
	l=p.size();		
	for(long long int n;cin>>n && n;)
	{
		if(n==1){cout<<1<<endl;continue;}
		map<long long int,int>m;
		for(int i=0;i<l;i++)
			while(n%p[i]==0)
			{
				m[p[i]]++;
				n/=p[i];
			}
		int sum=1;
		map<long long int,int>::iterator it;
		for(it=m.begin();it!=m.end();it++)
			sum*=2*(it->second+1)-1;
		sum=(sum+1)/2;
		cout<<sum<<endl;
	}
}

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

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

int main()
{
	int n;
	while(scanf("%d",&n)&&n)
	{
		int hh,mm,MM,lunchsum=0,dinnersum=0,midnightsum=0,lunch=0,dinner=0,midnight=0;
		int i;
		for(i=1;i<=n;i++)
		{
			scanf("%d%*c%d%d",&hh, &mm, &MM);
			if(hh>=11&&hh<=14)
			{
				lunchsum++;
				if((MM>mm&&MM-mm<=8)||(MM<mm&&MM+60-mm<=8))
				{
					lunch++;
				}
			}
			else if(hh>=18&&hh<=20)
			{
				dinnersum++;
				if((MM>mm&&MM-mm<=8)||(MM<mm&&MM+60-mm<=8))
				{
					dinner++;
				}
			}
			else if(hh<=1&&hh>=21)
			{
				midnightsum++;
				if((MM>mm&&MM-mm<=8)||(MM<mm&&MM+60-mm<=8))
				{
					midnight++;
				}
			}
		}
		printf("lunch ");
		if(lunchsum==0)
		{
			printf("no guest\n");
		}
		else
		{
			printf("%d\n",(int)(1.0*lunch/lunchsum*100));
		}
		printf("dinner ");
		if(dinnersum==0)
		{
			printf("no guest\n");
		}
		else
		{
			printf("%d\n",(int)(1.0*dinner/dinnersum*100));
		}
		printf("midnight ");
		if(midnightsum==0)
		{
			printf("no guest\n");
		}
		else
		{
			printf("%d\n",(int)(1.0*midnight/midnightsum*100));
		}

	}




	return 0;
}

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

#include<stdio.h>
int main()
{
	int n,i,a,b,d,e,f,g;
	int lunchsum,dinnersum,midnightsum,lunchss,dinnerss,midnightss;
	char c;
	while(scanf("%d",&n)&&(n!=0))
	{ 
	
		lunchsum=0;
		dinnersum=0;
		midnightsum=0;
		lunchss=0;
			dinnerss=0;
		midnightss=0;
		for(i=0;i<n;i++)
		{
			scanf("%d%c%d%d",&a,&c,&b,&d);
			if(a>=11&&a<=14)
			{
				lunchsum++;
				if((d-b)<=8&&(d-b)>=0)
					lunchss++;
				else if((d-b)<0)
				{
					if((d+60-b)<=8&&(a!=14))
						lunchss++;
				}
			}
			else if(a>=18&&a<=20)
		          
			{
				dinnersum++;
				if((d-b)<=8&&(d-b)>=0)
					dinnerss++;
				else if((d-b)<0)
				{
					if((d+60-b)<=8&&(a!=20))
						dinnerss++;
				}
			}
			else if((a>=21&&a<=23)||a<=1&&a>=0

Compiler output:
main.c: In function 'main':
main.c:42:59: error: expected ')' at end of input
   42 |                         else if((a>=21&&a<=23)||a<=1&&a>=0
      |                                ~                          ^
      |                                                           )
main.c:42:25: error: expected declaration or statement at end of input
   42 |                         else if((a>=21&&a<=23)||a<=1&&a>=0
      |                         ^~~~
main.c:42:25: error: expected declaration or statement at end of input
main.c:42:25: error: expected declaration or statement at end of input
Language: C++

// ConsoleApplication1.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//


#include<stdio.h>
#include"stdafx.h"
int main(void){
	int n,cnt,a,b,c,i,m;
	int cnt1 =0;
	int cnt2 =0;
	int L=0;
	int D=0;
	int M=0;
	int LP,DP,MP;

	i = 0;
	cnt = 0;

	scanf("%d",&n);

	while(i<n){
		scanf("%d%*c%d%d",&a, &b, &c);
		i++;
		if(a == 0)
			break; 
		m = a * 60 + b;
		if(m<660){
			M++;
		if(c-a<=8){
			cnt++;
		}else if(c-a <0){
			if((60-a)+c<=8){
				cnt++;
			}
		}
		}else if(m<900){
			L++;
			if(c-a<=8){
			cnt++;
		}else if(c-a <0){
			if((60-a)+c<=8){
				cnt1++;
			}
			}
		}else if(m<1260){
			D++;
			if(c-a<=8){
			cnt++;
		}else if(c-a <0){
			if((60-a)+c<=8){
				cnt2++;
			}
			}
		}else if(m<=1440){
			M++;
			if(c-a<=8){
			cnt++;
		}else if(c-a <0){
			if((60-a)+c<=8){
				cnt++;
			}
			}
		}

	}

	LP = (int)(L/cnt1)*100;
	DP = (int)(D/cnt2)*100;
	MP = (int)(M/cnt)*100;

	if(LP==0){
		printf("lunch no guest\n");
	}else{
		printf("lunch %d\n",LP);
	}

	if(DP==0){
		printf("dinner no guest\n");
	}else{
		printf("dinner %d\n",LP);
	}

	if(MP==0){
		printf("midnight no guest\n");
	}else{
		printf("midnight %d\n",MP);
	}

	return 0;
}

Compiler output:
a.cc:6:9: fatal error: stdafx.h: No such file or directory
    6 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
#include <string.h>
 
#define LUNCH 0
#define DINNER 1
#define MIDNIGHT 2
 
#define OK 0
#define NG 1
 
int main(void){
    int n, i, j, hh, mm, MM, ans[3][2], *p;
    char str_MM[3];
 
 
    while(1){
        scanf_s("%d",&n);
        if(n == 0){
            break;
        }
 
        memset(ans,0,sizeof(ans));
 
        for(i = 0;i < n;i++){
            scanf_s("%d%*c%d%d",&hh,&mm,&MM);
        /*  scanf("%s",str_MM);
             
            MM = 0;
            for(i = 0;i < 2;i++){
                MM = MM * 10 + (str_MM[i] - '0');
            }*/
 
            if(2 <= hh && hh <= 10 || 15 <= hh && hh <= 17){
                continue;
            }
 
            if(11 <= hh && hh <= 14){
                p = ans[LUNCH];
            }else if(18 <= hh && hh <= 20){
                p = ans[DINNER];
            }else{
                p = ans[MIDNIGHT];
            }
 
            if((MM + 60 - mm) % 60 <= 8){
                p[OK]++;
            }else{
                p[NG]++;
            }
        }
        if(ans[LUNCH][OK] != 0 || ans[LUNCH][NG] != 0){
            printf("lunch %d\n",ans[LUNCH][OK] * 100 / (ans[LUNCH][OK] + ans[LUNCH][NG]));
        }else{
            printf("lunch no guest\n");
        }
        if(ans[DINNER][OK] != 0 || ans[DINNER][NG] != 0){
            printf("dinner %d\n",ans[DINNER][OK] * 100 / (ans[DINNER][OK] + ans[DINNER][NG]));
        }else{
            printf("dinner no guest\n");
        }
        if(ans[MIDNIGHT][OK] != 0 || ans[MIDNIGHT][NG] != 0){
            printf("midnight %d\n",ans[MIDNIGHT][OK] * 100 / (ans[MIDNIGHT][OK] + ans[MIDNIGHT][NG]));
        }else{
            printf("midnight no guest\n");
        }
         
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   17 |         scanf_s("%d",&n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <deque>
 
using namespace std;
 
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define mp make_pair
#define all(r) r.begin(),r.end()
#define fi first
#define se second
#define println(X) cout<<X<<endl;
#define DBG(X) cout<<#X<<" : "<<X<<endl;
 
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9;


string str[]={"linch ", "dinner ", "midnight "};

int main(){
	int n;
	while(cin>> n && n){
		int h, m1, m2; char c;
		int a, b;
		vi v(3, 0), u(3, 0);
		while(n--){
			cin>>h>>c>>m1>>m2;
			a = b = h*60;
			a += m1; b += m2 + (m1>m2?60:0);
			if(11*60<=a&&a<=14*60+59){
				u[0]++;
				if(b-a<=8) v[0]++;
			}
			else if(18*60<=a&&a<=20*60+59){
				u[1]++;
				if(b-a<=8) v[1]++;
			}
			else if((21*60<=a||a<=60+59){
				u[2]++;
				if(b-a<=8) v[2]++;
				//cout<<m1<<" "<<m2<<endl;
			}
		}
		rep(i, 3){
			cout<<str[i];
			if(u[i]==0) cout<<"no guest"<<endl;
			else cout<<v[i]*100/u[i]<<endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:53: error: expected ')' before '{' token
   62 |                         else if((21*60<=a||a<=60+59){
      |                                ~                    ^
      |                                                     )
a.cc:67:17: error: expected primary-expression before '}' token
   67 |                 }
      |                 ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main() {
	int n;
	while (cin >> n&&n != 0) {
		int a[3][2];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 2; j++) a[i][j] = 0;
		}
		int b, c, d;
		for (int i = 0; i < n; i++) {
			scanf_s("%d:%d %d", &b, &c, &d);
			int e = b * 60 + c, f = 0;
			bool l = false;
			if (c > d) {
				f = d + 60 - c;
			}
			else {
				f = d - c;
			}
			if (f <= 8) l = true;
			if (e >= 660 && e < 15 * 60) {
				if (l) a[0][1]++;
				a[0][0]++;
			}
			else if (e >= 18 * 60 && e < 21 * 60) {
				if (l) a[1][1]++;
				a[1][0]++;
			}
			else if (e >= 21 & 60 || e < 2 * 60) {
				if (l) a[2][1]++;
				a[2][0]++;
			}
		}
		if (a[0][0] == 0) {
			cout << "lunch no guest" << endl;
		}
		else {
			cout << "lunch " << (a[0][1] * 100) / a[0][0] << endl;
		}
		if (a[1][0] == 0) {
			cout << "dinner no guest" << endl;
		}
		else {
			cout << "dinner " << (a[1][1] * 100) / a[1][0] << endl;
		}
		if (a[2][0] == 0) {
			cout << "midnight no guest" << endl;
		}
		else {
			cout << "midnight " << (a[2][1] * 100) / a[2][0] << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                         scanf_s("%d:%d %d", &b, &c, &d);
      |                         ^~~~~~~
      |                         scanf
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main() {
	int n;
	while (cin >> n&&n != 0) {
		int a[3][2];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 2; j++) a[i][j] = 0;
		}
		int b, c, d;
		for (int i = 0; i < n; i++) {
			scanf_s("%d:%d %d", &b, &c, &d);
			if (b < 2) b += 24;
			int e = b * 60 + c, f = 0;
			bool l = false;
			if (c > d) {
				f = d + 60 - c;
			}
			else {
				f = d - c;
			}
			if (f <= 8) l = true;
			if (e >= 11*60 && e < 15 * 60) {
				if (l) a[0][1]++;
				a[0][0]++;
			}
			else if (e >= 18 * 60 && e < 21 * 60) {
				if (l) a[1][1]++;
				a[1][0]++;
			}
			else if (e >= 21 & 60 || e < 2 * 60) {
				if (l) a[2][1]++;
				a[2][0]++;
			}
		}
		if (a[0][0] == 0) {
			cout << "lunch no guest" << endl;
		}
		else {
			cout << "lunch " << (a[0][1] * 100) / a[0][0] << endl;
		}
		if (a[1][0] == 0) {
			cout << "dinner no guest" << endl;
		}
		else {
			cout << "dinner " << (a[1][1] * 100) / a[1][0] << endl;
		}
		if (a[2][0] == 0) {
			cout << "midnight no guest" << endl;
		}
		else {
			cout << "midnight " << (a[2][1] * 100) / a[2][0] << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                         scanf_s("%d:%d %d", &b, &c, &d);
      |                         ^~~~~~~
      |                         scanf
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main() {
	int n;
	while (cin >> n&&n != 0) {
		int a[3][2];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 2; j++) a[i][j] = 0;
		}
		int b, c, d;
		for (int i = 0; i < n; i++) {
			scanf_s("%d:%d %d", &b, &c, &d);
			if (b < 2) b += 24;
			int e = b * 60 + c, f = 0;
			bool l = false;
			if (c > d) {
				f = d + 60 - c;
			}
			else {
				f = d - c;
			}
			if (f <= 8) l = true;
			if (e >= 11*60 && e < 15 * 60) {
				if (l) a[0][1]++;
				a[0][0]++;
			}
			else if (e >= 18 * 60 && e < 21 * 60) {
				if (l) a[1][1]++;
				a[1][0]++;
			}
			else if (e >= 21 & 60) {
				if (l) a[2][1]++;
				a[2][0]++;
			}
		}
		if (a[0][0] == 0) {
			cout << "lunch no guest" << endl;
		}
		else {
			cout << "lunch " << (a[0][1] * 100) / a[0][0] << endl;
		}
		if (a[1][0] == 0) {
			cout << "dinner no guest" << endl;
		}
		else {
			cout << "dinner " << (a[1][1] * 100) / a[1][0] << endl;
		}
		if (a[2][0] == 0) {
			cout << "midnight no guest" << endl;
		}
		else {
			cout << "midnight " << (a[2][1] * 100) / a[2][0] << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                         scanf_s("%d:%d %d", &b, &c, &d);
      |                         ^~~~~~~
      |                         scanf
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main() {
	int n;
	while (cin >> n&&n != 0) {
		int a[3][2];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 2; j++) a[i][j] = 0;
		}
		int b, c, d;
		for (int i = 0; i < n; i++) {
			scanf_s("%d:%d %d", &b, &c, &d);
			if (b < 11) b += 24;
			if (d < c) d += 60;
			int f = d - c;
			int e = b * 60 + c;
			if (e >= 11 * 60 && e < 15 * 60) {
				a[0][0]++;
				if (f <= 8) a[0][1]++;
			}
			if (e >= 18 * 60 && e < 21 * 60) {
				a[1][0]++;
				if (f <= 8) a[1][1]++;
			}
			if (e >= 21 * 60) {
				a[2][0]++;
				if (f <= 8) a[2][1]++;
			}
		}
		if (a[0][0] == 0) {
			cout << "lunch no guest" << endl;
		}
		else {
			cout << "lunch " << (a[0][1] * 100) / a[0][0] << endl;
		}
		if (a[1][0] == 0) {
			cout << "dinner no guest" << endl;
		}
		else {
			cout << "dinner " << (a[1][1] * 100) / a[1][0] << endl;
		}
		if (a[2][0] == 0) {
			cout << "midnight no guest" << endl;
		}
		else {
			cout << "midnight " << (a[2][1] * 100) / a[2][0] << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                         scanf_s("%d:%d %d", &b, &c, &d);
      |                         ^~~~~~~
      |                         scanf
Language: C++

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

struct time{
	int h , m ;
	time(int hh , int mm ){
		h=hh;m=mm;
	}
	void operator ++ (){
		m++;
		if( m == 60 ){
		 m = 0;
		 h ++ ;
		 if( h == 24 )
			 h = 0;
		}
	}

	int at(){
		if( (h>=11&&m>=0) &&( h <=14 && m <= 59) )return 0;
		if( ( h >=18&&m>=0 ) && (h<=20&&m<=59)) return 1;
		if( (h>=21&&m>=0)||(h<=1&&m<=59)) return 2;
		return 3;
	}
};
int ans[3][2];
int main(){
	int n ;while(~scanf("%d",&n),n){
		memset(ans,0,sizeof(ans));
		int a , b , c ;
		for(int i = 0 ; i< n ; ++ i ){
			 scanf("%d%*c%d%d",&a, &b, &c);
			time tmp = time(a,b);
			int aat = tmp.at();
			if( aat == 3  ) continue ;
			ans[aat][0]++;
			int k = 0 ;
			while( tmp.m != c ){
				tmp++;
				k++;
			}
			if( k <= 8 )
				ans[aat][1]++;
		}
		printf("lunch ");
		if( ans[0][0] == 0 ) printf("no guest\n");
		else printf("%d\n",ans[0][1]*100/ans[0][0]);
		printf("dinner ");
		if( ans[1][0] == 0 ) printf("no guest\n");
		else printf("%d\n",ans[1][1]*100/ans[1][0]);
		printf("midnight ");
		if( ans[2][0] == 0 ) printf("no guest\n");
		else printf("%d\n",ans[2][1]*100/ans[2][0]);
			
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:29: error: expected ';' before 'tmp'
   36 |                         time tmp = time(a,b);
      |                             ^~~~
      |                             ;
a.cc:37:35: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   37 |                         int aat = tmp.at();
      |                                   ^~~
      |                                   tm