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

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

#define PIE atan(1.0)*4

typedef struct nd{
	int id;
	//
	int x, y;
	int r;
	int v;
	//
	double polar_r;
	double polar_t;
	//
	int state;	// 0:接近中，1:撃破, 2:到達
	struct nd *next;
	struct nd *prev;
	bool dummy;
} node;

void initList(node **top, int num) {
	int i;
	// 極座標変換
	for (i = 0; i < num; i++) {
		top[i]->polar_r = sqrt((double)(top[i]->x*top[i]->x + top[i]->y*top[i]->y));
		top[i]->polar_t = acos((double)top[i]->x / top[i]->polar_r);
		if (top[i]->y < 0)
			top[i]->polar_t = 2*PIE-top[i]->polar_t;
		top[i]->prev = i!=0 ? top[i - 1] : NULL;
		top[i]->next = i!=num-1 ? top[i + 1] : NULL;
		top[i]->dummy = false;
	}
}

node *removeNode(node *target) {
	node *next = target->next;
	target->next->prev = target->prev;
	target->prev->next = target->next;
	free(target);
	return next;
}

void removeNodes(node *begin) {
	node *temp = begin->next;
	while (temp->next != NULL) {
		if (temp->state != 0)
			temp = removeNode(temp);
		else
			temp = temp->next;
	}
}

int main(int argc, char* argv[]) {

	while (true) {
		// データ読み込み
		int invaridR, ufoNum;
		scanf_s("%d %d", &invaridR, &ufoNum);
		if (invaridR == 0 && ufoNum == 0) break;
		node **ufos = (node**)malloc(sizeof(node*)*ufoNum);
		for (int i = 0; i < ufoNum; i++) {
			ufos[i] = (node*)malloc(sizeof(node));
			ufos[i]->id = i;
			scanf_s("%d %d %d %d", &(ufos[i]->x), &(ufos[i]->y), &(ufos[i]->r), &(ufos[i]->v));
			ufos[i]->next = ufos[i]->prev = NULL;
			ufos[i]->state = 0;
		}
		initList(ufos, ufoNum);
		node *begin = (node*)malloc(sizeof(node));
		begin->dummy = true;
		begin->id = -1;
		begin->prev = NULL;
		begin->next = ufos[0];
		ufos[0]->prev = begin;
		node *end = (node*)malloc(sizeof(node));
		end->dummy = true;
		end->id = -2;
		end->next = NULL;
		end->prev = ufos[ufoNum - 1];
		ufos[ufoNum - 1]->next = end;

		// 計算
		int t = 0;
		int count = 0;
		node *temp;
		int i;
		while (begin->next != end) {
			// 位置＆時刻更新
			t++;
			for (i = 0; i < ufoNum; i++) {
				ufos[i]->polar_r -= ufos[i]->v;
			}
			// 照射方向決定
			double minR = 1500;
			double fireT = 0;
			for (temp = begin->next; temp != end; temp = temp->next) {
				if (temp->polar_r < minR && temp->polar_r>invaridR) {
					minR = temp->polar_r;
					fireT = temp->polar_t;
				}
			}
			// 照射
			for (temp = begin->next; temp != end; temp = temp->next) {
				double dt = fireT - temp->polar_t;
				if (dt > 2 * PIE) dt -= 2 * PIE;
				if (dt < 0) dt += 2 * PIE;
				if (temp->polar_r < invaridR) {
					// 到達
					temp->state = 2;
					count++;
				}
				else if (fabs(temp->polar_r*sin(dt)) < temp->r){
					// 撃破
					temp->state = 1;
				}
			}
			// 不要ufo削除
			removeNodes(begin);
		}

		fprintf(stdout, "%d\n", count);
	}
}

Compiler output:
main.c: In function 'main':
main.c:61:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   61 |                 scanf_s("%d %d", &invaridR, &ufoNum);
      |                 ^~~~~~~
      |                 scanf
Language: C

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

#define PIE atan(1.0)*4

typedef struct nd{
	int id;
	//
	int x, y;
	int r;
	int v;
	//
	double polar_r;
	double polar_t;
	//
	int state;	// 0:接近中，1:撃破, 2:到達
	struct nd *next;
	struct nd *prev;
	bool dummy;
} node;

void initList(node **top, int num) {
	int i;
	// 極座標変換
	for (i = 0; i < num; i++) {
		top[i]->polar_r = sqrt((double)(top[i]->x*top[i]->x + top[i]->y*top[i]->y));
		top[i]->polar_t = acos((double)top[i]->x / top[i]->polar_r);
		if (top[i]->y < 0)
			top[i]->polar_t = 2*PIE-top[i]->polar_t;
		top[i]->prev = i!=0 ? top[i - 1] : NULL;
		top[i]->next = i!=num-1 ? top[i + 1] : NULL;
		top[i]->dummy = false;
	}
}

node *removeNode(node *target) {
	node *next = target->next;
	target->next->prev = target->prev;
	target->prev->next = target->next;
	free(target);
	return next;
}

void removeNodes(node *begin) {
	node *temp = begin->next;
	while (temp->next != NULL) {
		if (temp->state != 0)
			temp = removeNode(temp);
		else
			temp = temp->next;
	}
}

int main(int argc, char* argv[]) {

	int invaridR, ufoNum;

	int i;
	node *temp;

	while (true) {
		// データ読み込み
		scanf_s("%d %d", &invaridR, &ufoNum);
		if (invaridR == 0 && ufoNum == 0) break;
		node **ufos = (node**)malloc(sizeof(node*)*ufoNum);
		for (i = 0; i < ufoNum; i++) {
			ufos[i] = (node*)malloc(sizeof(node));
			ufos[i]->id = i;
			scanf_s("%d %d %d %d", &(ufos[i]->x), &(ufos[i]->y), &(ufos[i]->r), &(ufos[i]->v));
			ufos[i]->next = ufos[i]->prev = NULL;
			ufos[i]->state = 0;
		}
		initList(ufos, ufoNum);
		node *begin = (node*)malloc(sizeof(node));
		begin->dummy = true;
		begin->id = -1;
		begin->prev = NULL;
		begin->next = ufos[0];
		ufos[0]->prev = begin;
		node *end = (node*)malloc(sizeof(node));
		end->dummy = true;
		end->id = -2;
		end->next = NULL;
		end->prev = ufos[ufoNum - 1];
		ufos[ufoNum - 1]->next = end;

		// 計算
		int t = 0;
		int count = 0;
		while (begin->next != end) {
			// 位置＆時刻更新
			t++;
			for (i = 0; i < ufoNum; i++) {
				ufos[i]->polar_r -= ufos[i]->v;
			}
			// 照射方向決定
			double minR = 1500;
			double fireT = 0;
			for (temp = begin->next; temp != end; temp = temp->next) {
				if (temp->polar_r < minR && temp->polar_r>invaridR) {
					minR = temp->polar_r;
					fireT = temp->polar_t;
				}
			}
			// 照射
			for (temp = begin->next; temp != end; temp = temp->next) {
				double dt = fireT - temp->polar_t;
				if (dt > 2 * PIE) dt -= 2 * PIE;
				if (dt < 0) dt += 2 * PIE;
				if (temp->polar_r < invaridR) {
					// 到達
					temp->state = 2;
					count++;
				}
				else if (fabs(temp->polar_r*sin(dt)) < temp->r){
					// 撃破
					temp->state = 1;
				}
			}
			// 不要ufo削除
			removeNodes(begin);
		}

		fprintf(stdout, "%d\n", count);
	}
}

Compiler output:
main.c: In function 'main':
main.c:65:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   65 |                 scanf_s("%d %d", &invaridR, &ufoNum);
      |                 ^~~~~~~
      |                 scanf
Language: C

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

double complex coordinate(double complex z, int v, int t){
	return t*v*(-z/cabs(z))+z;
}

double theta(double complex z, int r, int i){
	return carg(z+(z/cabs(z))*r*i*I);
}
struct UFO{
	char discrim;
	int v;
	int radius;
	double complex z0;
};
	
int main(){
	int range,number,time;
	while(range != 0 || number != 0){

		scanf("%d %d",&range,&number);
		time=0;
		struct UFO ufo[number];
		int i,x,y;
		
		for(i=0;i<number;i++){
			scanf("%d %d %d %d",&x,&y,&ufo[i].radius,&ufo[i].v);
			ufo[i].z0=x+y*I;
			ufo[i].discrim=1;
		}
		
		int target=0;
		int live = 0;
		double complex cod[number];
		double argtarget;

		while(target != -1){
			time++;
			target=-1;
			for(i=0;i<number;i++){
				if(ufo[i].discrim == 1){
					cod[i]=coordinate(ufo[i].z0,ufo[i].v,time);
					if(cabs(cod[i])<=range){
						live++;
						ufo[i].discrim=0;
					}
					else{
						if(target==-1){
							target=i;
						}
						else{
							if(cabs(cod[i])<cabs(cod[target])){
								target=i;
							}
						}
					}
				}
			}
			if(target != -1){
				argtarget=carg(cod[target]);
				for(i=0;i<number;i++){
					if(ufo[i].discrim==1){
						if(((theta(cod[i],ufo[i].radius,-1)<=argtarget)&&(argtarget<=theta(cod[i],ufo[i].radius,1)))||(theta(cod[i],ufo[i].radius,1)<0&&theta(cod[i],ufo[i].radius,-1)>0&&(theta(cod[i],ufo[i].radius,-1)<=argtarget||argtarget<=theta(cod[i],ufo[i].radius,1)))){
							ufo[i].discrim=0;
						}
					}
				}
			}
		}
		if(range!=0 || number!=0){
			printf("%d\n",live);
		{	
	}
	return NULL;
}

Compiler output:
main.c: In function 'main':
main.c:76:16: error: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
   76 |         return NULL;
      |                ^~~~
main.c:77:1: error: expected declaration or statement at end of input
   77 | }
      | ^
main.c:77:1: error: expected declaration or statement at end of input
Language: C++

### main

while true
  rlimit, n = gets.strip.split(' ').map{|s| s.to_i}
  break if rlimit == 0 && n == 0

  rlimit2 = rlimit ** 2

  ufos = []

  n.times.each do
    x0, y0, r, v = gets.strip.split(' ').map{|s| s.to_i}

    d2 = x0 ** 2 + y0 ** 2
    d = Math.sqrt(d2)
    vx = -x0.to_f * v / d
    vy = -y0.to_f * v / d
    ufos << [x0.to_f, y0.to_f, d2, x0, y0, vx, vy, r * r]
  end

  count = 0
  t = 0

  while ! ufos.empty?
    #puts "t=#{t}"

    ufos0 = ufos.sort{|a, b| a[2] <=> b[2]}
    min_u = nil

    for u0 in ufos0
      #p ['u0'] + u0

      if u0[2] <= rlimit2
        count += 1
        ufos.delete(u0)
        #puts "  d2=#{u0[2]}, rlimit2=#{rlimit2}: enter (delete)"
        next
      end

      if min_u.nil?
        min_u = u0
        lx = u0[3]
        ly = u0[4]
        lxy2 = lx ** 2 + ly ** 2
        ## lazer: ly * x - lx * y = 0
        ufos.delete(u0)
        #puts "  nearest (delete)"
        next
      end

      ld2 = (ly * u0[0] - lx * u0[1]) ** 2
      if ld2 <= u0[7] * lxy2 && lx * u0[0] + ly * u0[1] > 0
        ufos.delete(u0)
        #puts "  dr2=#{ld2/lxy2} <= r2=#{u0[7]} : hit (delete)"
      end
    end

    t += 1

    for u in ufos
      u[0] = u[5] * t + u[3]
      u[1] = u[6] * t + u[4]
      u[2] = u[0] ** 2 + u[1] ** 2
    end
  end

  puts count
end

Compiler output:
a.cc:1:1: error: stray '##' in program
    1 | ### main
      | ^~
a.cc:1:3: error: stray '#' in program
    1 | ### main
      |   ^
a.cc:25:6: error: invalid preprocessing directive #puts
   25 |     #puts "t=#{t}"
      |      ^~~~
a.cc:31:8: error: invalid preprocessing directive #p
   31 |       #p ['u0'] + u0
      |        ^
a.cc:36:10: error: invalid preprocessing directive #puts
   36 |         #puts "  d2=#{u0[2]}, rlimit2=#{rlimit2}: enter (delete)"
      |          ^~~~
a.cc:45:9: error: stray '##' in program
   45 |         ## lazer: ly * x - lx * y = 0
      |         ^~
a.cc:47:10: error: invalid preprocessing directive #puts
   47 |         #puts "  nearest (delete)"
      |          ^~~~
a.cc:54:10: error: invalid preprocessing directive #puts
   54 |         #puts "  dr2=#{ld2/lxy2} <= r2=#{u0[7]} : hit (delete)"
      |          ^~~~
a.cc:1:5: error: 'main' does not name a type
    1 | ### main
      |     ^~~~
a.cc:5:3: error: expected unqualified-id before 'break'
    5 |   break if rlimit == 0 && n == 0
      |   ^~~~~
a.cc:14:5: error: 'd2' does not name a type
   14 |     d2 = x0 ** 2 + y0 ** 2
      |     ^~
a.cc:28:5: error: 'min_u' does not name a type
   28 |     min_u = nil
      |     ^~~~~
Language: C++

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

const double eps = 1e-7;
int xs[100], ys[100], rs[100], vs[100];
bool shoot[100];

inline int sq(int x) {
	return x*x;
}

int main() {
	int R, N;
	while (cin >> R >> N, (R || N)) {
		for (int i=0; i<N; ++i) {
			cin >> xs[i] >> ys[i] >> rs[i] >> vs[i];
		}
		memset(shoot, false, sizeof shoot);
		for (int m=1; ; ++m) {
			int k = -1, minDist = INT_MAX;
			for (int i=0; i<N; ++i) {
				int dist = sq(xs[i])+sq(ys[i]) - sq(R+vs[i]*m);
				if ( ! shoot[i] && 0 < dist && dist < minDist) {
					minDist = dist;
					k = i;
				}
			}
			if (k == -1) break;
			shoot[k] = true;
			for (int i=0; i<N; ++i) {
				int dist = sq(xs[i])+sq(ys[i]) - sq(R+vs[i]*m);
				if ( ! shoot[i] && 0 < dist) {
					double x = xs[k] - vs[k] * cos(atan2(xs[k], ys[k]));
					double y = ys[k] - vs[k] * sin(atan2(xs[k], ys[k]));
					double p = xs[i] - vs[i] * cos(atan2(xs[i], ys[i]));
					double q = ys[i] - vs[i] * sin(atan2(xs[i], ys[i]));
					double a = y/x;
					double t = sq(a*p-q)/(1+a*a);
					if (t <= sq(rs[i]) + eps) {
						shoot[i] = true;
					}
				}
			}
		}
		int res = 0;
		for (int i=0; i<N; ++i) {
			if ( ! shoot[i]) ++res;
		}
		cout << res << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:72: error: 'atan2' was not declared in this scope
   39 |                                         double x = xs[k] - vs[k] * cos(atan2(xs[k], ys[k]));
      |                                                                        ^~~~~
a.cc:39:68: error: 'cos' was not declared in this scope
   39 |                                         double x = xs[k] - vs[k] * cos(atan2(xs[k], ys[k]));
      |                                                                    ^~~
a.cc:40:68: error: 'sin' was not declared in this scope
   40 |                                         double y = ys[k] - vs[k] * sin(atan2(xs[k], ys[k]));
      |                                                                    ^~~
Language: C++

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

#define PIE atan(1.0)*4

typedef struct nd{
	int id;
	//
	int x, y;
	int r;
	int v;
	//
	double polar_r;
	double polar_t;
	//
	int state;	// 0:接近中，1:撃破, 2:到達
	struct nd *next;
	struct nd *prev;
	bool dummy;
} node;

void initList(node **top, int num) {
	// 極座標変換
	for (int i = 0; i < num; i++) {
		top[i]->polar_r = sqrt((double)(top[i]->x*top[i]->x + top[i]->y*top[i]->y));
		top[i]->polar_t = acos((double)top[i]->x / top[i]->polar_r);
		if (top[i]->y < 0)
			top[i]->polar_t = 2*PIE-top[i]->polar_t;
		top[i]->prev = i!=0 ? top[i - 1] : NULL;
		top[i]->next = i!=num-1 ? top[i + 1] : NULL;
		top[i]->dummy = false;
	}
}

node *remove(node *target) {
	node *next = target->next;
	target->next->prev = target->prev;
	target->prev->next = target->next;
	free(target);
	return next;
}

void removeNodes(node *begin) {
	node *temp = begin->next;
	while (temp->next != NULL) {
		if (temp->state != 0)
			temp = remove(temp);
		else
			temp = temp->next;
	}
}

int main(int argc, char* argv[]) {

	while (true) {
		// データ読み込み
		int invaridR, ufoNum;
		fscanf_s(stdin, "%d %d", &invaridR, &ufoNum);
		if (invaridR == 0 && ufoNum == 0) break;
		node **ufos = (node**)malloc(sizeof(node*)*ufoNum);
		for (int i = 0; i < ufoNum; i++) {
			ufos[i] = (node*)malloc(sizeof(node));
			ufos[i]->id = i;
			fscanf_s(stdin, "%d %d %d %d", &(ufos[i]->x), &(ufos[i]->y), &(ufos[i]->r), &(ufos[i]->v));
			ufos[i]->next = ufos[i]->prev = NULL;
			ufos[i]->state = 0;
		}
		initList(ufos, ufoNum);
		node *begin = (node*)malloc(sizeof(node));
		begin->dummy = true;
		begin->id = -1;
		begin->prev = NULL;
		begin->next = ufos[0];
		ufos[0]->prev = begin;
		node *end = (node*)malloc(sizeof(node));
		end->dummy = true;
		end->id = -2;
		end->next = NULL;
		end->prev = ufos[ufoNum - 1];
		ufos[ufoNum - 1]->next = end;

		// 計算
		int t = 0;
		int count = 0;
		while (begin->next != end) {
			// 位置＆時刻更新
			t++;
			for (int i = 0; i < ufoNum; i++) {
				ufos[i]->polar_r -= ufos[i]->v;
			}
			// 照射方向決定
			double minR = 1500;
			double fireT = 0;
			for (node *temp = begin->next; temp != end; temp = temp->next) {
				if (temp->polar_r < minR && temp->polar_r>invaridR) {
					minR = temp->polar_r;
					fireT = temp->polar_t;
				}
			}
			// 照射
			for (node *temp = begin->next; temp != end; temp = temp->next) {
				double dt = fireT - temp->polar_t;
				if (dt > 2 * PIE) dt - 2 * PIE;
				if (dt < 0) dt += 2 * PIE;
				if (temp->polar_r < invaridR) {
					// 到達
					temp->state = 2;
					count++;
				}
				else if (fabs(temp->polar_r*sin(dt)) < temp->r){
					// 撃破
					temp->state = 1;
				}
			}
			// 不要ufo削除
			removeNodes(begin);
		}

		fprintf(stdout, "%d\n", count);
	}
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:59:17: error: 'fscanf_s' was not declared in this scope; did you mean 'fscanf'?
   59 |                 fscanf_s(stdin, "%d %d", &invaridR, &ufoNum);
      |                 ^~~~~~~~
      |                 fscanf
Language: C++

from math import sqrt

class Ufo:
	def __init__(self,px,py,d,vd,ui):
		self.pd=sqrt(px**2+py**2)
		self.px=float(px)
		self.py=float(py)
		self.ex=self.px/self.pd
		self.ey=self.py/self.pd
		self.d=float(d)
		self.vd=float(vd)
		self.vx=-self.vd*self.ex
		self.vy=-self.vd*self.ey
		self.i=ui
	def move(self):
		self.pd -= self.vd
		self.px += self.vx
		self.py += self.vy



while True:
	R,ul=tuple(map(int,raw_input().split()))
	if(R==0 and ul==0): break
	us=[]
	for ui in xrange(ul):
		px,py,d,vd = tuple(map(int,raw_input().split()))
		u = Ufo(px,py,d,vd,ui)
		us.append(u)

	re=0
	while True:
		for u in us:
			u.move()

		for u in us[:]:
			if u.pd<=R:
				re+=1
				us.remove(u)
		if len(us)==0: break

		neu = Ufo(2000,2000,1,1,1)
		for u in us:
			if u.pd < neu.pd:
				neu=u
		laserex=neu.ex
		laserey=neu.ey

		for u in us[:]:
			d = u.pd*abs(laserex*u.ey-laserey*u.ex)	#u kara laser ni orosita suisen no nagasa
			if d<u.d:
				if u.pd*abs(laserex*u.ex+laserey*u.ey)+sqrt(u.d**2-d**2) > R:
					us.remove(u)
		if len(us)==0: break

	print re

Compiler output:
a.cc:50:65: error: stray '#' in program
   50 |                         d = u.pd*abs(laserex*u.ey-laserey*u.ex) #u kara laser ni orosita suisen no nagasa
      |                                                                 ^
a.cc:1:1: error: 'from' does not name a type
    1 | from math import sqrt
      | ^~~~
Language: C++

from math import sqrt

class Ufo:
	def __init__(self,px,py,d,vd,ui):
		self.pd=sqrt(px**2+py**2)
		self.px=float(px)
		self.py=float(py)
		self.ex=self.px/self.pd
		self.ey=self.py/self.pd
		self.d=float(d)
		self.vd=float(vd)
		self.vx=-self.vd*self.ex
		self.vy=-self.vd*self.ey
		self.i=ui
	def move(self):
		self.pd -= self.vd
		self.px += self.vx
		self.py += self.vy



while True:
	R,ul=tuple(map(int,raw_input().split()))
	if(R==0 and ul==0): break
	us=[]
	for ui in xrange(ul):
		px,py,d,vd = tuple(map(int,raw_input().split()))
		u = Ufo(px,py,d,vd,ui)
		us.append(u)

	re=0
	while len(us)!=0:
		for u in us: u.move()
		us.sort(key=lambda u: u.pd)

		for u in us[:]:
			if u.pd<=R:
				re+=1
				us.remove(u)
				#print u.i, "due to invade"
				continue
			else:
				break

		neu=us.pop(0)
		#print "focus",neu.i
		#print neu.i,"due to hit"
		laserex=neu.ex
		laserey=neu.ey

		for u in us[:]:
			d = u.pd*abs(laserex*u.ey-laserey*u.ex)	#u kara laser ni orosita suisen no nagasa
			if d<u.d:
				if u.pd*abs(laserex*u.ex+laserey*u.ey)+sqrt(u.d**2-d**2) > R:
					us.remove(u)
					#print u.i, "due to hit"

	print re

Compiler output:
a.cc:40:34: error: invalid preprocessing directive #print
   40 |                                 #print u.i, "due to invade"
      |                                  ^~~~~
a.cc:46:18: error: invalid preprocessing directive #print
   46 |                 #print "focus",neu.i
      |                  ^~~~~
a.cc:47:18: error: invalid preprocessing directive #print
   47 |                 #print neu.i,"due to hit"
      |                  ^~~~~
a.cc:52:65: error: stray '#' in program
   52 |                         d = u.pd*abs(laserex*u.ey-laserey*u.ex) #u kara laser ni orosita suisen no nagasa
      |                                                                 ^
a.cc:56:42: error: invalid preprocessing directive #print
   56 |                                         #print u.i, "due to hit"
      |                                          ^~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from math import sqrt
      | ^~~~
Language: C++

from math import sqrt,cos,atan2

class Ufo:
	def __init__(self,px,py,d,vd,ui):
		self.pd=sqrt(px**2+py**2)
		self.px=float(px)
		self.py=float(py)
		self.fpd=self.pd
		self.fpx=self.px
		self.fpy=self.py
		self.ex=self.fpx/self.fpd
		self.ey=self.fpy/self.fpd
		self.d=float(d)
		self.vd=float(vd)
		self.vx=-self.vd*self.ex
		self.vy=-self.vd*self.ey
		self.i=ui
	def move(self):
		self.pd -= self.vd
		self.px += self.vx
		self.py += self.vy



while True:
	R,ul=tuple(map(int,raw_input().split()))
	if(R==0 and ul==0): break
	us=[]
	for ui in xrange(ul):
		px,py,d,vd = tuple(map(int,raw_input().split()))
		u = Ufo(px,py,d,vd,ui)
		us.append(u)

	re=0
	while True:
		for u in us: u.move()
		us.sort(key=lambda u: u.pd)

		for u in us[:]:
			if u.pd<=R:
				re+=1
				us.remove(u)
				#print u.i, "due to invade"
				continue
			else:
				break
		if len(us)==0: break

		neu=us.pop(0)
		#print "focus",neu.i
		#print neu.i,"due to hit"

		for u in us[:]:
			d = u.pd*abs(neu.fpx*u.fpy-neu.fpy*u.fpx)/neu.fpd/u.fpd	#u kara laser ni orosita suisen no nagasa
			if d<u.d:
				if u.pd*cos(atan2(u.fpy,u.fpx)-atan2(neu.fpy,neu.fpx)) + sqrt(u.d**2-d**2) > R:
					us.remove(u)
					#print u.i, "due to hit"
		if len(us)==0: break

	print re

Compiler output:
a.cc:43:34: error: invalid preprocessing directive #print
   43 |                                 #print u.i, "due to invade"
      |                                  ^~~~~
a.cc:50:18: error: invalid preprocessing directive #print
   50 |                 #print "focus",neu.i
      |                  ^~~~~
a.cc:51:18: error: invalid preprocessing directive #print
   51 |                 #print neu.i,"due to hit"
      |                  ^~~~~
a.cc:54:81: error: stray '#' in program
   54 |                         d = u.pd*abs(neu.fpx*u.fpy-neu.fpy*u.fpx)/neu.fpd/u.fpd #u kara laser ni orosita suisen no nagasa
      |                                                                                 ^
a.cc:58:42: error: invalid preprocessing directive #print
   58 |                                         #print u.i, "due to hit"
      |                                          ^~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from math import sqrt,cos,atan2
      | ^~~~
Language: C++

#include <cstdio>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;

#define EPS 1e-6
typedef complex<double> P;

struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

struct C {
  P p; double r;
  C(const P &p, double r) : p(p), r(r) { }
};

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}

double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}

double dist(const P& a, const P& b)
{
	return sqrt((a.real()-b.real())*(a.real()-b.real())+(a.imag()-b.imag())*(a.imag()-b.imag()));
}

bool intersectSC(const L& l, const C& c)
{
	double vc=dot(l[1]-l[0], c.p-l[0]);
	if(vc<0)
	{
		double dif=c.r-dist(l[0], c.p);
		return dif+EPS > 0;
	}
	
	double vv=dot(l[1]-l[0], l[1]-l[0]);
	
	if(vc > vv)
	{
		double d=dist(l[1], c.p);
		double dif=c.r*c.r-d*d;
		
		return dif+EPS > 0;
	}
	
	double cc=dot(c.p-l[0], c.p-l[0]);
	double dif=c.r*c.r-(cc-(vc/vv)*vc);
	
	return dif+EPS > 0;
}

class UFO
{
public:
	C c;
	int v;
	double d;
	UFO(C c, int v, double d)
	:c(c),v(v),d(d)
	{}
	
	bool operator<(const UFO& u) const
	{
		return d>u.d;
	}
};

int main()
{
	int R,N;
	while(cin >> R >> N)
	{
		priority_queue<UFO> q;
		while(N--)
		{
			int x,y,r,v;
			cin >> x >> y >> r >> v;
			q.push(UFO(C(P(x,y),r),v, dist(P(0,0), P(x,y))));
		}
		
		int cnt=0;
		while(!q.empty())
		{
			UFO u=q.top(); q.pop();
			if(u.d < R+EPS)
			{
				cnt++;
				continue;
			}
			
			priority_queue<UFO> tq;
			L s(P(0,0),P(u.c.p.real()*1000, u.c.p.imag()*1000));
			while(!q.empty())
			{
				UFO uf=q.top(); q.pop();
				if(intersectSC(s, uf.c)) continue;
				tq.push(UFO(uf.c, uf.v, uf.d-uf.v));
			}
			
			while(!tq.empty())
			{
				q.push(tq.top()); tq.pop();
			}
		}
		
		cout << cnt << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:15: error: 'cin' was not declared in this scope
   80 |         while(cin >> R >> N)
      |               ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include <queue>
  +++ |+#include <iostream>
    7 | using namespace std;
a.cc:115:17: error: 'cout' was not declared in this scope
  115 |                 cout << cnt << endl;
      |                 ^~~~
a.cc:115:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

import java.util.Scanner;

//UFO Shooting Down Operation
public class Main{

	double dot(double[] a, double[] b){
		return a[0]*b[0]+a[1]*b[1];
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			int R = sc.nextInt();
			int n = sc.nextInt();
			if((R|n)==0)break;
			int[][] ufo = new int[n][4];
			for(int i=0;i<n;i++)for(int j=0;j<4;j++)ufo[i][j]=sc.nextInt();
			double[] dist = new double[n];
			for(int i=0;i<n;i++)dist[i]=Math.hypot(ufo[i][0], ufo[i][1])-ufo[i][3];
			boolean[] u = new boolean[n];
			int c = 0;
			while(true){
				double min = 1<<20;
				int id = -1;
				for(int i=0;i<n;i++){
					if(u[i])continue;
					if(dist[i]<=R){
						u[i] = true;
						c++;
					}
					else if(dist[i]<min){
						min = dist[i];
						id = i;
					}
				}
				if(id==-1)break;
				double[] p = {ufo[id][0], ufo[id][1]};
				for(int i=0;i<n;i++){
					if(u[i])continue;
					dist[i]-=ufo[i][3];
					double[] ci = {ufo[i][0], ufo[i][1]};
					double A = dot(p, p);
					double B = -2*dot(p, ci);
					double C = dot(ci, ci)-ufo[i][2]*ufo[i][2];
					double D = B*B-4*A*C;
					if(D>=0){
						double t1 = (-B-Math.sqrt(D))/(2*A);
						double t2 = (-B+Math.sqrt(D))/(2*A);
						if(t1>=0||t2>=0)u[i] = true;
					}
				}
			}
			System.out.println(c);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1: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 <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
using namespace std;

const double EPS = 1e-9;
const double M_PI = 3.1415926535897932384626433832795;

class UFO{
public:
	double x;
	double y;
	int r;
	double vx;
	double vy;
	bool dead;
	bool invalid;
};

double dist_sq(UFO u){
	return (u.x*u.x+u.y*u.y);
}

double Cross(UFO a, UFO b){
	return a.x*b.y-b.x*a.y;
}

int main(){
	int R, N;
	while(cin >> R >> N, N){
		vector<UFO> ufo(N);

		for(int i = 0; i < N; i++){
			int v;
			cin >> ufo[i].x >> ufo[i].y >> ufo[i].r >> v;
			double theta = atan2(ufo[i].y, ufo[i].x)-M_PI;
			ufo[i].vx = v*cos(theta);
			ufo[i].vy = v*sin(theta);
		}

		while(true){
			double min = R*R;
			int target = -1;
			for(int i = 0; i < N; i++){
				if(!ufo[i].dead && !ufo[i].invalid){
					// 位置更新
					double p = ufo[i].x;
					ufo[i].x += ufo[i].vx;
					ufo[i].y += ufo[i].vy;
					if(p*ufo[i].x < 0 || min >= dist_sq(ufo[i])){
						ufo[i].invalid = true;
					}else{
						// ターゲット選定
						if(target == -1){
							target = i;
						}
						else if(dist_sq(ufo[i]) < dist_sq(ufo[target])){
							target = i;
						}
					}
				}
			}

			// 続行判定
			if(target == -1){
				break;
			}

			// レーザー判定
			ufo[target].dead = true;
			for(int i = 0; i < N; i++){
				if(!ufo[i].dead && !ufo[i].invalid){
					double cr = Cross(ufo[target], ufo[i]);
					if(cr*cr/dist_sq(ufo[target]) <= ufo[i].r*ufo[i].r){
						ufo[i].dead = true;
					}
				}
			}
			
		}

		int count = 0;
		for(int i = 0; i < N; i++){
			if(ufo[i].invalid){
				count++;
			}
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from a.cc:8:
a.cc:16:14: error: expected unqualified-id before numeric constant
   16 | const double M_PI = 3.1415926535897932384626433832795;
      |              ^~~~
Language: C++

from sys import stdin
from math import sqrt,fabs

class Game:
	class Ufo:
		def __init__(self,x,y,r,v):
			self.x = x*1.0
			self.y = y*1.0
			self.r = r*1.0
			self.v = v*1.0
			self.d = sqrt(x**2+y**2)
			self.cs = self.x / self.d
			self.si = self.y / self.d
			self.vx = -self.v*self.cs
			self.vy = -self.v*self.si

		def __str__(self):
			return "ufo x = " + str(self.x) + ", y = " + str(self.y) + ", r = " + str(self.r) + ", v = " + str(self.v)

		def oneMinMove(self):
			self.x += self.vx
			self.y += self.vy
			self.d -= self.v

	class Laser:
		def __init__(self,cs,si):
			self.cs = cs
			self.si = si

	ufos = []
	laser = Laser(0,0)
	gameend = False
	inrl = 0
	def __init__(self,R):
		self.R = R

	def hit(self,laser,ufo):
		temp1 = ufo.r**2 - (laser.si*ufo.x - laser.cs*ufo.y)**2
		if temp1 >= 0:
			temp2 = laser.cs*ufo.x + laser.si*ufo.y
			d1 = temp2 + sqrt(temp1)
			d2 = temp2 - sqrt(temp1)
			if d1>=0 or d2>=0: return True
			else: return False
		else: return False

	def isInvaded(self,ufo):
		return (ufo.d<= self.R)
	
	def gameOneMinMove(self):
		curInrs = []
		for ufo in self.ufos:
			ufo.oneMinMove()
			if self.isInvaded(ufo): curInrs.append(ufo)
		self.inrl += len(curInrs)
		#print str(len(curInrs)) + " ufos invaded!"
		for ufo in curInrs:
			self.ufos.remove(ufo)
			#print ufo
		del curInrs
		if self.ufos == []:
			self.gameend = True

	def setLaser(self):
		nearestUfo = self.ufos[0]
		for ufo in self.ufos:
			if nearestUfo.d > ufo.d :
				nearestUfo = ufo
		self.laser = self.Laser(nearestUfo.cs,nearestUfo.si)

	def fireLaser(self):
		curDeads = []
		for ufo in self.ufos:
			if self.hit(self.laser,ufo):
				curDeads.append(ufo)
		#print str(len(curDeads)) +" ufos burned!"
		for ufo in curDeads:
			self.ufos.remove(ufo)
			#print ufo
		del curDeads

	def oneLogic(self):
		self.gameOneMinMove()
		if self.gameend:
			pass
		else:
			self.setLaser()
			self.fireLaser()

	def allLogic(self):
		while not self.gameend:
			self.oneLogic()


for inp in stdin:
#for inp in open("input.txt"):
	inp = map(int,inp.split())
	if len(inp) == 2:
		if inp == (0,0): break
		game = Game(inp[0])
		N = inp[1]
	else:
		game.ufos.append(game.Ufo(inp[0],inp[1],inp[2],inp[3]))
		if len(game.ufos) == N:
			game.allLogic()
			print game.inrl

Compiler output:
a.cc:56:18: error: invalid preprocessing directive #print
   56 |                 #print str(len(curInrs)) + " ufos invaded!"
      |                  ^~~~~
a.cc:59:26: error: invalid preprocessing directive #print
   59 |                         #print ufo
      |                          ^~~~~
a.cc:76:18: error: invalid preprocessing directive #print
   76 |                 #print str(len(curDeads)) +" ufos burned!"
      |                  ^~~~~
a.cc:79:26: error: invalid preprocessing directive #print
   79 |                         #print ufo
      |                          ^~~~~
a.cc:96:2: error: invalid preprocessing directive #for
   96 | #for inp in open("input.txt"):
      |  ^~~
a.cc:1:1: error: 'from' does not name a type
    1 | from sys import stdin
      | ^~~~
Language: C++


#include<complex>
#include<vector>
#include<algorithm>
#include<cmath>

using namespace std;

template<class T> T sqr(T x){
  return x*x;
}

const double eps=1e-9;

int main(){
  for(int R,N;cin>>R>>N,R;){
    int x0[100],y0[100],r[100],v[100];
    vector<int> rem(N);
    for(int i=0;i<N;i++){
      cin>>x0[i]>>y0[i]>>r[i]>>v[i];
      rem[i]=i;
    }
    int ans=0;
    for(int i=1;;i++){
      auto d=[&](int x){
	return sqrt(sqr(x0[x])+sqr(y0[x]))-i*v[x];
      };
      auto it=remove_if(begin(rem),end(rem),[&](int x){
	  return d(x)<=R+eps;
	});
      ans+=end(rem)-it;
      rem.erase(it,end(rem));
      if(rem.empty())break;
      auto cl=min_element(begin(rem),end(rem),[&](int a,int b){
	  return d(a)<d(b);
	});
      rem.erase(remove_if(begin(rem),end(rem),[&](int x){
	    complex<double> rp=polar(d(x),atan2(y0[x],x0[x])-atan2(y0[*cl],x0[*cl]));
	    return rp.real()+r[x]>=eps&&(rp.imag()+r[x])*(rp.imag()-r[x])<=eps;
	  }),end(rem));
    }
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'cin' was not declared in this scope
   16 |   for(int R,N;cin>>R>>N,R;){
      |               ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<cmath>
  +++ |+#include <iostream>
    6 | 
a.cc:42:5: error: 'cout' was not declared in this scope
   42 |     cout<<ans<<endl;
      |     ^~~~
a.cc:42:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.*;

public class Main1 {
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		out: while (true) {
			int[] x;
			x = new int[5];
			for (int i = 0; i < 5; i++) {
				x[i] = s.nextInt();
				if (x[0] == 0)
					break out;
			}

			boolean[] j = { false, false, false };

			for (int i = 0; i < 5; i++) {
				j[x[i] - 1] = true;
			}

			if (j[0] && j[1] && j[2])
				for (int i = 0; i < 5; i++) {
					System.out.println("3");
				}

			if (j[0] && !j[1] && !j[2])
				for (int i = 0; i < 5; i++) {
					System.out.println("3");
				}

			if (!j[0] && !j[1] && j[2])
				for (int i = 0; i < 5; i++) {
					System.out.println("3");
				}

			if (!j[0] && j[1] && !j[2])
				for (int i = 0; i < 5; i++) {
					System.out.println("3");
				}

			if (!j[0] && j[1] && j[2])
				for (int i = 0; i < 5; i++) {
					if (x[i] == 2)
						System.out.println("1");
					else
						System.out.println("2");
				}

			if (j[0] && !j[1] && j[2])
				for (int i = 0; i < 5; i++) {
					if (x[i] == 3)
						System.out.println("1");
					else
						System.out.println("2");
				}

			if (j[0] && j[1] && !j[2])
				for (int i = 0; i < 5; i++) {
					if (x[i] == 1)
						System.out.println("1");
					else
						System.out.println("2");
				}

		}
	}
}

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

#include<stdio.h>

int main(void)
{
	int g = 0, c = 0, p = 0, n, i, a[5];
	while (scanf_s("%d", &n))
	{
		if (n == 0)
		{
			break;
		}
		a[0] = n;
		if (n == 1)
		{
			g++;
		}
		if (n == 2)
		{
			c++;
		}
		if (n == 3)
		{
			p++;
		}
		for (i = 1;i < 5;i++)
		{
			scanf_s("%d", &n);
			a[i] = n;
			if (n == 1)
			{
				g++;
			}
			if (n == 2)
			{
				c++;
			}
			if (n == 3)
			{
				p++;
			}
		}

		if (g == 5 || c == 5 || p == 5)
		{
			for (i = 0;i < 5;i++)
			{
				a[i] = 3;
				printf("%d\n",a[i]);
			}
		}
		else if(g == 0 || c == 0 || p == 0)
		{
			if (g > 0 && c > 0)
			{
				for (i = 0;i < 5;i++)
				{
					printf("%d\n", a[i]);
				}
			}
			else if (c > 0 && p > 0)
			{
				for (i = 0;i < 5;i++)
				{
					if (a[i] == 2)
					{
						printf("1\n");
					}
					else
					{
						printf("2\n");
					}
				}
			}
			else if (p > 0 && g > 0)
			{
				for (i = 0;i < 5;i++)
				{
					if (a[1] == 3)
					{
						printf("1\n");
					}
					else
					{
						printf("2\n");
					}
				}
			}
		}
		else
		{
			for (i = 0;i < 5;i++)
			{
				a[i] = 3;
				printf("%d\n", a[i]);
			}
		}
		g = 0;c = 0;p = 0;
	}
}

Compiler output:
main.c: In function 'main':
main.c:6:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         while (scanf_s("%d", &n))
      |                ^~~~~~~
      |                scanf
Language: C

#include<stdio.h>
	int main(){
		int a[5],g,c,p,i;
		while(scanf("%d",&a[0]),a[0]){
			g=0;
			c=0;
			p=0;
			if(a[0]==1)
				g++;
			else if(a[0]==2)
				c++;
			else if(a[0]==3)
				p++;
			for(i=1;i<5;i++){
				scanf("%d",&a[i]);
				if(a[i]==1)
				g++;
			else if(a[i]==2)
				c++;
			else if(a[i]==3)
				p++;
			}
			if(g>0&&c>0&&p>0)
				for(i=0;i<5;i++)
				printf("3\n");
			else if(g==5||c==5||p==5)
				for(i=0;i<5;i++)
				printf("3\n");
			else if(g>0&&c>0)
				for(i=0;i<5;i++){
					if(a[i]==1)
						printf("1\n");
					else printf("2\n");
			}
			else if(g>0&&p>0)
				for(i=0;i<5;i++){
					if(a[i]==1)
						printf("2\n");
					else printf("1\n");
			}
			else for(i=0;i<5;i++){
				if(a[i]==2)
					printf("1\n");
				else printf("2\n");
			}
		}

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

#include<stdio.h>
int main(){
    int a[500]={0},i,kaisuu,k;
    int flg1,flg2,flg3,l;
    int j,cnt=0;
        cnt=0;
        a[500]={0};
        kaisuu=0;
    for(i=1;i<500;i++){
        scanf("%d",&a[i]);
        if(a[i]==0)break;
        cnt++;
    }
    kaisuu=cnt/5;
    for(i=0;i<kaisuu;i++){
        for(l=i*5+1;l<i*5+6;l++){
        if(a[l]==1)flg1=1;
        if(a[l]==2)flg2=1;
        if(a[l]==3)flg3=1;
        }
        if(flg1==1&&flg2==1&&flg3==1){
            for(j=1;j<6;j++){
                printf("3\n");
            }
            goto end;
        }
        if(flg1==1&&flg2==1){
            for(j=1;j<6;j++){
                if(a[i*5+j]==1)printf("1\n");
                else if(a[i*5+j]==2)printf("2\n");
                //printf("gu-");
            }
            goto end;
        }
        if(flg2==1&&flg3==1){
            for(j=1;j<6;j++){
                if(a[i*5+j]==2)printf("1\n");
                else if(a[i*5+j]==3)printf("2\n");
                //printf("pa-");
            }
            goto end;
        }
        if(flg1==1&&flg3==1){
            for(j=1;j<6;j++){
                if(a[i*5+j]==1)printf("2\n");
                else if(a[i*5+j]==3)printf("1\n");
                //printf("a-");
            }
            goto end;
        }
        end:
    flg1=0;
    flg2=0;
    flg3=0;
    }
    //printf("kaisuu = %d",kaisuu);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:16: error: expected expression before '{' token
    7 |         a[500]={0};
      |                ^
Language: C

#include<stdio.h>
int main(){
	while(1){
		int i,a,b,c,d,e,A,B,C,D,E,x[5]={},X,Y,Z,p;
		scanf("%d",&a);
		if(a==0){
			break;
		}
		scanf("%d",&b);
		scanf("%d",&c);
		scanf("%d",&d);
		scanf("%d",&e);
		x[0]=a;
		x[1]=b;
		x[2]=c;
		x[3]=d;
		x[4]=e;
		X=a;
		for(i=0;i<5;i++){
			if(X!=x[i]){
				if(Y!=x[i]&&Y==0){
					Y=x[i];
				}
				else if(Y!=x[i]){
					Z=x[i];
					p=1;
				}
			}
		}
		if(p==1){
			A=3;
			B=3;
			C=3;
			D=3;
			E=3;
		}
		else {
			if(a<b && b!=3){
				A=1;
				B=2;
				if(a==c)
				C=1;
				else
				C=2;
				if(a==d)
				D=1;
				else
				D=2;
				if(a==e)
				E=1;
				else 
				E=2;
			}
			else if(a<b){
				B=1;
				A=2;
				if(a==c)
				C=2;
				else
				C=1;
				if(a==d)
				D=2;
				else
				D=1;
				if(a==e)
				E=2;
				else 
				E=1;
			}
		}
		printf("%d\n%d\n%d\n%d\n%d\n",A,B,C,D,E);
return 0;
}

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

#include<iostream>
int main(){
	int a[5];
	bool r,s,p;
	bool as,bs,cs,ds;
	while(1){
		for(int i=0;i<5;i++){
			std::cin>>a[i];
			if(a[i]==1)
				r=true;
			else if(a[i]==2)
				s=true;
			else
				p=true;
		}
		if(r==true && s==true && p==true)ds==true;
		if(r==true && s==true){
			as==true;
			bs==false;
		}
		if(r==true && p==true){
			cs==true;
			as==false;
		}
		 if(p==true && s==true){
			bs==true;
			cs==false;
		}
		for(int i=0;i<5;i++){
			if(ds==true)
				std::cout<<3<<std::endl;
			if(as==true || bs==true || cs==true)
				std::cout<<1<<std::endl;
			if(as==false || bs==false || cs==false)
				std::cout<<2<<std::endl;
		}
	return 0;
}

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

#include<iostream>
using namespace std;

int main(){
   int X[5];

   while(1){
	int con1=0,con2=0,con3=0;
	
	cin >> X[0];
	if(X[0] == 0) break;

	for(int i=1;i<5;i++){
		cin >> X[i];
	}

	for(int i=0;i<5;i++){
		if(X[i] == 1) con1++;
		if(X[i] == 2) con2++;
		if(X[i] == 3) con3++;
	}

	if(((con1 != 0)&&(con2 != 0)&&(con3 != 0))||((con1 == 0)&&(con2 == 0))||((con2 == 0)&&(con3 == 0))||((con1 == 0)&&(con3 == 0))||){
		for(int i=0; i<5; i++){
			cout << "3" << "\n";
		}

	}else if(con1 == 0){
		for(int i=0; i<5; i++){
			if(X[i] == 2) {
				cout << "1";
			}else{
				cout << "2";
			}

			cout << endl;
		}
	}else if(con2 == 0){
		for(int i=0; i<5; i++){
			if(X[i] == 3) {
				cout << "1";
			}else{
				cout << "2";
			}

			cout << endl;
		}
	}else if(con3 == 0){
		for(int i=0; i<5; i++){
			if(X[i] == 1) {
				cout << "1";
			}else{
				cout << "2";
			}

			cout << endl;
		}
	}
   }

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:137: error: expected primary-expression before ')' token
   23 |         if(((con1 != 0)&&(con2 != 0)&&(con3 != 0))||((con1 == 0)&&(con2 == 0))||((con2 == 0)&&(con3 == 0))||((con1 == 0)&&(con3 == 0))||){
      |                                                                                                                                         ^
Language: C++

#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int c[5];
    while(cin >> c[0], c[0]){
        range(i,1,5)
            cin >> c[i];
        bool rock, paper, scissors;
        rock = paper = scissors = false;
        rep(i,5){
            if(c[i] == 1){
                rock = true;
            }else if(c[i] == 2){
                scissors = true;
            }else{
                paper = true;
            }
        }
        int r, p ,s;
        if(rock && paper && scissors){
            r = p = s = 3;
        }else if(rock && paper && !scissors){
            p = 1;
            r = 2;
        }else if(rock && scissors && !paper){
            r = 1;
            s = 2;
        }else if(paper && scissors && !rock){
            s = 1;
            p = 2;
        }else if(rock){
            r = 3;
        }else if(paper){
            p  3;
        }else if(scissors){
            s = 3;
        }
        rep(i,5){
            if(c[i] == 1)
                cout << r << endl;
            else if(c[i] == 2)
                cout << s << endl;
            else if(c[i] == 3)
                cout << p << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:14: error: expected ';' before numeric constant
   47 |             p  3;
      |              ^ ~
      |              ;
Language: C++

type hand = Rock | Paper | Scissors
 
type result = Win | Lose | Draw
 
module HandSet = Set.Make (
                     struct
                       type t = hand
                       let compare (a : hand) b = compare a b
                     end)
 
let hand_of_int = function
  | 1 -> Some Rock
  | 2 -> Some Scissors
  | 3 -> Some Paper
  | _ -> None
 
let int_of_result = function
  | Win -> 1
  | Lose -> 2
  | Draw -> 3
 
exception BreakLoop
 
let read_hands () =
  try
    let hands = Array.init
                  5
                  (fun _ -> match read_int () |> hand_of_int with
                            | None -> raise BreakLoop
                            | Some hand -> hand) in
    Some (Array.to_list hands)
  with BreakLoop -> None
 
let match_ hands =
  let set = HandSet.of_list hands in
  if HandSet.cardinal set <> 2 then Array.make 5 Draw |> Array.to_list
  else
    let defeats a b =
      match a, b with
      | Rock, Paper -> false
      | Rock, Scissors -> true
      | Paper, Rock -> true
      | Paper, Scissors -> false
      | Scissors, Rock -> false
      | Scissors, Paper -> true
      | _ -> invalid_arg "defeats" in
    List.map
      (fun hand ->
       let match_ = HandSet.remove hand set |> HandSet.choose in
       if defeats hand match_ then Win else Lose)
      hands
 
let rec solve () =
  match read_hands () with
  | None -> ()
  | Some hands ->
     let results = match_ hands in
     List.iter
       (fun result ->
        int_of_result result |> print_int;
        print_newline ())
       results;
     solve ()
 
let () = solve ()

Compiler output:
a.cc:1:1: error: 'type' does not name a type; did you mean 'typeof'?
    1 | type hand = Rock | Paper | Scissors
      | ^~~~
      | typeof
a.cc:61:25: error: expected constructor, destructor, or type conversion before ')' token
   61 |         print_newline ())
      |                         ^
a.cc:65:1: error: expected constructor, destructor, or type conversion before 'let'
   65 | let () = solve ()
      | ^~~
Language: C++

#include<iostream>
using namespace std;
 
int main(){
 
  int h[5];
  int f[4];
 
  while(1){
    for(int i=0;i<4;i++) f[i]=0;
    for(int i=0;i<5;i++){
      cin>>h[i];
      if(h[i]==0) break;
      f[h[i]]=1;
    }
    if(h[0]==0) break;
 
    int x[2], cnt=0;
    for(int i=1;i<4;i++){
      if(f[i]==1)
    x[cnt++]=i;
      //cout<<i<<" "<<f[i]<<endl;
    }
    //cout<<"    "<<cnt<<" "<<x<<endl;
    if(cnt==2){
      if(x[0]==1&&x[1]==2){
    for(int i=0;i<5;i++){
      if(h[i]==1) cout<<1<<endl;
      else cout<<2<<endl;
    }
      }
      if(x[0]==1&&x[1]==3){
    for(int i=0;i<5;i++){
      if(h[i]==1) cout<<2<<endl;
      else cout<<1<<endl;
    }
      }
      if(x[0]==2&&x[1]==3){
    for(int i=0;i<5;i++){
      if(h[i]==2) cout<<1<<endl;
      else cout<<2<<endl;
    }
      }
    }else{
      for(int i=0;i<5;i++) cout<<3<<endl;
    }
  }
   
  return 0;

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

i,f,d[5],*p;main(n){for(;i>4||scanf("%d",p=d+i)**d;i=++i%10,f*=!!i)n=((f^f/2^f/4)&1?2:!(d[i%5]*2&f))+49,i<5?f|=(*p=9<<*p-1):puts(&n);}

Compiler output:
a.cc:1:1: error: 'i' does not name a type
    1 | i,f,d[5],*p;main(n){for(;i>4||scanf("%d",p=d+i)**d;i=++i%10,f*=!!i)n=((f^f/2^f/4)&1?2:!(d[i%5]*2&f))+49,i<5?f|=(*p=9<<*p-1):puts(&n);}
      | ^
a.cc:1:17: error: expected constructor, destructor, or type conversion before '(' token
    1 | i,f,d[5],*p;main(n){for(;i>4||scanf("%d",p=d+i)**d;i=++i%10,f*=!!i)n=((f^f/2^f/4)&1?2:!(d[i%5]*2&f))+49,i<5?f|=(*p=9<<*p-1):puts(&n);}
      |                 ^