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

#include <stdio.h>

typedef struct {
	double data[2];
} D_SET;

int main(void)
{
	D_SET d[4];
	int i, j;
	int no;
	double hj[2][2];
	double hj_count;
	int flag;
	
	scanf("%d", &no);
	
	while (no > 0){
		hj_count = 0;
		flag = 0;
		for (i = 0; i < 4; i++){
			for (j = 0; j < 2; j++){
				scanf("%f", &d[i].data[j]);
			}
			if ((i + 2) % 2 == 1){
				for (j = 0; j < 2; j++){
					hj[hj_count][j] = d[i - 1].data[j] - d[i].data[j];
				}
				hj_count++;
			}
		}
		if (hj[0][0] == hj[1][0] && hj[0][1] == hj[1][1]){
			flag = 1;
		}
		
		if (flag == 1){
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
		no--;
	}
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:27:43: error: array subscript is not an integer
   27 |                                         hj[hj_count][j] = d[i - 1].data[j] - d[i].data[j];
      |                                           ^
Language: C

#include<stdio.h>

int main()
{
	float x1,y1,x2,y2,x3,y3,x4,y4
	int flg;
	int datanum,i;
	scanf("%d",&datanum);
	for(i=0;i<datanum;i++)
	{
		flg=0;
		scanf("%f %f %f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
		if((y2-y1)/(x2-x1)==(y4-y3)/(x4-x3))
		{
			flg=1;
		}
		if(flg)
		{
			puts("YES");
		}
		else
		{
			puts("NO");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    6 |         int flg;
      |         ^~~
main.c:11:17: error: 'flg' undeclared (first use in this function)
   11 |                 flg=0;
      |                 ^~~
main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:78: error: 'y4' undeclared (first use in this function); did you mean 'x4'?
   12 |                 scanf("%f %f %f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
      |                                                                              ^~
      |                                                                              x4
Language: C

#include <iostream>
int main(){int n,i,j;double x[4],y[4];std::cin>>n;for(i=0;i<n;i++){for(j=0;j<4;j++)std::cin>>x[j]>>y[j];if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))std::cout<<"YES\n";else std::cout<<"NO\n";}}

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

import java.util.*;
public class Main {
	public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while(n--!=0){
            double[] a=new double[8];
            for(int i=0;i<8;i++)a[i]=sc.nextDouble();
            double e=(a[2]-a[0])*(a[7]-a[5])-(a[3]-a[1])*(a[6]-a[4]);
            System.out.println(e==0?"YES":"NO");
        }
    }
}
//by Tuvshee 12.05.2012
//Parallelism

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:2:1: error: unknown type name 'public'
    2 | public class Main {
      | ^~~~~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    2 | public class Main {
      |              ^~~~
Language: C

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args)
			throws java.io.IOException{
		Scanner scan = new Scanner(System.in);
		int n  = scan.nextInt();
		for(int i=0;i<n;i++){
			//scan.nextLine();
			float x1,y1,x2,y2,x3,y3,x4,y4;
			x1= scan.nextFloat();
			y1= scan.nextFloat();
			x2= scan.nextFloat();
			y2= scan.nextFloat();
			x3= scan.nextFloat();
			y3= scan.nextFloat();
			x4= scan.nextFloat();
			y4= scan.nextFloat();
			if((y2-y1)/(x2-x1)==(y4-y3)/(x4-x3)) System.out.println("YES");
			else System.out.println("NO");
		}
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.*;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.*;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

#include<stdio.h>

int main(){

	int i,n,flagX[2],flagY[2];
	double x[4],y[4],a[2];

	scanf("%d",&n);

	for(i=0;i<n;i++){
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]);
		flagY[0]=0;
		flagX[0]=0;
		flagY[1]=0;
		flagX[1]=0;
		a[0]=0;
		a[1]=0;

		if(x[0]-x[1]==0){
			flagY[0]=1;
			a[0]=NULL;
		}
		else if(y[0]-y[1]==0){
			flagX[0]=1;
			a[0]=NULL;
		}
		else{
			a[0]=(y[0]-y[1])/(x[0]-x[1]);
		}

		if(x[2]-x[3]==0){
			flagY[1]=1;
			a[1]=NULL;
		}
		else if(y[2]-y[3]==0){
			flagX[1]=1;
			a[1]=NULL;
		}
		else{
			a[1]=(y[2]-y[3])/(x[2]-x[3]);
		}

		if((flagX[0]==1 && flagX[1]==1) || (flagY[0]==1 && flagY[1]==1) || (a[0]==a[1])){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}


	return 0;
}

Compiler output:
In file included from /usr/include/stdio.h:34,
                 from main.c:1:
main.c: In function 'main':
main.c:21:30: error: incompatible types when assigning to type 'double' from type 'void *'
   21 |                         a[0]=NULL;
      |                              ^~~~
main.c:25:30: error: incompatible types when assigning to type 'double' from type 'void *'
   25 |                         a[0]=NULL;
      |                              ^~~~
main.c:33:30: error: incompatible types when assigning to type 'double' from type 'void *'
   33 |                         a[1]=NULL;
      |                              ^~~~
main.c:37:30: error: incompatible types when assigning to type 'double' from type 'void *'
   37 |                         a[1]=NULL;
      |                              ^~~~
Language: C

#include<stdio.h>
main(){
	double x[100],y[100];
	double a,b,c,d;
	int n,j;
	scanf("%d",&n);
	for(j=0;j<n;j++){
		scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x[j],&y[j],&x[j+1],&y[j+1],&x[j+2],&y[j+2],&x[j+3],&y[j+3]);
		a=x[j]-x[j+1];
		b=y[j]-y[j+1];
		c=x[j+2]-x[j+3];
		d=y[j+2]-y[j+3];
		if((a*d-b*c)==0){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:19:9: error: expected declaration or statement at end of input
   19 |         return 0;
      |         ^~~~~~
Language: C

#include <stdio.h>

void swap(double *x,double *y){
	double t;
	t=*x;*x=*y;*y=t;
}

int main()
{
	double x1,y1,x2,y2,x3,y3,x4,y4;
	int n,i;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,%x4,&y4);
		if(x1<x2) swap(&x1,&x2);
		if(y1<y2) swap(&y1,&y2);
		if(x3<x4) swap(&x3,&x4);
		if(y3<y4) swap(&y3,&y4);
		if((y1-y2)/(x1-x2)==(y3-y4)/(x3-x4)) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:81: error: expected expression before '%' token
   15 |                 scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,%x4,&y4);
      |                                                                                 ^
Language: C

#include<stdio.h>
int main(void){
    int i,n;
    double x[4],y[4],ab,cd;
    for("%d",&n);
    for(i=0; i<n; i++){
        scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]);
        ab=(y[0]-y[1])/(x[0]-x[1]);
        cd=(y[2]-y[3])/(x[2]-x[3]);
        if(ab<0){
            ab*=-1;
        }
        if(cd<0){
            cd*=-1;
        }
        if(ab==cd){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:16: error: expected ';' before ')' token
    5 |     for("%d",&n);
      |                ^
      |                ;
main.c:5:16: error: expected expression before ')' token
Language: C

#include<stdio.h>
int main(){
	int n,i;
	double a,b,x1,y1,x2,y2,x3,y3,x4,y4;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
	a = (y2 - y1)/(x2 - x1);
	b = (y4 - y3)/(x4 - x3);
	if(a==b) printr("YES\n");
	else printf("NO\n");
	}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:18: error: implicit declaration of function 'printr'; did you mean 'printf'? [-Wimplicit-function-declaration]
   10 |         if(a==b) printr("YES\n");
      |                  ^~~~~~
      |                  printf
Language: C

#include<stdio.h>
int main(void){
    double x1,x2,x3,x4,y1,y2,y3,y4;
    double a,b;
    int n,i;
 
    scanf("%d",&n);
    for(i = 0; i < n; i++){
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
        a = (y2 - y1)/(x2 - x1);
        b = (y4 - y3)/(x4 - x3);
        if(a == b)｛
printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:19: error: '\U0000ff5b' undeclared (first use in this function)
   12 |         if(a == b)｛
      |                   ^~
main.c:12:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:21: error: expected ';' before 'printf'
   12 |         if(a == b)｛
      |                     ^
      |                     ;
   13 | printf("YES\n");
      | ~~~~~~
Language: C

#include<stdio.h>
int main(void){
    double x1,x2,x3,x4,y1,y2,y3,y4;
    double a,b;
    int i, n;
 
    scanf("%d",&n);

    for(i = 0; i < n; i++){
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);

        a = (y2 - y1) / (x2 - x1);
        b = (y4 - y3) / (x4 - x3);
        if(a == b){
            printf("YES\n");
        }else {
printf("NO\n");
    }
    return 0;
}

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

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


int main(void)
{
  double a[4][2],i;
  for(i=0;i<4;i++)
    scanf("%lf %lf",&a[i][0],&a[i][1]);

  if(a[0][0]==a[1][0] && a[2][0]==a[3][0])
    printf("YES\n");
  else if( (a[1][1]-a[0][1])/(a[1][0]-a[0][0])==(a[3][1]-a[2][1])/(a[3][0]-a[2][0])   )
    printf("YES\n");
  else
    printf("NO\n");

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:23: error: array subscript is not an integer
   10 |     scanf("%lf %lf",&a[i][0],&a[i][1]);
      |                       ^
main.c:10:32: error: array subscript is not an integer
   10 |     scanf("%lf %lf",&a[i][0],&a[i][1]);
      |                                ^
Language: C

include<stdio.h>
int main(void){
    int i,j,n;
    double x[4],y[4];
	scanf("%d", &n);
	for (i = 0; i < n; i++){
		for (j = 0; j < 4; j++){
			scanf("%lf%lf", &x[j], &y[j]);
		}
		if ((y[0] - y[1]) / (x[0] - x[1])
			== (y[2] - y[3]) / (x[2] - x[3])){
			printf("YES");
		}
		else{
			printf("NO");
		}
	}
    return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include <stdio.h>

int main(void) {
	double x1,x2,x3,x4,y1,y2,y3,y4;
	int n;
	
	scanf("%d", &n);
	
	for(int i=0; i<n; i++) {
	
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4) 
			
			if(x1==x2 || x3) {
				if(x3==x4) printf("YES\n");
				else printf("NO\n");
			}
			else {
				if( (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3) ) printf("YES\n");
				else printf("NO\n");	
			}
			
		
	}
	
	return 0;
}
		 

Compiler output:
main.c: In function 'main':
main.c:11:97: error: expected ';' before 'if'
   11 |                 scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)
      |                                                                                                 ^
      |                                                                                                 ;
   12 | 
   13 |                         if(x1==x2 || x3) {
      |                         ~~
Language: C

include <stdio.h>
  int main(){
int n;
scanf("%d",&n);
while(n--){
     double x1,x2,x3,x4,y1,y2,y3,y4;
     scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
     if((x1-x2)==0 && (x3-x4)==0){
printf("YES\n");
continue;
}
if((x1-x2)==0){
printf("NO\n");
continue;
}
if((x3-x4)==0){
printf("NO\n");
continue;
}
double ab=(y1-y2)/(x1-x2);
double cd=(y3-y4)/(x3-x4);
if(ab==cd){
printf("YES\n");
}else{
printf("NO\n");
}
continue;
}
return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include <cstdio>

int main()
{
	int n;
	scanf("%d\n", &n);
	for(int i = 0; i < n; i++){
		double x1, y1, x2, y2, x3, y3, x4, y4;
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
		puts(((y1 - y2) / (x1 - x2)) == ((y3 - y4) / (x3 - x4)) ? "YES" : "NO");
	}
	return 0;
}

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

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

typedef complex<double> P;

// 許容する誤差ε
#define EPS (1e-10)
// 2つのスカラーが等しいかどうか
#define EQ(a,b) (abs((a)-(b)) < EPS)

// 外積 (cross product) : a×b = |a||b|sinΘ
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}

// 2直線の平行判定 : a//b <=> cross(a, b) = 0
int is_parallel(P a1, P a2, P b1, P b2) {
  return EQ( cross(a1-a2, b1-b2), 0.0 );
}

int main(){
	int n;
	double x1,x2,x3,x4,y1,y2,y3,y4;

	cin >> n;
	for(int i=0 ; i<n ; i++){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		P a(x1,y1), b(x2,y2), c(x3,y3), d(x4,y4);
		if( is_parallel(a,b,c,d) ){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
}

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

#include<iostream>
using namespace std;

int judge(double a1,double a2,double b1,double b2,double c1,double c2,double d1,double d2);

int main(){
	int n;
	double a1,a2,b1,b2;
	double c1,c2,d1,d2;
	
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2;
		if(judge(a1,a2,b1,b2,c1,c2,d1,d2))
			cout<<"YES"<<endl; 
		else
			cout<<"NO"<<endl;
	}

}


int judge(double a1,double a2,double b1,double b2,double c1,double c2,double d1,double d2){
	double aa,bb;
	aa=(b2-a2)/(b1-a1);
	bb=(d2-c2)/(d1-c1);
//	cout<<aa<<" "<<bb<<endl;
	if(aa==bb)return 1; else return 0;
}

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

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

int main(void){
    int n;
    cin >> n;
    rep(i,n) {

    double x[4],y[4],a,b,c,d,p,q,det,ansx,ansy;
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        scanf("%lf" ,&x[i]);
        scanf("%lf" ,&y[i]);
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    p = x[1]*y[0]-x[0]*y[1];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    q = x[3]*y[2]-x[2]*y[3];
    //係数についての行列式
    det = a*d-c*b;
    //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
    if(fabs(det) < 0.00001) puts("YES");
    //逆行列を用いて解を導出
    else {
        /*
        ansx = (d*p - b*q)/det;
        ansy = (-c*p + a*q)/det;
        //ansxがどちらの線分のx座標範囲にも含まれるかを判定
        if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[2] - ansx)*(x[3] - ansx) <= 0.00001 ) {
            printf("YES (%lf, %lf)\n",ansx,ansy);
        } else puts("NO");
        */
       puts("NO");
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |     cin >> n;
      |     ^~~
      |     sin
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i,n) {
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
    7 |     rep(i,n) {
      |     ^~~
      |     frexp
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

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

int main(void){
    int n;
    cin >> n;
    rep(i,n) {

    double x[4],y[4],a,b,c,d,p,q,det,ansx,ansy;
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        scanf("%lf" ,&x[i]);
        scanf("%lf" ,&y[i]);
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    p = x[1]*y[0]-x[0]*y[1];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    q = x[3]*y[2]-x[2]*y[3];
    //係数についての行列式
    det = a*d-c*b;
    if(a*d == b*c) puts("YES");
    else puts("NO");
    /*
    //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
    if(fabs(det) < 0.00001) puts("YES");
    //逆行列を用いて解を導出
    else {
        /*
        ansx = (d*p - b*q)/det;
        ansy = (-c*p + a*q)/det;
        //ansxがどちらの線分のx座標範囲にも含まれるかを判定
        if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[2] - ansx)*(x[3] - ansx) <= 0.00001 ) {
            printf("YES (%lf, %lf)\n",ansx,ansy);
        } else puts("NO");
        
       puts("NO");
    }
    */
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |     cin >> n;
      |     ^~~
      |     sin
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i,n) {
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
    7 |     rep(i,n) {
      |     ^~~
      |     frexp
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

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

int main(void){
    int n;
    cin >> n;
    rep(i,n) {

    double x[4],y[4],a,b,c,d,p,q,det,ansx,ansy;
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        scanf("%lf" ,&x[i]);
        scanf("%lf" ,&y[i]);
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    p = x[1]*y[0]-x[0]*y[1];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    q = x[3]*y[2]-x[2]*y[3];
    //係数についての行列式
    det = a*d-c*b;
    if(a*d == b*c) puts("YES");
    else puts("NO");
    /*
    //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
    if(fabs(det) < 0.00001) puts("YES");
    //逆行列を用いて解を導出
    else {
        /*
        ansx = (d*p - b*q)/det;
        ansy = (-c*p + a*q)/det;
        //ansxがどちらの線分のx座標範囲にも含まれるかを判定
        if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[2] - ansx)*(x[3] - ansx) <= 0.00001 ) {
            printf("YES (%lf, %lf)\n",ansx,ansy);
        } else puts("NO");
        
       puts("NO");
    }
    */
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |     cin >> n;
      |     ^~~
      |     sin
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i,n) {
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
    7 |     rep(i,n) {
      |     ^~~
      |     frexp
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

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

int main(void){
    int n;
    cin >> n;
    rep(i,n) {

    double x[4],y[4],a,b,c,d,p,q,det,ansx,ansy;
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        scanf("%lf" ,&x[i]);
        scanf("%lf" ,&y[i]);
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    p = x[1]*y[0]-x[0]*y[1];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    q = x[3]*y[2]-x[2]*y[3];
    //係数についての行列式
    det = a*d-c*b;
    if(det == 0) puts("YES");
    else puts("NO");
    /*
    //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
    if(fabs(det) < 0.00001) puts("YES");
    //逆行列を用いて解を導出
    else {
        /*
        ansx = (d*p - b*q)/det;
        ansy = (-c*p + a*q)/det;
        //ansxがどちらの線分のx座標範囲にも含まれるかを判定
        if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[2] - ansx)*(x[3] - ansx) <= 0.00001 ) {
            printf("YES (%lf, %lf)\n",ansx,ansy);
        } else puts("NO");
        
       puts("NO");
    }
    */
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |     cin >> n;
      |     ^~~
      |     sin
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i,n) {
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
    7 |     rep(i,n) {
      |     ^~~
      |     frexp
Language: C++

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

int main(void){
    int n;
    cin >> n;
    for(int i=0,i<n,i++) {

    double x[4],y[4],a,b,c,d,p,q,det,ansx,ansy;
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        scanf("%lf" ,&x[i]);
        scanf("%lf" ,&y[i]);
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    //係数についての行列式
    det = a*d-c*b;
    if(det == 0) puts("YES");
    else puts("NO");
    /*
    //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
    if(fabs(det) < 0.00001) puts("YES");
    //逆行列を用いて解を導出
    else {
        /*
        ansx = (d*p - b*q)/det;
        ansy = (-c*p + a*q)/det;
        //ansxがどちらの線分のx座標範囲にも含まれるかを判定
        if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[2] - ansx)*(x[3] - ansx) <= 0.00001 ) {
            printf("YES (%lf, %lf)\n",ansx,ansy);
        } else puts("NO");
        
       puts("NO");
    }
    */
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |     cin >> n;
      |     ^~~
      |     sin
a.cc:7:18: error: expected ';' before '<' token
    7 |     for(int i=0,i<n,i++) {
      |                  ^
      |                  ;
a.cc:7:18: error: expected primary-expression before '<' token
a.cc:7:24: error: expected ';' before ')' token
    7 |     for(int i=0,i<n,i++) {
      |                        ^
      |                        ;
Language: C++

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

int main(void){
    int n;
    cin >> n;
    rep(itn j = 0,j< n,j++) {

    double x[4],y[4],a,b,c,d,p,q,det,ansx,ansy;
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        scanf("%lf" ,&x[i]);
        scanf("%lf" ,&y[i]);
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    p = x[1]*y[0]-x[0]*y[1];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    q = x[3]*y[2]-x[2]*y[3];
    //係数についての行列式
    det = a*d-c*b;
    if(det == 0) puts("YES");
    else puts("NO");
    /*
    //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
    if(fabs(det) < 0.00001) puts("YES");
    //逆行列を用いて解を導出
    else {
        /*
        ansx = (d*p - b*q)/det;
        ansy = (-c*p + a*q)/det;
        //ansxがどちらの線分のx座標範囲にも含まれるかを判定
        if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[2] - ansx)*(x[3] - ansx) <= 0.00001 ) {
            printf("YES (%lf, %lf)\n",ansx,ansy);
        } else puts("NO");
        
       puts("NO");
    }
    */
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |     cin >> n;
      |     ^~~
      |     sin
a.cc:7:9: error: 'itn' was not declared in this scope; did you mean 'int'?
    7 |     rep(itn j = 0,j< n,j++) {
      |         ^~~
      |         int
a.cc:7:19: error: 'j' was not declared in this scope
    7 |     rep(itn j = 0,j< n,j++) {
      |                   ^
a.cc:7:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
    7 |     rep(itn j = 0,j< n,j++) {
      |     ^~~
      |     frexp
Language: C++


#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
using namespace std;

int main(void){
    int n;
    double x[4],y[4],a,b,c,d,det;
    cin >> n;
    rep(j,n) {

    
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        cin >> x[i];
        cin >> y[i];
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    //係数についての行列式
    det = a*d-c*b;
    if(fabs(det) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;
    }
}
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
using namespace std;

int main(void){
    int n;
    double x[4],y[4],a,b,c,d,det;
    cin >> n;
    rep(j,n) {

    
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        cin >> x[i];
        cin >> y[i];
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    //係数についての行列式
    det = a*d-c*b;
    if(absf(det) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;
    }
}


Compiler output:
a.cc:43:5: error: redefinition of 'int main()'
   43 | int main(void){
      |     ^~~~
a.cc:18:5: note: 'int main()' previously defined here
   18 | int main(void){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:61:8: error: 'absf' was not declared in this scope; did you mean 'fabsf'?
   61 |     if(absf(det) < 0.00001) cout << "YES" << endl;
      |        ^~~~
      |        fabsf
Language: C++

import sys

# args = sys.argv

args = [int(float(a)) for line in sys.stdin]


class Point():
  def __init__(self,x,y):
      self.x = x
      self.y = y

  def __sub__(self,oth):
    self.x = self.x - oth.x
    self.y = self.y - oth.y
    return Point(self.x,self.y)

  def __str__(self):
    return "%s(%r)" %(self.__class__,self.__dict__)

for _ in range(args[0]):
  if _ == 0:
    pass
  else:
    A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
    tmp = B - A
    tmp2 = C - D
    tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
    if int(tmp3) == 0:
      print("YES")
    else:
      print("NO")




Compiler output:
a.cc:3:3: error: invalid preprocessing directive #args
    3 | # args = sys.argv
      |   ^~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main(){
	int n;
	cin >> n;
	long double x1,y1,x2,y2,x3,y3,x4,y4;
	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4){
		if(abs((y1 - y2)/(x1 - x2) -- (x3 - x4)/(y3 - y4)) < 0.0000000001)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:38: error: lvalue required as decrement operand
   13 |                 if(abs((y1 - y2)/(x1 - x2) -- (x3 - x4)/(y3 - y4)) < 0.0000000001)cout << "YES" << endl;
      |                                  ~~~~^~~~~
Language: C++

#include<iostream>
using namespace std;

int main() {
    double n,xx[4],yy[4],x,y;
    cin >> n;
    for(int i=0;i<n;i++){
        for(int j=0;j<4;j++) cin>>xx[j]>>yy[j];
        x=(yy[1]-yy[0])/(xx[1]-xx[0]),y=(yy[3]-yy[2])/(xx[3]-xx[2]);
        if(x==y)cout << "YES";
        else cout << "NO";
        cout << endl;
    }
}
}

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

#include<iostream>
using namespace std;

int main() {
    double n,xx[4],yy[4],x,y;
    cin >> n;
    for(int i=0;i<n;i++){
        for(int j=0;j<4;j++) cin>>xx[j]>>yy[j];
        x=(yy[1]-yy[0])/(xx[1]-xx[0]);
        y=(yy[3]-yy[2])/(xx[3]-xx[2]);
        if(x==y)cout << "YES";
        else cout << "NO";
        cout << endl;
    }
}
}

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

#include<iostream>
#include<cmath>
using namespace std;
#define EPS 1e-10
double x[4],y[4];
double det(){
  double x1,x2,y1,y2;
  x1 = x[0] - x[1];
  y1 = y[0] - y[1];
  x2 = x[2] - x[3];
  y2 = y[2] - y[3];
  return x1 * y2 - y1 * x2;
}

int main(void){
  int n;
  cin >> n;
  while(n--){
    for(int i = 0 ; i < 4 ; i ++)cin>>x[i]>>y[i];
    cout<<(vabs(det())<CPS?"YES":"NO")<<endl;

  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'vabs' was not declared in this scope; did you mean 'labs'?
   20 |     cout<<(vabs(det())<CPS?"YES":"NO")<<endl;
      |            ^~~~
      |            labs
a.cc:20:24: error: 'CPS' was not declared in this scope; did you mean 'EPS'?
   20 |     cout<<(vabs(det())<CPS?"YES":"NO")<<endl;
      |                        ^~~
      |                        EPS
Language: C++

#include

<cstdio>

using

namespace
std;

int
n;

double
x[4],y[4];

int
main()
{

	

scanf(

"%d"
,&n);

	

for
(

int
c = 0; c < n; c++)

	

{

		

for
(

int
i = 0; i < 4; i++)

			

scanf(

"%lf%lf"
,&x[i],&y[i]);

		

puts((y[1]-y[0])/(x[1]-x[0]) == (y[3]-y[2])/(x[3]-x[2])?

"YES"
:

"NO"
);

	

}
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc:3:1: error: expected unqualified-id before '<' token
    3 | <cstdio>
      | ^
a.cc: In function 'int main()':
a.cc:22:1: error: 'scanf' was not declared in this scope
   22 | scanf(
      | ^~~~~
a.cc:56:1: error: 'puts' was not declared in this scope
   56 | puts((y[1]-y[0])/(x[1]-x[0]) == (y[3]-y[2])/(x[3]-x[2])?
      | ^~~~
Language: C++

#include<cstdio>

using　namespace　std;

int　n;

double　x[4],　y[4];

int　main()
{
scanf("%d",&n);

for(int　c = 0; c < n; c++)
{
for(int i = 0; i < 4; i++)	
scanf("%lf%lf",&x[i],&y[i]);

puts((y[1]-y[0])/(x[1]-x[0])==(y[3]-y[2])/(x[3]-x[2])?"YES":"NO");

reurn 0;
}
}

Compiler output:
a.cc:3:1: error: extended character 　 is not valid in an identifier
    3 | using　namespace　std;
      | ^
a.cc:3:1: error: extended character 　 is not valid in an identifier
a.cc:5:1: error: extended character 　 is not valid in an identifier
    5 | int　n;
      | ^
a.cc:7:1: error: extended character 　 is not valid in an identifier
    7 | double　x[4],　y[4];
      | ^
a.cc:7:14: error: extended character 　 is not valid in an identifier
    7 | double　x[4],　y[4];
      |              ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | int　main()
      | ^
a.cc:13:5: error: extended character 　 is not valid in an identifier
   13 | for(int　c = 0; c < n; c++)
      |     ^
a.cc:3:1: error: 'using\U00003000namespace\U00003000std' does not name a type
    3 | using　namespace　std;
      | ^~~~~~~~~~~~~~~~~~~~~
a.cc:5:1: error: 'int\U00003000n' does not name a type
    5 | int　n;
      | ^~~~~~
a.cc:7:1: error: 'double\U00003000x' does not name a type; did you mean 'double'?
    7 | double　x[4],　y[4];
      | ^~~~~~~~~
      | double
a.cc:9:1: error: ISO C++ forbids declaration of 'int\U00003000main' with no type [-fpermissive]
    9 | int　main()
      | ^~~~~~~~~
a.cc: In function 'int int\U00003000main()':
a.cc:11:13: error: 'n' was not declared in this scope
   11 | scanf("%d",&n);
      |             ^
a.cc:13:5: error: 'int\U00003000c' was not declared in this scope; did you mean 'int　main'?
   13 | for(int　c = 0; c < n; c++)
      |     ^~~~~~
      |     int　main
a.cc:13:17: error: 'c' was not declared in this scope
   13 | for(int　c = 0; c < n; c++)
      |                 ^
a.cc:16:17: error: 'x' was not declared in this scope
   16 | scanf("%lf%lf",&x[i],&y[i]);
      |                 ^
a.cc:16:23: error: 'y' was not declared in this scope
   16 | scanf("%lf%lf",&x[i],&y[i]);
      |                       ^
a.cc:18:7: error: 'y' was not declared in this scope
   18 | puts((y[1]-y[0])/(x[1]-x[0])==(y[3]-y[2])/(x[3]-x[2])?"YES":"NO");
      |       ^
a.cc:18:19: error: 'x' was not declared in this scope
   18 | puts((y[1]-y[0])/(x[1]-x[0])==(y[3]-y[2])/(x[3]-x[2])?"YES":"NO");
      |                   ^
a.cc:20:1: error: 'reurn' was not declared in this scope
   20 | reurn 0;
      | ^~~~~
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
Language: C++

#include
 <cstdio>

using
 namespace
 std;

int
 n;
double
 x[4],y[4];

int
 main()
 {
	
scanf("%d"
,&n);
	
for
 (int
 c = 0; c < n; c++)
	
{
		
for
 (int
 i = 0; i < 4; i++)
			
scanf("%lf%lf"
,&x[i],&y[i]);
		
puts((y[1]-y[0])/(x[1]-x[0]) == (y[3]-y[2])/(x[3]-x[2])?"YES"
:"NO"
);
	
}
 }

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc:2:2: error: expected unqualified-id before '<' token
    2 |  <cstdio>
      |  ^
a.cc: In function 'int main()':
a.cc:17:1: error: 'scanf' was not declared in this scope
   17 | scanf("%d"
      | ^~~~~
a.cc:33:1: error: 'puts' was not declared in this scope
   33 | puts((y[1]-y[0])/(x[1]-x[0]) == (y[3]-y[2])/(x[3]-x[2])?"YES"
      | ^~~~
Language: C++

#include <cstdio>

using namespace std;

int n;
double x[4],y[4];

int main()
 {
	
scanf("%d",&n);
	
for (int c = 0; c < n; c++)
{
		
for(inti = 0; i < 4; i++)scanf("%lf%lf",&x[i],&y[i]);
		
puts((y[1]-y[0])/(x[1]-x[0]) == (y[3]-y[2])/(x[3]-x[2])?"YES":"NO");
	
}
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   16 | for(inti = 0; i < 4; i++)scanf("%lf%lf",&x[i],&y[i]);
      |     ^~~~
      |     int
a.cc:16:15: error: 'i' was not declared in this scope
   16 | for(inti = 0; i < 4; i++)scanf("%lf%lf",&x[i],&y[i]);
      |               ^
Language: C++

#include <iostream.h>

int main(void)
{
	double x1, x2, x3, x4, y1, y2, y3, y4;
	double m1, m2;
	int n;
	
	scanf("%d", &n);
	while (n > 0){
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
	
		m1 = (y2 - y1) / (x2 - x1);
		m2 = (y4 - y3) / (x4 - x3);
	
		if (m1 == m2){
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
		n--;
	}
	return 0;
}

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

#include <iostream>

using namespace std;

typedef struct myvector{
  double x;
  double y;
}Vector;

Vector sub_vector(Vector& a, Vector& b)
{
  Vector ret;
  ret.x = b.x - a.x;
  ret.y = b.y - a.y;
  return ret;
}

double cross_product(Vector& a, Vector& b)
{
  return a.x * b.y - b.x * a.y;
}

int main()
{
  int n;
  cin >> n;
  for(int i = 0; i < n; i++){
    Vector A, B, C, D;
    cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y >> D.x >> D.y;
    Vector AB = sub_vector(A, B);
    Vector CD = sub_vector(C, D);
    if((cross_product(AB, CD) * 10000 == 0)
      cout << "YES" << endl;
    else 
      cout << "NO" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:44: error: expected ';' before 'cout'
   32 |     if((cross_product(AB, CD) * 10000 == 0)
      |                                            ^
      |                                            ;
   33 |       cout << "YES" << endl;
      |       ~~~~                                  
a.cc:34:5: error: expected primary-expression before 'else'
   34 |     else
      |     ^~~~
a.cc:33:29: error: expected ')' before 'else'
   33 |       cout << "YES" << endl;
      |                             ^
      |                             )
   34 |     else
      |     ~~~~                     
a.cc:32:7: note: to match this '('
   32 |     if((cross_product(AB, CD) * 10000 == 0)
      |       ^
Language: C++

#include <iostream>

using namespace std;

typedef struct myvector{
  double x;
  double y;
}Vector;

Vector sub_vector(Vector& a, Vector& b)
{
  Vector ret;
  ret.x = b.x - a.x;
  ret.y = b.y - a.y;
  return ret;
}

double cross_product(Vector& a, Vector& b)
{
  return a.x * b.y - b.x * a.y;
}

int main()
{
  int n;
  cin >> n;
  for(int i = 0; i < n; i++){
    Vector A, B, C, D;
    cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y >> D.x >> D.y;
    Vector AB = sub_vector(A, B);
    Vector CD = sub_vector(C, D);
    if((cross_product(AB, CD) * 10000.0 == 0)
      cout << "YES" << endl;
    else 
      cout << "NO" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:46: error: expected ';' before 'cout'
   32 |     if((cross_product(AB, CD) * 10000.0 == 0)
      |                                              ^
      |                                              ;
   33 |       cout << "YES" << endl;
      |       ~~~~                                    
a.cc:34:5: error: expected primary-expression before 'else'
   34 |     else
      |     ^~~~
a.cc:33:29: error: expected ')' before 'else'
   33 |       cout << "YES" << endl;
      |                             ^
      |                             )
   34 |     else
      |     ~~~~                     
a.cc:32:7: note: to match this '('
   32 |     if((cross_product(AB, CD) * 10000.0 == 0)
      |       ^
Language: C++


4
5
6
7
8
9
10
11
12
13
 
#include <stdio.h>
 
int main()
{
        int n;
        scanf("%d\n", &n);
        while(n--){
                double x1,y1,x2,y2,x3,y3,x4,y4;
                scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
                printf("%s\n",((y1-y2)/(x1-x2))==((y3-y4)/(x3-x4))?"YES":"NO");
        }
        return 0;
}
 

 
Compile Error Logs: 


 
 
Status 
Judge: 1/1  C  CPU: 00.00 sec  Memory: 620 KB  Length: 335 B  2013-01-20 11:56  2013-01-20 11:56  
Results for testcases 
Case # Verdict CPU Time Memory In Out Case Name 
 Case #1: : Accepted  00.00 sec 620 KB    



 < prev | 1 /  1 | next >      : Accepted        00.00 sec        620 KB 

 

Judge Input #1 ( in1.txt | 16 B)  Judge Output #1 ( out1.txt | 16 B) 

In preparation.

  
In preparation.

 

Comments 
 

 Under Construction. 

 
Categories 
 



 
Free Tags 
 

Compiler output:
a.cc:37:6: error: stray '#' in program
   37 | Case # Verdict CPU Time Memory In Out Case Name
      |      ^
a.cc:38:7: error: stray '#' in program
   38 |  Case #1: : Accepted  00.00 sec 620 KB
      |       ^
a.cc:46:13: error: stray '#' in program
   46 | Judge Input #1 ( in1.txt | 16 B)  Judge Output #1 ( out1.txt | 16 B)
      |             ^
a.cc:46:48: error: stray '#' in program
   46 | Judge Input #1 ( in1.txt | 16 B)  Judge Output #1 ( out1.txt | 16 B)
      |                                                ^
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 4
      | ^
a.cc: In function 'int main()':
a.cc:18:9: error: 'scanf' was not declared in this scope
   18 |         scanf("%d\n", &n);
      |         ^~~~~
a.cc:22:17: error: 'printf' was not declared in this scope
   22 |                 printf("%s\n",((y1-y2)/(x1-x2))==((y3-y4)/(x3-x4))?"YES":"NO");
      |                 ^~~~~~
a.cc:14:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
   13 | #include <stdio.h>
  +++ |+#include <cstdio>
   14 | 
a.cc: At global scope:
a.cc:29:1: error: 'Compile' does not name a type
   29 | Compile Error Logs:
      | ^~~~~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <utility>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#define each(e,c) for(auto&e:c)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<(DUMP(),__VA_ARGS__).str()<<" ["<<__LINE__<<"]"<<endl)
struct DUMP:ostringstream{template<class T>DUMP &operator,(const T&t){if(this->tellp())*this<<", ";*this<<t;return *this;}};
#else
#define dump(...)
#endif

ll stoll(string const& s){
    ll res = 0;
    rep(i,s.size()){
        res*=10;
        res+=s[i]-'0';
    }
    return res;
}

ll input(){
    string s; cin>>s;
    size_t p=0;
    int sign = s[0]=='-' ? -1 : 1;
    if(sign==-1) s.erase(s.begin());
    while(p<s.size() && s[p]!='.') p++;
    while(s.size()-p < 6) s += '0';
    s.erase(s.begin()+p);
    dump(s);
    return sign*stoll(s);
}

int main(){
    int n; cin>>n;
    rep(_,n){
        ll x[2][2], y[2][2];
        rep(i,2){
            rep(j,2){
                x[i][j] = input();
                y[i][j] = input();
            }
        }
        ll dx1=x[0][0]-x[0][1], dy1=y[0][0]-y[0][1];
        ll dx2=x[1][0]-x[1][1], dy2=y[1][0]-y[1][1];
        dump(dx1,dx2,dy1,dy2);
        puts(dx1*dy2==dx2*dy1 ? "YES" : "NO");
    }
}

Compiler output:
a.cc: In function 'll input()':
a.cc:52:22: error: call of overloaded 'stoll(std::string&)' is ambiguous
   52 |     return sign*stoll(s);
      |                 ~~~~~^~~
a.cc:34:4: note: candidate: 'll stoll(const std::string&)'
   34 | ll stoll(string const& s){
      |    ^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/basic_string.h:4180:3: note: candidate: 'long long int std::__cxx11::stoll(const std::string&, std::size_t*, int)'
 4180 |   stoll(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, -1, 0, 1 , 1,  1, -1, -1 };

int n;
double x1, x2, x3, x4, y1, y2, y3, y4;

int main() {
	scanf( "%d", &n );
	for ( int i = 0; i < n; i++ ) {
		scanf( "%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4 );
		if ( fabs( ( x2 - x1 ) * ( y4 - y3 ) - ( x4 - x3 ) * ( y2 - y1 ) ) < EPS ) {
			printf( "YES\n" );
		}
		else {
			printf( "NO\n" );
		}
	}
	return 0;
}

Compiler output:
a.cc:39:24: error: 'double y1' redeclared as different kind of entity
   39 | double x1, x2, x3, x4, y1, y2, y3, y4;
      |                        ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:45:75: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
   45 |                 if ( fabs( ( x2 - x1 ) * ( y4 - y3 ) - ( x4 - x3 ) * ( y2 - y1 ) ) < EPS ) {
      |                                                                        ~~ ^ ~~
      |                                                                        |    |
      |                                                                        |    double(double) noexcept
      |                                                                        double
Language: C++

#include<iostream>
using namespace std;

int main () {
    double x[4],y[4];
    for(i=0;i<4;i++) {
        cin >> x[i] >> y[i];
    }
    if((y[1]-y[2])/(x[1]-x[2]) == (y[3]-y[4])/(x[3]-x[4])) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     for(i=0;i<4;i++) {
      |         ^
Language: C++

#include <complex>
#include <cmath>
#include <iostream>
#include <stdio.h>

using namespace std;
typedef complex<double> xy_t;

const double eps= a1e&#8722;11;
double x[4], y[4];
int N;
int main(){
  cin >> N;
  for(int t= 0; t<N; ++i){
    for (int i = 0; i < 4; ++i) cin >> x[i] >> y[i];
    xy_t a[2]={xy_t(x[0],y[0])-xy_t(x[1],y[1]), xy_t(x[2],y[2])-xy_t(x[3],y[3])};
    xy_t x=a[0],y=a[1];
    bool p = abs(x.real()*y.imag()-x.imag()*y.real()) < eps;
    cout << ( p ? ”YES” : ”NO” ) << endl ;
  }

}

Compiler output:
a.cc:9:23: error: stray '#' in program
    9 | const double eps= a1e&#8722;11;
      |                       ^
a.cc:19:19: error: extended character ” is not valid in an identifier
   19 |     cout << ( p ? ”YES” : ”NO” ) << endl ;
      |                   ^
a.cc:19:19: error: extended character ” is not valid in an identifier
a.cc:19:27: error: extended character ” is not valid in an identifier
   19 |     cout << ( p ? ”YES” : ”NO” ) << endl ;
      |                           ^
a.cc:19:27: error: extended character ” is not valid in an identifier
a.cc:9:19: error: 'a1e' was not declared in this scope
    9 | const double eps= a1e&#8722;11;
      |                   ^~~
a.cc:9:29: error: expected unqualified-id before numeric constant
    9 | const double eps= a1e&#8722;11;
      |                             ^~
a.cc: In function 'int main()':
a.cc:14:24: error: 'i' was not declared in this scope
   14 |   for(int t= 0; t<N; ++i){
      |                        ^
a.cc:19:19: error: '\U0000201dYES\U0000201d' was not declared in this scope
   19 |     cout << ( p ? ”YES” : ”NO” ) << endl ;
      |                   ^~~~~
a.cc:19:27: error: '\U0000201dNO\U0000201d' was not declared in this scope
   19 |     cout << ( p ? ”YES” : ”NO” ) << endl ;
      |                           ^~~~