submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s621365690
|
p00011
|
C++
|
#include<iostream>
#include"Header.h"
using namespace std;
#define size_n 4
#define size_num 30
int main(){
int swap_times;
int num_length;
char n[size_n]={'\0'};
int num[size_num] = {0};
int temp;
cin >> num_length;
cin >> swap_times;
for(int i=1;i <= num_length;i++){
num[i] = i;
}
for(int i=1;i<=swap_times;i++){
cin >> n;
temp = num[(int)n[0]-(int)'0'];
num[(int)n[0]-(int)'0'] = num[(int)n[2]-(int)'0'];
num[(int)n[2]-(int)'0'] = temp;
//データの初期化
for(int i=0;i<size_n;i++){
n[i] = '\0';
}
}
for(int i=1;i<=num_length;i++){
cout << num[i] << endl;
}
return 0;
}
|
a.cc:2:9: fatal error: Header.h: No such file or directory
2 | #include"Header.h"
| ^~~~~~~~~~
compilation terminated.
|
s138261353
|
p00011
|
C++
|
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int w, n;
int a[30], b[30];
int now[30];
int x, y;
cin >> w;
cin >> n;
for (int i = 0; i < n; i++){
scanf_s("%d,%d", &x, &y);
a[i] = x;
b[i] = y;
}
for (int j = 0; j < n; j++){
for (int i = 0; i < w; i++){
if (now[i] == a[j]){
now[i] = b[j];
now[b[j]] = a[j];
break;
}
}
}
for (int i = 0; i < n; i++){
printf("%d\n", now[i]);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
16 | scanf_s("%d,%d", &x, &y);
| ^~~~~~~
| scanf
|
s030180220
|
p00011
|
C++
|
#include <iostream>
#include<cstdio>
using namespace std;
int main (){
int w,N,d[30],sub;
int a,b;
cin>>w>>N;
for(int j=1;j<=w;j++){
d[j]=j;
}
for(int i=0;i<N;i++){
scanf("%d,%d",&a,&b);
sub=d[b];
d[b]=c[a];
c[a]=sub;
}
for(int k=1;k<=w;k++){
cout<<d[k]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:22: error: 'c' was not declared in this scope
15 | d[b]=c[a];
| ^
|
s183177010
|
p00011
|
C++
|
#include <iostream>
#include<cstdio>
using namespace std;
int main (){
int w,N,d[31],sub;
int a,b;
cin>>w>>N;
for(int j=1;j<=w;j++){
d[j]=j;
}
for(int i=0;i<N;i++){
scanf("%d,%d",&a,&b);
sub=d[b];
d[b]=d[a];
c[a]=sub;
}
for(int k=1;k<=w;k++){
cout<<d[k]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:17: error: 'c' was not declared in this scope
16 | c[a]=sub;
| ^
|
s550371382
|
p00011
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int w, n;
cin >> w >> n;
vector<int> v(w);
iota(v.begin(), v.end(), 1);
int a, b;
char c;
for (int i=0; i<n; ++i) {
cin >> a >> c >> b;
swap(v[a - 1], v[b - 1]);
}
for (int i=0; i<w; ++i) {
cout << v[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:5: error: 'iota' was not declared in this scope
12 | iota(v.begin(), v.end(), 1);
| ^~~~
|
s548811157
|
p00011
|
C++
|
import java.util.Scanner;
public class Main{
private static void change(int data[],int f,int s){
int temp = data[f-1];
data[f-1] = data[s-1];
data[s-1] = temp;
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int w = scan.nextInt();
int n = scan.nextInt();
int[] data = new int[w];
for(int i=0;i<w;i++){
data[i]=i+1;
}
int first =0;
int second =0;
scan.useDelimiter(",");
for(int i=0;i<n;i++){
first = scan.nextInt();
second = scan.nextInt();
change(data,first,second);
}
for(int i=0;i<=n;i++)
System.out.println(data[i]);
}
}
|
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:2:1: error: expected unqualified-id before 'public'
2 | public class Main{
| ^~~~~~
|
s185883634
|
p00012
|
Java
|
public class Main {
void run() {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
double x1 = sc.nextDouble();
double y1 = sc.nextDouble();
double x2 = sc.nextDouble();
double y2 = sc.nextDouble();
double x3 = sc.nextDouble();
double y3 = sc.nextDouble();
double xp = sc.nextDouble();
double yp = sc.nextDouble();
// 三角形ABCの面積
double s = TriangleArea(x3 - x1, y3 - y1, x2 - x1, y2 - x1);
double s1 = TriangleArea(xp - x1, yp - y1, x2 - x1, y2 - x1);
double s2 = TriangleArea(xp - x1, yp - y1, x3 - x1, y3 - x1);
double s3 = TriangleArea(xp - x2, yp - y2, x3 - x2, y3 - y2);
// System.out.println((xp - x2) + " " + (yp - y2) + " " + (x3 - x2)
// + " " + (y3 - x2));
if (s == s1 + s2 + s3) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
sc.close();
}
double TriangleArea(double x1, double y1, double x2, double y2) {
double s = ((x1 * y2) - (x2 * y1)) / 2;
if (s <= 0) {
s *= -1;
}
return s;
}
public static void main(String[] args) {
new Main().run();
}
}
|
Main.java:6: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:6: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s528811182
|
p00012
|
Java
|
import java.util.*;
public class main {
private static Scanner sc=new Scanner(System.in);
static int x1,x2,x3,y1,y2,y3,xp,yp;
public static void main(String[] args) {
while(sc.hasNextInt()){
int xm[ ]=new int[3];
int ym[]=new int[3];
for (int i = 0; i < 3; i++) {
xm[i]=sc.nextInt();
ym[i]=sc.nextInt();
}
xp=sc.nextInt();yp=sc.nextInt();
Arrays.sort(xm);
Arrays.sort(ym);
if(xm[0]<xp){
if(xm[3]>xp){
if(ym[0]<yp){
if(ym[3]<yp){
System.out.println("Yes");
}else{mm();}
}else{mm();}
}else{mm();}
}else{mm();}
}
}
private static void mm(){
System.out.println("No");
}
}
|
Main.java:2: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s336566048
|
p00012
|
Java
|
import java.util.Arrays;
import java.util.Scanner;
public class main2 {
private static Scanner sc=new Scanner(System.in);
static double xp,yp;
public static void main(String[] args) {
while(sc.hasNextDouble()){
double xm[]=new double[3];
double ym[]=new double [3];
for (int i = 0; i < 3; i++) {
xm[i]=sc.nextDouble();
ym[i]=sc.nextDouble();
}
xp=sc.nextDouble();yp=sc.nextDouble();
Arrays.sort(xm);
Arrays.sort(ym);
for (int i = 0; i < 3; i++) {
if(xm[i]==xp&&ym[i]==yp)
break;
}
if(xm[0]<xp&&xm[2]>xp&&ym[0]<yp&&ym[2]>yp){
System.out.println("Yes");
}else{mm();}
}
}
private static void mm(){
System.out.println("No");
}
}
|
Main.java:3: error: class main2 is public, should be declared in a file named main2.java
public class main2 {
^
1 error
|
s956400351
|
p00012
|
Java
|
import java.util.Arrays;
import java.util.*;
public class main {
private static Scanner sc=new Scanner(System.in);
static double xp,yp;
public static void main(String[] args) {
while(sc.hasNextDouble()){
double xm[]=new double[3];
double ym[]=new double [3];
for (int i = 0; i < 3; i++) {
xm[i]=sc.nextDouble();
ym[i]=sc.nextDouble();
}
xp=sc.nextDouble();yp=sc.nextDouble();
Arrays.sort(xm);
Arrays.sort(ym);
for (int i = 0; i < 3; i++) {
if(xm[i]==xp&&ym[i]==yp)
break;
}
if(xm[0]<xp&&xm[2]>xp&&ym[0]<yp&&ym[2]>yp){
System.out.println("Yes");
}else{mm();}
}
}
private static void mm(){
System.out.println("No");
}
}
|
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s819310742
|
p00012
|
Java
|
import java.util.Arrays;
import java.util.*;
public class main {
private static Scanner sc=new Scanner(System.in);
static double xp,yp;
public static void main(final String[] args) {
while(sc.hasNextDouble()){
double xm[]=new double[3];
double ym[]=new double [3];
for (int i = 0; i < 3; i++) {
xm[i]=sc.nextDouble();
ym[i]=sc.nextDouble();
}
xp=sc.nextDouble();yp=sc.nextDouble();
Arrays.sort(xm);
Arrays.sort(ym);
for (int i = 0; i < 3; i++) {
if(xm[i]==xp&&ym[i]==yp)
break;
}
if(xm[0]<xp&&xm[2]>xp&&ym[0]<yp&&ym[2]>yp){
System.out.println("Yes");
}else{mm();}
}
}
private static void mm(){
System.out.println("No");
}
}
|
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s906576001
|
p00012
|
Java
|
import java.util.Arrays;
import java.util.*;
public class main {
private static Scanner sc=new Scanner(System.in);
static double xp,yp;
public static void main(final String[] args) {
while(sc.hasNextDouble()){
double xm[]=new double[3];
double ym[]=new double [3];
for (int i = 0; i < 3; i++) {
xm[i]=sc.nextDouble();
ym[i]=sc.nextDouble();
}
xp=sc.nextDouble();yp=sc.nextDouble();
Arrays.sort(xm);
Arrays.sort(ym);
for (int i = 0; i < 3; i++) {
if(xm[i]==xp&&ym[i]==yp)
break;
}
if(xm[0]<xp&&xm[2]>xp&&ym[0]<yp&&ym[2]>yp){
System.out.println("Yes");
}else{mm();}
}
}
private static void mm(){
System.out.println("No");
}
}
|
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s801012657
|
p00012
|
Java
|
import java.io.IOException;
import java.util.Scanner;
public class Main {
static double cross(double x1, double x2, double y1, double y2, double xp, double yp){
return (x2-x1) * (yp-y2) - (y2-y1) * (xp-x2);
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()){
final double x1 = sc.nextDouble();
final double y1 = sc.nextDouble();
final double x2 = sc.nextDouble();
final double y2 = sc.nextDouble();
final double x3 = sc.nextDouble();
final double y3 = sc.nextDouble();
final double xp = sc.nextDouble();
final double yp = sc.nextDouble();
double c1 = cross(x1, x2, y1, y2, xp, yp);
double c2 = cross(x2, x3, y2, y3, xp, yp);
double c3 = cross(x3, x1, y3, y1, xp, yp);
/*
double c1 = (x2-x1) * (yp-y2) - (y2-y1) * (xp-x2);
double c2 = (x3-x2) * (yp-y3) - (y3-y2) * (xp-x3);
double c3 = (x1-x3) * (yp-y1) - (y1-y3) * (xp-x1);
*/
if ((c1 > 0&& c2 > 0 && c3 > 0)||(c1 < 0 && c2 < 0 && c3 < 0)){
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
}
|
Main.java:8: error: illegal start of expression
public static void main(String[] args) throws IOException {
^
1 error
|
s656582584
|
p00012
|
Java
|
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNextDouble()){
double x1 = sc.nextDouble();
double y1 = sc.nextDouble();
double x2 = sc.nextDouble();
double y2 = sc.nextDouble();
double x3 = sc.nextDouble();
double y3 = sc.nextDouble();
double xp = sc.nextDouble();
double yp = sc.nextDouble();
Point p1 = new Point(x1, y1);
Point p2 = new Point(x2, y2);
Point p3 = new Point(x3, y3);
Point pp = new Point(xp, yp);
Triangle t = new Triangle(p1, p2, p3);
if(t.isInThisTriangle(pp)) System.out.println("YES");
else System.out.println("NO");
}
sc.close();
}
}
class Line{
double p;
double q;
double r;
/**
* ??´???px+qy=r??????????????????
*
* @param p
* @param q
* @param r
*/
Line(double p, double q, double r){
this.p = p;
this.q = q;
this.r = r;
}
public Line(Point p1, Point p2){
this(p1.getX() - p2.getX(), p1.getY() - p2.getY(), (p1.getX() == p2
.getX()) ? (p1.getY() - (p1.getY() - p2.getY())
/ (p1.getX() - p2.getX()) * p1.getX()): 0);
}
/**
* ????????´???????????????2????????????????????´????????????????????????????????????
*
* @param x
* @param y
* @return 2???x, y???????????´???????????°true
*/
boolean isTheSameSide(Point x, Point y){
double result = this.calcPX_QY(x.getX(), x.getY())
* this.calcPX_QY(y.getX(), y.getY());
return (result > 0) ? true: false;
}
/**
* ???????????????x, y????????????px+qy????¨?????????????
*
* @param x
* @param y
* @return
*/
double calcPX_QY(double x, double y){
return x * p + y * q;
}
}
class Triangle{
Point p1;
Point p2;
Point p3;
Triangle(Point p1, Point p2, Point p3){
this.p1 = p1;
this.p2 = p2;
this.p3 = p3;
}
Point getCenter(){
return new Point((p1.getX() + p2.getX() + p3.getX()) / 3, (p1.getY()
+ p2.getY() + p3.getY()) / 3);
}
boolean isInThisTriangle(Point p) {
Line l12 = new Line(p1, p2);
Line l23 = new Line(p2, p3);
Line l31 = new Line(p3, p1);
Point center = this.getCenter();
return l12.isTheSameSide(p, center) && l23.isTheSameSide(p, center) && l31.isTheSameSide(p, center);
}
}
|
Main.java:51: error: cannot find symbol
public Line(Point p1, Point p2){
^
symbol: class Point
location: class Line
Main.java:51: error: cannot find symbol
public Line(Point p1, Point p2){
^
symbol: class Point
location: class Line
Main.java:64: error: cannot find symbol
boolean isTheSameSide(Point x, Point y){
^
symbol: class Point
location: class Line
Main.java:64: error: cannot find symbol
boolean isTheSameSide(Point x, Point y){
^
symbol: class Point
location: class Line
Main.java:84: error: cannot find symbol
Point p1;
^
symbol: class Point
location: class Triangle
Main.java:85: error: cannot find symbol
Point p2;
^
symbol: class Point
location: class Triangle
Main.java:86: error: cannot find symbol
Point p3;
^
symbol: class Point
location: class Triangle
Main.java:88: error: cannot find symbol
Triangle(Point p1, Point p2, Point p3){
^
symbol: class Point
location: class Triangle
Main.java:88: error: cannot find symbol
Triangle(Point p1, Point p2, Point p3){
^
symbol: class Point
location: class Triangle
Main.java:88: error: cannot find symbol
Triangle(Point p1, Point p2, Point p3){
^
symbol: class Point
location: class Triangle
Main.java:94: error: cannot find symbol
Point getCenter(){
^
symbol: class Point
location: class Triangle
Main.java:99: error: cannot find symbol
boolean isInThisTriangle(Point p) {
^
symbol: class Point
location: class Triangle
Main.java:17: error: cannot find symbol
Point p1 = new Point(x1, y1);
^
symbol: class Point
location: class Main
Main.java:17: error: cannot find symbol
Point p1 = new Point(x1, y1);
^
symbol: class Point
location: class Main
Main.java:18: error: cannot find symbol
Point p2 = new Point(x2, y2);
^
symbol: class Point
location: class Main
Main.java:18: error: cannot find symbol
Point p2 = new Point(x2, y2);
^
symbol: class Point
location: class Main
Main.java:19: error: cannot find symbol
Point p3 = new Point(x3, y3);
^
symbol: class Point
location: class Main
Main.java:19: error: cannot find symbol
Point p3 = new Point(x3, y3);
^
symbol: class Point
location: class Main
Main.java:20: error: cannot find symbol
Point pp = new Point(xp, yp);
^
symbol: class Point
location: class Main
Main.java:20: error: cannot find symbol
Point pp = new Point(xp, yp);
^
symbol: class Point
location: class Main
Main.java:95: error: cannot find symbol
return new Point((p1.getX() + p2.getX() + p3.getX()) / 3, (p1.getY()
^
symbol: class Point
location: class Triangle
Main.java:103: error: cannot find symbol
Point center = this.getCenter();
^
symbol: class Point
location: class Triangle
22 errors
|
s629413713
|
p00012
|
Java
|
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNextDouble()){
double x1 = sc.nextDouble();
double y1 = sc.nextDouble();
double x2 = sc.nextDouble();
double y2 = sc.nextDouble();
double x3 = sc.nextDouble();
double y3 = sc.nextDouble();
double xp = sc.nextDouble();
double yp = sc.nextDouble();
Point p1 = new Point(x1, y1);
Point p2 = new Point(x2, y2);
Point p3 = new Point(x3, y3);
Point pp = new Point(xp, yp);
Triangle t = new Triangle(p1, p2, p3);
if(t.isInThisTriangle(pp)) System.out.println("YES");
else System.out.println("NO");
}
sc.close();
}
}
class Line{
double p;
double q;
double r;
/**
* ??´???px+qy=r??????????????????
*
* @param p
* @param q
* @param r
*/
Line(double p, double q, double r){
this.p = p;
this.q = q;
this.r = r;
}
public Line(Point p1, Point p2){
if(p1.getX() != p2.getX()) {
this.p = -(p1.getY()-p2.getY())/(p1.getX()-p2.getX());
this.q = 1;
this.r = p1.getX()* this.p +p1.getY();
}else {
if(p1.getY() != p2.getY()) {
this.p = 1;
this.q = 0;
this.r = 0;
}else {
this.p = 1;
this.q = 1;
this.r = 1;
}
}
}
/**
* ????????´???????????????2????????????????????´????????????????????????????????????
*
* @param x
* @param y
* @return 2???x, y???????????´???????????°true
*/
boolean isTheSameSide(Point x, Point y){
double result = (this.calcPX_QY(x.getX(), x.getY()) - this.r)
* (this.calcPX_QY(y.getX(), y.getY()) - this.r);
return (result > 0) ? true: false;
}
/**
* ???????????????x, y????????????px+qy????¨?????????????
*
* @param x
* @param y
* @return
*/
double calcPX_QY(double x, double y){
return x * p + y * q;
}
}
class Triangle{
Point p1;
Point p2;
Point p3;
Triangle(Point p1, Point p2, Point p3){
this.p1 = p1;
this.p2 = p2;
this.p3 = p3;
}
Point getCenter(){
return new Point((p1.getX() + p2.getX() + p3.getX()) / 3, (p1.getY()
+ p2.getY() + p3.getY()) / 3);
}
boolean isInThisTriangle(Point p) {
Line l12 = new Line(p1, p2);
Line l23 = new Line(p2, p3);
Line l31 = new Line(p3, p1);
Point center = this.getCenter();
return l12.isTheSameSide(p, center) && l23.isTheSameSide(p, center) && l31.isTheSameSide(p, center);
}
}
class Point{
private double x;
private double y;
public double getX(){
return this.x;
}
public double getY(){
return this.y;
}
public Point(double d, double e){
this.x = d;
this.y = e;
}
|
Main.java:138: error: reached end of file while parsing
}
^
1 error
|
s226227919
|
p00012
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
print();
}
public static void print() {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
while (str != null) {
String[] dataSet = str.split(" ", 0);
BigDecimal x1 = new BigDecimal(dataSet[0]).setScale(1);
BigDecimal y1 = new BigDecimal(dataSet[1]).setScale(1);
BigDecimal x2 = new BigDecimal(dataSet[2]).setScale(1);
BigDecimal y2 = new BigDecimal(dataSet[3]).setScale(1);
BigDecimal x3 = new BigDecimal(dataSet[4]).setScale(1);
BigDecimal y3 = new BigDecimal(dataSet[5]).setScale(1);
BigDecimal x = new BigDecimal(dataSet[6]).setScale(1);
BigDecimal y = new BigDecimal(dataSet[7]).setScale(1);
BigDecimal xMax = x1.max(x2.max(x3));
BigDecimal xMin = x1.min(x2.max(x3));
BigDecimal yMax = y1.max(y2.max(y3));
BigDecimal yMin = y1.min(y2.max(y3));
if (x.compareTo(xMax) < 0 && x.compareTo(xMin) > 0 && y.compareTo(yMax) < 0 && y.compareTo(yMin) > 0) {
System.out.print("YES" + "\n");
} else {
System.out.print("NO" + "\n");
}
str = br.readLine();
}
} catch (IOException e) {
e.printStackTrace();
}
}
|
Main.java:44: error: reached end of file while parsing
}
^
1 error
|
s467504449
|
p00012
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class AOJ0012 {
public static void main(String[] args) throws IOException {
//input
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
while ((str = br.readLine()) != null) {
//Get point
String[] num = str.split(" ", 0);
point O = new point(num[0], num[1]);
point A = new point(num[2], num[3]);
point B = new point(num[4], num[5]);
point P = new point(num[6], num[7]);
//Get vector
vector OA = new vector(O, A);
vector OB = new vector(O, B);
vector OP = new vector(O, P);
//Calculation of coefficient
BigDecimal XaYb = new BigDecimal(OA.vx.multiply(OB.vy).toPlainString());
BigDecimal XbYa = new BigDecimal(OA.vy.multiply(OB.vx).toPlainString());
BigDecimal XaPy = new BigDecimal(OA.vx.multiply(OP.vy).toPlainString());
BigDecimal XbPy = new BigDecimal(OB.vx.multiply(OP.vy).toPlainString());
BigDecimal YaPx = new BigDecimal(OA.vy.multiply(OP.vx).toPlainString());
BigDecimal YbPx = new BigDecimal(OB.vy.multiply(OP.vx).toPlainString());
BigDecimal temp_s = new BigDecimal(YbPx.subtract(XbPy).toPlainString());
BigDecimal temp_t = new BigDecimal(XaPy.subtract(YaPx).toPlainString());
BigDecimal XaYb_YaXb = new BigDecimal(XaYb.subtract(XbYa).toPlainString());
BigDecimal co_S = new BigDecimal(temp_s.toPlainString());
co_S = co_S.divide(XaYb_YaXb, 3, BigDecimal.ROUND_HALF_UP);
BigDecimal co_T = new BigDecimal(temp_t.toPlainString());
co_T = co_T.divide(XaYb_YaXb, 3, BigDecimal.ROUND_HALF_UP);
BigDecimal total = new BigDecimal(co_S.add(co_T).toPlainString());
if ((co_S.compareTo(BigDecimal.ZERO) >= 0) && (co_T.compareTo(BigDecimal.ZERO) >= 0)) {
if ((total.compareTo(BigDecimal.ZERO) >= 0) && (total.compareTo(BigDecimal.ONE) <= 0)) {
System.out.println("YES");
} else {
System.out.println("NO");
}
} else {
System.out.println("NO");
}
}
}
}
//Definition of point
class point {
BigDecimal x;
BigDecimal y;
public point (String a, String b) {
this.x = new BigDecimal(a);
this.y = new BigDecimal(b);
}
public point (BigDecimal a, BigDecimal b) {
this.x = new BigDecimal(a.toPlainString());
this.y = new BigDecimal(b.toPlainString());
}
}
//Definition of vector
class vector {
BigDecimal vx;
BigDecimal vy;
public vector (point a, point b) {
this.vx = new BigDecimal(b.x.toPlainString());
vx = vx.subtract(a.x);
this.vy = new BigDecimal(b.y.toPlainString());
vy = vy.subtract(a.y);
}
public vector (BigDecimal p, BigDecimal q) {
this.vx = new BigDecimal(p.toPlainString());
this.vy = new BigDecimal(q.toPlainString());
}
}
|
Main.java:6: error: class AOJ0012 is public, should be declared in a file named AOJ0012.java
public class AOJ0012 {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s470365137
|
p00012
|
Java
|
import java.util.Scanner;
import static java.lang.Math.*;
class Main {
public static void main (String args[]) {
Scanner scan = new Scanner(System.in);
double[] p = new double[6];
double[] S = new double[4];
while (scan.hasNext()) {
for (int i=0; i<6; i++) {
p[i] = scan.nextDouble();
}
double xp = scan.nextDouble();
double yp = scan.nextDouble();
double a, b, c, s;
for (int i=0; i<6; i+=2) {
if (i == 4) {
a = sqrt(pow(p[0]-p[4], 2) + pow(p[1]-p[5], 2));
b = sqrt(pow(xp-p[4], 2) + pow(yp-p[5], 2));
c = sqrt(pow(xp-p[0], 2) + pow(yp-p[1], 2));
}
else {
a = sqrt(pow(p[i+2]-p[i], 2) + pow(p[i+3]-p[i+1], 2));
b = sqrt(pow(xp-p[i], 2) + pow(yp-p[i+1], 2));
c = sqrt(pow(xp-p[i+2], 2) + pow(yp-p[i+3], 2));
}
s = (a+b+c) / 2.0;
S[i/2] = (sqrt(s*(s-a)*(s-b)*(s-c)));
}
a = sqrt(pow(p[2]-p[0], 2) + pow(p[3]-p[1], 2));
b = sqrt(pow(p[4]-p[2], 2) + pow(p[5]-p[3], 2));
c = sqrt(pow(p[0]-p[4], 2) + pow(p[1]-p[5], 2));
s = (a+b+c) / 2.0;
S[3] = (sqrt(s*(s-a)*(s-b)*(s-c)));
double S = round(S[0] + S[1] + S[2]);
S[3] = round(S[3]);
if (S == S[3]) {
System.out.println("YES");
}
else {
System.out.println("NO");
}
}
}
}
|
Main.java:41: error: variable S is already defined in method main(String[])
double S = round(S[0] + S[1] + S[2]);
^
Main.java:41: error: array required, but double found
double S = round(S[0] + S[1] + S[2]);
^
Main.java:41: error: array required, but double found
double S = round(S[0] + S[1] + S[2]);
^
Main.java:41: error: array required, but double found
double S = round(S[0] + S[1] + S[2]);
^
Main.java:42: error: array required, but double found
S[3] = round(S[3]);
^
Main.java:42: error: array required, but double found
S[3] = round(S[3]);
^
Main.java:44: error: array required, but double found
if (S == S[3]) {
^
7 errors
|
s464998906
|
p00012
|
Java
|
import java.io.BufferedRender;
import java.io.IOException;
import java.io.InputStreamRender;
public class main{
public static void main(String[] args) throws IOException{
BufferedRender br = new BufferRender(new InputStreamReader(System.in));
String str = br.readLine();
Boolean isNull = str.equals("");
while(!isNull){
String[] datas = str.split(" ",8);
double x1 = Double.parseDouble(datas[0]);
double y1 = Double.parseDouble(datas[1]);
double x2 = Double.parseDouble(datas[2]);
double y2 = Double.parseDouble(datas[3]);
double x3 = Double.parseDouble(datas[4]);
double y3 = Double.parseDouble(datas[5]);
double xp = Double.parseDouble(datas[6]);
double yp = Double.parseDouble(datas[7]);
double x = xp-x1;
double y = yp-y1;
double p = x2-x1;
double q = y2-y1;
double r = x3-x1;
double u = y3-y1;
double[] coefficient = Simultaneous(p,r,x,q,u,y);
double s = coefficient[0];
double t = coefficient[1];
if(s<0||t<0){
System.out.println("NO");
}else if(s+t>0 && s+t<1){
System.out.println("YES");
}else{
System.out.println("NO");
}
str = br.readLine();
isNull = str.equals("");
}
}
private static double[] Simultaneous(double a,double b,double c,double d,double e,double f){
double x = (double) (e*c-b*f)/(a*e-b*d);
double y = (double) (a*f-c*d)/(a*e-b*d);
double[] answer = {x,y};
return answer;
}
}
|
Main.java:5: error: class main is public, should be declared in a file named main.java
public class main{
^
Main.java:1: error: cannot find symbol
import java.io.BufferedRender;
^
symbol: class BufferedRender
location: package java.io
Main.java:3: error: cannot find symbol
import java.io.InputStreamRender;
^
symbol: class InputStreamRender
location: package java.io
Main.java:7: error: cannot find symbol
BufferedRender br = new BufferRender(new InputStreamReader(System.in));
^
symbol: class BufferedRender
location: class main
Main.java:7: error: cannot find symbol
BufferedRender br = new BufferRender(new InputStreamReader(System.in));
^
symbol: class BufferRender
location: class main
Main.java:7: error: cannot find symbol
BufferedRender br = new BufferRender(new InputStreamReader(System.in));
^
symbol: class InputStreamReader
location: class main
6 errors
|
s504038994
|
p00012
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class main{
public static void main(String[] args) throws IOException{
BufferedRender br = new BufferRender(new InputStreamReader(System.in));
String str = br.readLine();
Boolean isNull = str.equals("");
while(!isNull){
String[] datas = str.split(" ",8);
double x1 = Double.parseDouble(datas[0]);
double y1 = Double.parseDouble(datas[1]);
double x2 = Double.parseDouble(datas[2]);
double y2 = Double.parseDouble(datas[3]);
double x3 = Double.parseDouble(datas[4]);
double y3 = Double.parseDouble(datas[5]);
double xp = Double.parseDouble(datas[6]);
double yp = Double.parseDouble(datas[7]);
double x = xp-x1;
double y = yp-y1;
double p = x2-x1;
double q = y2-y1;
double r = x3-x1;
double u = y3-y1;
double[] coefficient = Simultaneous(p,r,x,q,u,y);
double s = coefficient[0];
double t = coefficient[1];
if(s<0||t<0){
System.out.println("NO");
}else if(s+t>0 && s+t<1){
System.out.println("YES");
}else{
System.out.println("NO");
}
str = br.readLine();
isNull = str.equals("");
}
}
private static double[] Simultaneous(double a,double b,double c,double d,double e,double f){
double x = (double) (e*c-b*f)/(a*e-b*d);
double y = (double) (a*f-c*d)/(a*e-b*d);
double[] answer = {x,y};
return answer;
}
}
|
Main.java:5: error: class main is public, should be declared in a file named main.java
public class main{
^
Main.java:7: error: cannot find symbol
BufferedRender br = new BufferRender(new InputStreamReader(System.in));
^
symbol: class BufferedRender
location: class main
Main.java:7: error: cannot find symbol
BufferedRender br = new BufferRender(new InputStreamReader(System.in));
^
symbol: class BufferRender
location: class main
3 errors
|
s359331633
|
p00012
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferReader(new InputStreamReader(System.in));
String str = br.readLine();
Boolean isNull = str.equals("");
while(!isNull){
String[] datas = str.split(" ",8);
double x1 = Double.parseDouble(datas[0]);
double y1 = Double.parseDouble(datas[1]);
double x2 = Double.parseDouble(datas[2]);
double y2 = Double.parseDouble(datas[3]);
double x3 = Double.parseDouble(datas[4]);
double y3 = Double.parseDouble(datas[5]);
double xp = Double.parseDouble(datas[6]);
double yp = Double.parseDouble(datas[7]);
double x = xp-x1;
double y = yp-y1;
double p = x2-x1;
double q = y2-y1;
double r = x3-x1;
double u = y3-y1;
double[] coefficient = Simultaneous(p,r,x,q,u,y);
double s = coefficient[0];
double t = coefficient[1];
if(s<0||t<0){
System.out.println("NO");
}else if(s+t>0 && s+t<1){
System.out.println("YES");
}else{
System.out.println("NO");
}
str = br.readLine();
isNull = str.equals("");
}
}
private static double[] Simultaneous(double a,double b,double c,double d,double e,double f){
double x = (double) (e*c-b*f)/(a*e-b*d);
double y = (double) (a*f-c*d)/(a*e-b*d);
double[] answer = {x,y};
return answer;
}
}
|
Main.java:5: error: class main is public, should be declared in a file named main.java
public class main{
^
Main.java:7: error: cannot find symbol
BufferedReader br = new BufferReader(new InputStreamReader(System.in));
^
symbol: class BufferReader
location: class main
2 errors
|
s503623453
|
p00012
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
Boolean isNull = str.equals("");
while(!isNull){
String[] datas = str.split(" ",8);
double x1 = Double.parseDouble(datas[0]);
double y1 = Double.parseDouble(datas[1]);
double x2 = Double.parseDouble(datas[2]);
double y2 = Double.parseDouble(datas[3]);
double x3 = Double.parseDouble(datas[4]);
double y3 = Double.parseDouble(datas[5]);
double xp = Double.parseDouble(datas[6]);
double yp = Double.parseDouble(datas[7]);
double x = xp-x1;
double y = yp-y1;
double p = x2-x1;
double q = y2-y1;
double r = x3-x1;
double u = y3-y1;
double[] coefficient = Simultaneous(p,r,x,q,u,y);
double s = coefficient[0];
double t = coefficient[1];
if(s<0||t<0){
System.out.println("NO");
}else if(s+t>0 && s+t<1){
System.out.println("YES");
}else{
System.out.println("NO");
}
str = br.readLine();
isNull = str.equals("");
}
}
private static double[] Simultaneous(double a,double b,double c,double d,double e,double f){
double x = (double) (e*c-b*f)/(a*e-b*d);
double y = (double) (a*f-c*d)/(a*e-b*d);
double[] answer = {x,y};
return answer;
}
}
|
Main.java:5: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s804040510
|
p00012
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class APointInATriangle {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
Boolean isNull = str==null;
while (!isNull) {
String[] datas = str.split(" ", 8);
double x1 = Double.parseDouble(datas[0]);
double y1 = Double.parseDouble(datas[1]);
double x2 = Double.parseDouble(datas[2]);
double y2 = Double.parseDouble(datas[3]);
double x3 = Double.parseDouble(datas[4]);
double y3 = Double.parseDouble(datas[5]);
double xp = Double.parseDouble(datas[6]);
double yp = Double.parseDouble(datas[7]);
double x = xp - x1;
double y = yp - y1;
double p = x2 - x1;
double q = y2 - y1;
double r = x3 - x1;
double u = y3 - y1;
double[] coefficient = Simultaneous(p, r, x, q, u, y);
double s = coefficient[0];
double t = coefficient[1];
if (s < 0 || t < 0) {
System.out.println("NO");
} else if (s + t > 0 && s + t < 1) {
System.out.println("YES");
} else {
System.out.println("NO");
}
str = br.readLine();
isNull = str==null;
}
}
private static double[] Simultaneous(double a, double b, double c,
double d, double e, double f) {
double x = (double) (e * c - b * f) / (a * e - b * d);
double y = (double) (a * f - c * d) / (a * e - b * d);
double[] answer = { x, y };
return answer;
}
}
|
Main.java:5: error: class APointInATriangle is public, should be declared in a file named APointInATriangle.java
public class APointInATriangle {
^
1 error
|
s045577024
|
p00012
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
List<String> list = new ArrayList<String>();
while(scan.hasNext()){
x1 = scan.nextDouble();
y1 = scan.nextDouble();
x2 = scan.nextDouble();
y2 = scan.nextDouble();
x3 = scan.nextDouble();
y3 = scan.nextDouble();
xp = scan.nextDouble();
yp = scan.nextDouble();
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
if(S_abc == S_pab + S_pac + S_pbc){
list.add("YES");
} else{
list.add("NO");
}
}
for(String s : list){
System.out.printf("%s\n", s);
}
}
}
|
Main.java:9: error: cannot find symbol
x1 = scan.nextDouble();
^
symbol: variable x1
location: class Main
Main.java:10: error: cannot find symbol
y1 = scan.nextDouble();
^
symbol: variable y1
location: class Main
Main.java:11: error: cannot find symbol
x2 = scan.nextDouble();
^
symbol: variable x2
location: class Main
Main.java:12: error: cannot find symbol
y2 = scan.nextDouble();
^
symbol: variable y2
location: class Main
Main.java:13: error: cannot find symbol
x3 = scan.nextDouble();
^
symbol: variable x3
location: class Main
Main.java:14: error: cannot find symbol
y3 = scan.nextDouble();
^
symbol: variable y3
location: class Main
Main.java:15: error: cannot find symbol
xp = scan.nextDouble();
^
symbol: variable xp
location: class Main
Main.java:16: error: cannot find symbol
yp = scan.nextDouble();
^
symbol: variable yp
location: class Main
Main.java:17: error: cannot find symbol
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
^
symbol: variable x1
location: class Main
Main.java:17: error: cannot find symbol
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
^
symbol: variable xp
location: class Main
Main.java:17: error: cannot find symbol
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
^
symbol: variable y2
location: class Main
Main.java:17: error: cannot find symbol
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
^
symbol: variable yp
location: class Main
Main.java:17: error: cannot find symbol
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
^
symbol: variable x2
location: class Main
Main.java:17: error: cannot find symbol
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
^
symbol: variable xp
location: class Main
Main.java:17: error: cannot find symbol
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
^
symbol: variable y1
location: class Main
Main.java:17: error: cannot find symbol
double S_pab = Math.abs((x1 - xp) * (y2 - yp) - (x2 - xp) * (y1 - yp));
^
symbol: variable yp
location: class Main
Main.java:18: error: cannot find symbol
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
^
symbol: variable x1
location: class Main
Main.java:18: error: cannot find symbol
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
^
symbol: variable xp
location: class Main
Main.java:18: error: cannot find symbol
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
^
symbol: variable y3
location: class Main
Main.java:18: error: cannot find symbol
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
^
symbol: variable yp
location: class Main
Main.java:18: error: cannot find symbol
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
^
symbol: variable x3
location: class Main
Main.java:18: error: cannot find symbol
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
^
symbol: variable xp
location: class Main
Main.java:18: error: cannot find symbol
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
^
symbol: variable y1
location: class Main
Main.java:18: error: cannot find symbol
double S_pac = Math.abs((x1 - xp) * (y3 - yp) - (x3 - xp) * (y1 - yp));
^
symbol: variable yp
location: class Main
Main.java:19: error: cannot find symbol
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
^
symbol: variable x2
location: class Main
Main.java:19: error: cannot find symbol
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
^
symbol: variable xp
location: class Main
Main.java:19: error: cannot find symbol
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
^
symbol: variable y3
location: class Main
Main.java:19: error: cannot find symbol
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
^
symbol: variable yp
location: class Main
Main.java:19: error: cannot find symbol
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
^
symbol: variable x3
location: class Main
Main.java:19: error: cannot find symbol
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
^
symbol: variable xp
location: class Main
Main.java:19: error: cannot find symbol
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
^
symbol: variable y2
location: class Main
Main.java:19: error: cannot find symbol
double S_pbc = Math.abs((x2 - xp) * (y3 - yp) - (x3 - xp) * (y2 - yp));
^
symbol: variable yp
location: class Main
Main.java:20: error: cannot find symbol
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
^
symbol: variable x3
location: class Main
Main.java:20: error: cannot find symbol
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
^
symbol: variable x1
location: class Main
Main.java:20: error: cannot find symbol
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
^
symbol: variable y2
location: class Main
Main.java:20: error: cannot find symbol
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
^
symbol: variable y1
location: class Main
Main.java:20: error: cannot find symbol
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
^
symbol: variable x2
location: class Main
Main.java:20: error: cannot find symbol
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
^
symbol: variable x1
location: class Main
Main.java:20: error: cannot find symbol
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
^
symbol: variable y3
location: class Main
Main.java:20: error: cannot find symbol
double S_abc = Math.abs((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
^
symbol: variable y1
location: class Main
40 errors
|
s791489042
|
p00012
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
double x1 = scan.nextDouble();
double y1 = scan.nextDouble();
double x2 = scan.nextDouble();
double y2 = scan.nextDouble();
double x3 = scan.nextDouble();
double y3 = scan.nextDouble();
double xp = scan.nextDouble();
double yp = scan.nextDouble();
double S_abc = 1.0 / 2.0 * Math.abs(x1*(y2-y3) + x2*(y3-y1)
+ x3*(y1-y2));
double S_pab = 1.0 / 2.0 * Math.abs(xp*(y1-y2) + x1*(y2-yp)
+ x2*(yp-y1));
double S_pac = 1.0 / 2.0 * Math.abs(xp*(y1-y3) + x1*(y3-yp)
+ x3*(yp-y1));
double S_pbc = 1.0 / 2.0 * Math.abs(xp*(y2-y3) + x2*(y3-yp)
+ x3*(yp-y2));
if(S_abc == S_pab + S_pac + P_pbc){
System.out.println("YES");
} else{
System.out.println("NO");
}
}
}
}
|
Main.java:25: error: cannot find symbol
if(S_abc == S_pab + S_pac + P_pbc){
^
symbol: variable P_pbc
location: class Main
1 error
|
s560970280
|
p00012
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
double[] x = new double[3];
double[] y = new double[3];
for(int i = 0; i < 3; i++){
x[i] = scan.nextDouble();
y[i] = scan.nextdouble();
}
double xp = scan.nextDouble();
double yp = scan.nextDouble();
for(int i = 0; i < 3; i++){
x[i] = x[i] - xp;
y[i] = y[i] - yp;
}
double[] gaiseki = new double[3];
gaiseki[0] = x[0]*y[1] - y[0]*x[1];
gaiseki[1] = x[1]*y[2] - y[2]*x[1];
gaiseki[2] = x[2]*y[0] - y[2]*x[0];
int plus = 0;
int minus = 0;
for(int i = 0; i < 3; i++){
if(gaiseki[i] > 0)plus++;
if(gaiseki[i] < 0)minus++;
}
String ans = "NO";
if(plus == 3 || minus == 3)ans = "YES";
System.out.printf("%s\n", ans);
}
}
}
|
Main.java:12: error: cannot find symbol
y[i] = scan.nextdouble();
^
symbol: method nextdouble()
location: variable scan of type Scanner
1 error
|
s001925355
|
p00012
|
Java
|
import java.util.*;
public class V0p012 {
Scanner sc;
void run() {
sc = new Scanner(System.in);
Point[] a = new Point [4];
while (sc.hasNext()){
for (int i=0;i<4;i++) {
double x = sc.nextDouble();
double y = sc.nextDouble();
a[i] = new Point(x,y);
}
Line[] l = new Line[3];
Line[] lc = new Line [3];
boolean flg = true;
for (int i=0;i<3;i++) {
l[i] = new Line(a[i%3], a[(i+1)%3]);
lc[i] = new Line(a[(i+2)%3], a[3]);
if (l[i].judgeCloss(lc[i])) {
flg = false;
break;
}
}
if (flg)
System.out.println("YES");
else System.out.println("NO");
}
}
public static void main(String[] args) {
new V0p012().run();
}
}
class Point {
private double x;
private double y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public double getX(){
return x;
}
public double getY() {
return y;
}
}
class Line {
Point a1;
Point a2;
public Line (Point a, Point b) {
a1 = a;
a2 = b;
}
public Point getS() {
return a1;
}
public Point getE() {
return a2;
}
public boolean judgeCloss(Line l) {
double a = ( (a1.getY() - l.getS().getY()) * (l.getS().getX() - l.getE().getX() - (l.getS().getY() - l.getE().getY()) * (a1.getX() - l.getS().getX())) );
double b = ( (a2.getY() - l.getS().getY()) * (l.getS().getX() - l.getE().getX() - (l.getS().getY() - l.getE().getY()) * (a2.getX() - l.getS().getX())) );
System.out.println( a + " " + b );
if (a*b >= 0)
return false;
else return true;
}
}
|
Main.java:4: error: class V0p012 is public, should be declared in a file named V0p012.java
public class V0p012 {
^
1 error
|
s268441081
|
p00012
|
Java
|
import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
void run() {
while ( sc.hasNext() ) {
Point[] p = new Point[4];
for(int i=0;i<4;i++) {
p[i] = new Point( sc.nextDouble(),sc.nextDouble() );
}
if(!isInner(p[0], p[1], p[2], p[3])) System.out.println("NO");
else System.out.println("YES");
}
}
boolean isInner(Point a, Point b, Point c, Point p) {
if( p.sub(a).mult(b.sub(a)) > 0.0 ) return false;
if( p.sub(b).mult(c.sub(b)) > 0.0 ) return false;
if( p.sub(c).mult(a.sub(c)) > 0.0 ) return false;
return true;
}
public static void main(String[] args) {
new Main.run();
}
class Point {
double x,y;
Point (double x, double y) {
this.x = x;
this.y = y;
}
Point sub(Point p) {
return new Point(x-p.x, y-p.y);
}
double mult(Point p) {
return x*p.y-y*p.x;
}
}
}
|
Main.java:26: error: cannot find symbol
new Main.run();
^
symbol: class run
location: class Main
1 error
|
s014429971
|
p00012
|
Java
|
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main
{
public static void main(String[] arg) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s;
while((s=br.readLine())!=null){
double x1 = Double.parseDouble(s.split(" ")[0]);
double y1 = Double.parseDouble(s.split(" ")[1]);
double x2 = Double.parseDouble(s.split(" ")[2]);
double y2 = Double.parseDouble(s.split(" ")[3]);
double x3 = Double.parseDouble(s.split(" ")[4]);
double y3 = Double.parseDouble(s.split(" ")[5]);
double xp = Double.parseDouble(s.split(" ")[6]);
double yp = Double.parseDouble(s.split(" ")[7]);
if(inTriangle(x1,y1,x2,y2,x3,y3,xp,yp)) System.out.println("YES");
else System.out.println("NO");
}
}
private static boolean inTriangle(double x1, double y1, double x2, double y2, double x3, double y3, double xp, double yp)
{
// equation -> y = [0]x + [1]
double[] eq12 = new double[2];
double[] eq13 = new double[2];
double[] eq23 = new double[2];
eq12[0] = (y2-y1) / (x2-x1);
eq12[1] = y1 - x1 * eq12[0];
eq13[0] = (y3-y1) / (x3-x1);
eq13[1] = y1 - x1 * eq13[0];
eq23[0] = (y3-y2) / (x3-x2);
eq23[1] = y2 - x2 * eq23[0];
if(yp > (eq12[0] * xp + eq12[1])) {
if(y3 < (eq12[0] * x3 + eq12[1])) return false;
} else
if(y3 > (eq12[0] * x3 + eq12[1])) return false;
if(yp > (eq13[0] * xp + eq13[1])) {
if(y2 < (eq13[0] * x2 + eq13[1])) return false;
} else
if(y2 > (eq13[0] * x2 + eq13[1])) return false;
if(yp > (eq23[0] * xp + eq23[1])) {
if(y1 < (eq23[0] * x1 + eq23[1])) return false;
} else
if(y1 > (eq23[0] * x1 + eq23[1])) return false;
return true;
}
}
|
Main.java:23: error: illegal character: '\u3000'
else ?System.out.println("NO");
^
1 error
|
s910772220
|
p00012
|
Java
|
import java.util.Scanner;
public class main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
double xa,ya,xb,yb,xc,yc,xp,yp;
double abc, abp, bcp, cap;
xa = sc.nextDouble();
ya = sc.nextDouble();
xb = sc.nextDouble();
yb = sc.nextDouble();
xc = sc.nextDouble();
yc = sc.nextDouble();
xp = sc.nextDouble();
yp = sc.nextDouble();
abc = calculate_area(xa,ya,xb,yb,xc,yc);
abp = calculate_area(xa,ya,xb,yb,xp,yp);
bcp = calculate_area(xb,yb,xc,yc,xp,yp);
cap = calculate_area(xc,yc,xa,ya,xp,yp);
System.out.println(abc +"\n"+ abp +"\n"+ bcp +"\n"+ cap);
if(abc-(abp+bcp+cap) == 0){
System.out.println("YES");
} else {
System.out.println("NO");
}
}
static double calculate_area(double x1, double y1, double x2, double y2, double x3, double y3){
double result;
result = 0.5 * ((x3-x1)*(y2-y1)-(y3-y1)*(x2-x1));
if(result < 0) result*=-1;
return result;
}
}
|
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s647237616
|
p00012
|
C
|
#iclude<stdio.h>
int main()
{
double x1,y1,x2,y2,x3,y3,xp,yp,maxx=0,maxy=0,minx=0,miny=0;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
{
maxx=x1;
if(x2>max)
maxx=x2;
else if(x3>max)
maxx=x3;
}
{
minx=x1;
if(x2<minx)
minx=x2;
else if(x3<minx)
minx=x3;
}
{
maxy=y1;
if(y2>max)
maxy=y2;
else if(y3>max)
maxy=y3;
}
{
miny=y1;
if(y2<miny)
miny=y2;
else if(y3<miny)
miny=y3;
}
if(xp<maxx && xp>minx &&yp<maxy && yp>miny)
puts("YES");
else
puts("NO");
return 0;
}
|
main.c:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
1 | #iclude<stdio.h>
| ^~~~~~
| include
main.c: In function 'main':
main.c:5:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #iclude<stdio.h>
main.c:5:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
5 | while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
| ^~~~~
main.c:5:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:89: error: 'EOF' undeclared (first use in this function)
5 | while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
| ^~~
main.c:5:89: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:5:89: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:23: error: 'max' undeclared (first use in this function); did you mean 'maxy'?
8 | if(x2>max)
| ^~~
| maxy
main.c:38:25: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
38 | puts("YES");
| ^~~~
main.c:38:25: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:43:1: error: expected declaration or statement at end of input
43 | }
| ^
|
s866735902
|
p00012
|
C
|
#include <stdio.h>
int sign(double x);
int main(void)
{
double x1, y1, x2, y2, x3, y3;
double xp, yp;
double vec12_x_vec1p, vec23_x_vec2p, vec31_x_vec3p_g3;
int judge;
while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
&x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
vec12_x_vec1p = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1);
vec23_x_vec2p = (x3 - x2) * (yp - y2) - (y3 - y2) * (xp - x2);
vec31_x_vec3p = (x1 - x3) * (yp - y3) - (y1 - y3) * (xp - x3);
judge = sign(vec12_x_vec1p) + sign(vec23_x_vec2p) + sign(vec31_x_vec3p);
if (judge == 1 + 1 + 1 || judge == -1 - 1 - 1) {
printf("YES\n");
} else {
printf("NO\n");
}
}
return 0;
}
int sign(double x)
{
if (x >= 0) {
return 1;
} else {
return -1;
}
}
|
main.c: In function 'main':
main.c:17:9: error: 'vec31_x_vec3p' undeclared (first use in this function); did you mean 'vec31_x_vec3p_g3'?
17 | vec31_x_vec3p = (x1 - x3) * (yp - y3) - (y1 - y3) * (xp - x3);
| ^~~~~~~~~~~~~
| vec31_x_vec3p_g3
main.c:17:9: note: each undeclared identifier is reported only once for each function it appears in
|
s497198086
|
p00012
|
C
|
#include <stdio.h>
int main(void)
{
double x1,x2,x3,xp,y1,y2,y3,yp,v1,v2,v3;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
v1=(x2-x1)*(xp-x1)+(y2-y1)*(yp-y1);
v2=(x3-x2)*(xp-x2)+(y3-y2)*(yp-y2);
v3=(x1-x3)*(xp-x3)+(y1-y3)*(yp-y3);
if((v1>0 && v2>0 && v3>0) printf("YES\n");
else if(v1<0 && v2<0 && v3<0) printf("YES\n");
else printf("NO\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:10:42: error: expected ')' before 'printf'
10 | if((v1>0 && v2>0 && v3>0) printf("YES\n");
| ~ ^~~~~~~
| )
main.c:13:9: error: expected expression before '}' token
13 | }
| ^
|
s751984973
|
p00012
|
C
|
#include <stdio.h>
int main(void)
{
double x1,x2,x3,xp,y1,y2,y3,yp,v1,v2,v3;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
v1=(x2-x1)*(xp-x1)+(y2-y1)*(yp-y1);
v2=(x3-x2)*(xp-x2)+(y3-y2)*(yp-y2);
v3=(x1-x3)*(xp-x3)+(y1-y3)*(yp-y3);
if(v1>0 && v2>0 && v3>0) printf("YES\n");
else if(v1<0 && v2<0 && v3<0) printf("YES\n");
else if(v1=0 && v2=0 && v3=0) printf("YES\n");
else printf("NO\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:12:43: error: lvalue required as left operand of assignment
12 | else if(v1=0 && v2=0 && v3=0) printf("YES\n");
| ^
|
s822929421
|
p00012
|
C
|
#include<stdio.h>
int main() {
double a, b, c, p1[2], p2[2], p3[2], pp[2];
while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &p1[0], &p1[1], &p2[0], &p2[1], &p3[0], &p3[1], &pp[0], &pp[1]) != EOF) {
a = p2[1] - p1[1]; b = p1[0] - p2[0]; c = p2[0] * p1[1] - p1[0] * p2[1];
if ((a * p3[0] + b * p3[1] + c) * (a * pp[0] + b * pp[1] + c) > 0) {
a = p3[1] - p2[1]; b = p2[0] - p3[0]; c = p3[0] * p2[1] - p2[0] * p3[1];
if ((a * p1[0] + b * p1[1] + c) * (a * pp[0] + b * pp[1] + c) > 0) {
a = p3[1] - p1[1]; b = p1[0] - p3[0]; c = p3[0] * p1[1] - p1[0] * p3[1];
if ((a * p2[0] + b * p2[1] + c) * (a * pp[0] + b * pp[1] + c) > 0) {
printf("YES\n");
} else {
printf("NO\n");
} else {
printf("NO\n");
}
} else {
printf("NO\n");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:14:9: error: expected '}' before 'else'
14 | } else {
| ^~~~
|
s721808750
|
p00012
|
C
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define DEBUG
#define POINT_NUMBER 8
double get_area(double x1, double x2, double x3, double y1, double y2, double y3);
main()
{
double x1, y1, x2, y2, x3, y3, px, py;
while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py) != EOF)
{
double abp = get_area(x1, y1, x2, y2, px, py);
double bcp = get_area(x2, y2, x3, y3, px, py);
double cap = get_area(x3, y3, x1, y1, px, py);
double abc = get_area(x1, y1, x2, y2, x3, y3);
}
#ifdef DEBUG
printf("%lf\n%lf\n%lf\n%lf\n", abp, bcp, cap, abc);
#endif
if(abc == (abp + bcp + cap))
{
printf("YES\n");
}
else
{
printf("NO\n");
}
return 0;
}
double get_area(double x1, double y1, double x2, double y2, double x3, double y3)
{
double area;
area = (y1 * (x2 - x3) + y2 * (x3 - x1) + y3 * (x1 - x2)) / 2;
area = area * area;
area = sqrt(area);
return area;
}
|
main.c:11:1: error: return type defaults to 'int' [-Wimplicit-int]
11 | main()
| ^~~~
main.c: In function 'main':
main.c:23:40: error: 'abp' undeclared (first use in this function); did you mean 'abs'?
23 | printf("%lf\n%lf\n%lf\n%lf\n", abp, bcp, cap, abc);
| ^~~
| abs
main.c:23:40: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:45: error: 'bcp' undeclared (first use in this function)
23 | printf("%lf\n%lf\n%lf\n%lf\n", abp, bcp, cap, abc);
| ^~~
main.c:23:50: error: 'cap' undeclared (first use in this function)
23 | printf("%lf\n%lf\n%lf\n%lf\n", abp, bcp, cap, abc);
| ^~~
main.c:23:55: error: 'abc' undeclared (first use in this function); did you mean 'abs'?
23 | printf("%lf\n%lf\n%lf\n%lf\n", abp, bcp, cap, abc);
| ^~~
| abs
|
s273173401
|
p00012
|
C
|
#include<stdio.h>
#include<math.h>
int main( void )
{
double x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;
double xp = 0, yp = 0;
double sum = 0, s = 0, s1 = 0, s2 = 0, s3 = 0;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF)
{
s = fabs(((x1 * y2) + (x2 * y3) + (x3 * y1) - (y1 * x2) - (y2 * x3) - (y3 * x1)) / 2.0
s1 = fabs(((x1 * y2) + (x2 * yp) + (xp * y1) - (y1 * x2) - (y2 * xp) - (yp * x1))/2.0
s2 = fabs(((xp * y2) + (x2 * y3) + (x3 * yp) - (yp * x2) - (y2 * x3) - (y3 * xp))/2.0
s3 = fabs(((x1 * yp) + (xp * y3) + (x3 * y1) - (y1 * xp) - (yp * x3) - (y3 * x1))/2.0
sum = s1 + s2 + s3;
if((0.0 <= fabs(s - sum) && fabs(s - sum) < 0.001) && ( s1 != 0 && s2 != 0 && s3 != 0))
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:14:103: error: expected ')' before 's1'
14 | s = fabs(((x1 * y2) + (x2 * y3) + (x3 * y1) - (y1 * x2) - (y2 * x3) - (y3 * x1)) / 2.0
| ~ ^
| )
15 |
16 | s1 = fabs(((x1 * y2) + (x2 * yp) + (xp * y1) - (y1 * x2) - (y2 * xp) - (yp * x1))/2.0
| ~~
main.c:32:1: error: expected declaration or statement at end of input
32 | }
| ^
main.c:32:1: error: expected declaration or statement at end of input
|
s069463565
|
p00012
|
C
|
#include <stdio.h>
#include<math.h>
struct Vector {
double x;
double y;
};
struct Vector sub_vector(struct Vector a, struct Vector b) {
struct Vector ret;
ret.x = a.x - b.x;
ret.y = a.y - b.y;
return ret;
}
int main(void)
{
struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
struct Vector vecAB,vecBP, vecBC,vecCP,vecCA,vecAP;
double c0, c1, c2;
while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&a1.x,&a1.y,&b2.x,&b2.y,&c3.x,&c3.y,&dp.x,&dp.y) != EOF) {
vecAB = sub_vector(b2,a1);
vecBP = sub_vector(dp, b2);
vecBC = sub_vector(c3, b2);
vecCP = sub_vector(dp, c3);
vecCA = sub_vector(a1, c3);
vecAP = sub_vector(dp, a1);
c0 = vecAB.x * vecBP.y - vecAB.y * vecBP.x;
c1 = vecBC.x * vecCP.y - vecBC.y * vecCP.x;
c2 = vecCA.x * vecAP.y - vecCA.y * vecAP.x;
if ((c0 > 0 && c1 > 0 && c2 > 0) || (c0 < 0 && c1 < 0 && c2 < 0))
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:17:39: error: redeclaration of 'a1' with no linkage
17 | struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
| ^~
main.c:17:23: note: previous declaration of 'a1' with type 'struct Vector'
17 | struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
| ^~
main.c:17:43: error: redeclaration of 'b2' with no linkage
17 | struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
| ^~
main.c:17:27: note: previous declaration of 'b2' with type 'struct Vector'
17 | struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
| ^~
main.c:17:47: error: redeclaration of 'c3' with no linkage
17 | struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
| ^~
main.c:17:31: note: previous declaration of 'c3' with type 'struct Vector'
17 | struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
| ^~
main.c:17:51: error: redeclaration of 'dp' with no linkage
17 | struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
| ^~
main.c:17:35: note: previous declaration of 'dp' with type 'struct Vector'
17 | struct Vector a1, b2, c3, dp, a1, b2, c3, dp;
| ^~
|
s486605250
|
p00012
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{
int n;
int i;
double x1, y1, x2, y2, x3, y3;
double a, b, c, d, e, f;
double px, py, r;
scanf("%d",&n);
for(i=0; i<n; i++)
{
scanf("%lf%lf%lf%lf%lf%lf",&x1, &y1, &x2, &y2, &x3, &y3);
a = 2 * (x1 -x2);
b = 2 * (y1 -y2);
c = 2 * (x1 -x3);
d = 2 * (y1 -y3);
e = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
f = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
px = (d * e - b * f) / (a * d - b * c);
py = (a * f - c * e) / (a * d - b * c);
r = sqrt((x1 - px) * (x1 - px) + (y1 - py) * (y1 - py));
printf("%.3f %.3f %.3f\n", px, py, r);
if(islessequal(distance, 0.001))
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
}
|
In file included from main.c:2:
main.c: In function 'main':
main.c:31:32: error: 'distance' undeclared (first use in this function)
31 | if(islessequal(distance, 0.001))
| ^~~~~~~~
main.c:31:32: note: each undeclared identifier is reported only once for each function it appears in
|
s755284083
|
p00012
|
C
|
#include
#include
int debug=0;
int main(void){
ツ ツ double ax, ay, bx, by, cx, cy, px, py;
ツ ツ double a, b, c, ap, bp, cp;
ツ ツ double tmp;
ツ ツ double s2, sa2, sb2, sc2;
ツ ツ double s, sa, sb, sc;
ツ ツ while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy, &px, &py) != -1){
ツ ツ ツ ツ //ツ各ツ静シツ閉ェツづ個陳キツつウツづーツ計ツ算
ツ ツ ツ ツ a = sqrt(fabs((bx - cx) * (bx - cx) + (by - cy) * (by- cy)));
ツ ツ ツ ツ b = sqrt(fabs((ax - cx) * (ax - cx) + (ay - cy) * (ay- cy)));
ツ ツ ツ ツ c = sqrt(fabs((ax - bx) * (ax - bx) + (ay - by) * (ay- by)));
ツ ツ ツ ツ ap = sqrt(fabs((ax - px) * (ax - px) + (ay - py) * (ay- py)));
ツ ツ ツ ツ bp = sqrt(fabs((bx - px) * (bx - px) + (by - py) * (by- py)));
ツ ツ ツ ツ cp = sqrt(fabs((cx - px) * (cx - px) + (cy - py) * (cy- py)));
ツ ツ ツ ツ if(debug) printf("[length]a = %.2f, b == %.2f, c = %.2f, ap = %.2f, bp = %.2f, cp = %.2f\n", a, b, c, ap, bp, cp);
ツ ツ ツ ツ //heron
ツ ツ ツ ツ tmp = (a + b + c) / 2;
ツ ツ ツ ツ s2 = tmp * (tmp - a) * (tmp - b) * (tmp - c);
ツ ツ ツ ツ s = sqrt(s2);
ツ ツ ツ ツ if(debug) printf("s = %lf\n", s);
ツ ツ ツ ツ tmp = (a + bp + cp) / 2;
ツ ツ ツ ツ sa2 = tmp * (tmp - a) * (tmp - bp) * (tmp - cp);
ツ ツ ツ ツ sa = sqrt(sa2);
ツ ツ ツ ツ tmp = (b + ap + cp) / 2;
ツ ツ ツ ツ sb2 = tmp * (tmp - b) * (tmp - ap) * (tmp - cp);
ツ ツ ツ ツ sb = sqrt(sb2);
ツ ツ ツ ツ tmp = (c + ap + bp) / 2;
ツ ツ ツ ツ sc2 = tmp * (tmp - c) * (tmp - ap) * (tmp - bp);
ツ ツ ツ ツ sc = sqrt(sc2);
ツ ツ ツ ツ if(debug) printf("sa + sb + sc = %lf\n", sa + sb + sc);
ツ ツ ツ ツ if(fabs(sa + sb + sc - s) < 0.000000001){
ツ ツ ツ ツ ツ ツ printf("YES\n");
ツ ツ ツ ツ }else{
ツ ツ ツ ツ ツ ツ printf("NO\n");
ツ ツ ツ ツ }
ツ ツ }
ツ ツ return 0;
}
|
main.c:1:10: error: #include expects "FILENAME" or <FILENAME>
1 | #include
| ^
main.c:2:10: error: #include expects "FILENAME" or <FILENAME>
2 | #include
| ^
main.c: In function 'main':
main.c:7:3: error: stray '\343' in program
7 | <U+30C4><U+3000><U+30C4><U+3000>double ax, ay, bx, by, cx, cy, px, py;
| ^~~~~~~~
main.c:7:1: error: unknown type name '\U000030c4'
7 | ツ ツ double ax, ay, bx, by, cx, cy, px, py;
| ^~
main.c:7:7: error: stray '\343' in program
7 | <U+30C4><U+3000><U+30C4><U+3000>double ax, ay, bx, by, cx, cy, px, py;
| ^~~~~~~~
main.c:7:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'double'
7 | ツ ツ double ax, ay, bx, by, cx, cy, px, py;
| ^~~~~~
main.c:8:3: error: stray '\343' in program
8 | <U+30C4><U+3000><U+30C4><U+3000>double a, b, c, ap, bp, cp;
| ^~~~~~~~
main.c:8:1: error: unknown type name '\U000030c4'
8 | ツ ツ double a, b, c, ap, bp, cp;
| ^~
main.c:8:7: error: stray '\343' in program
8 | <U+30C4><U+3000><U+30C4><U+3000>double a, b, c, ap, bp, cp;
| ^~~~~~~~
main.c:8:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'double'
8 | ツ ツ double a, b, c, ap, bp, cp;
| ^~~~~~
main.c:9:3: error: stray '\343' in program
9 | <U+30C4><U+3000><U+30C4><U+3000>double tmp;
| ^~~~~~~~
main.c:9:1: error: unknown type name '\U000030c4'
9 | ツ ツ double tmp;
| ^~
main.c:9:7: error: stray '\343' in program
9 | <U+30C4><U+3000><U+30C4><U+3000>double tmp;
| ^~~~~~~~
main.c:9:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'double'
9 | ツ ツ double tmp;
| ^~~~~~
main.c:10:3: error: stray '\343' in program
10 | <U+30C4><U+3000><U+30C4><U+3000>double s2, sa2, sb2, sc2;
| ^~~~~~~~
main.c:10:1: error: unknown type name '\U000030c4'
10 | ツ ツ double s2, sa2, sb2, sc2;
| ^~
main.c:10:7: error: stray '\343' in program
10 | <U+30C4><U+3000><U+30C4><U+3000>double s2, sa2, sb2, sc2;
| ^~~~~~~~
main.c:10:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'double'
10 | ツ ツ double s2, sa2, sb2, sc2;
| ^~~~~~
main.c:11:3: error: stray '\343' in program
11 | <U+30C4><U+3000><U+30C4><U+3000>double s, sa, sb, sc;
| ^~~~~~~~
main.c:11:1: error: unknown type name '\U000030c4'
11 | ツ ツ double s, sa, sb, sc;
| ^~
main.c:11:7: error: stray '\343' in program
11 | <U+30C4><U+3000><U+30C4><U+3000>double s, sa, sb, sc;
| ^~~~~~~~
main.c:11:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'double'
11 | ツ ツ double s, sa, sb, sc;
| ^~~~~~
main.c:13:3: error: stray '\343' in program
13 | <U+30C4><U+3000><U+30C4><U+3000>while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy, &px, &py) != -1){
| ^~~~~~~~
main.c:13:1: error: unknown type name '\U000030c4'
13 | ツ ツ while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy, &px, &py) != -1){
| ^~
main.c:13:7: error: stray '\343' in program
13 | <U+30C4><U+3000><U+30C4><U+3000>while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy, &px, &py) != -1){
| ^~~~~~~~
main.c:13:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'while'
13 | ツ ツ while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy, &px, &py) != -1){
| ^~~~~
main.c:14:3: error: stray '\343' in program
14 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>//<U+30C4><U+5404><U+30C4><U+9759><U+30B7><U+30C4><U+9589><U+30A7><U+30C4><U+3065><U+500B><U+9673><U+30AD><U+30C4><U+3064><U+30A6><U+30C4><U+3065><U+30FC><U+30C4><U+8A08><U+30C4><U+7B97>
| ^~~~~~~~
main.c:14:7: error: stray '\343' in program
14 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>//<U+30C4><U+5404><U+30C4><U+9759><U+30B7><U+30C4><U+9589><U+30A7><U+30C4><U+3065><U+500B><U+9673><U+30AD><U+30C4><U+3064><U+30A6><U+30C4><U+3065><U+30FC><U+30C4><U+8A08><U+30C4><U+7B97>
| ^~~~~~~~
main.c:14:11: error: stray '\343' in program
14 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>//<U+30C4><U+5404><U+30C4><U+9759><U+30B7><U+30C4><U+9589><U+30A7><U+30C4><U+3065><U+500B><U+9673><U+30AD><U+30C4><U+3064><U+30A6><U+30C4><U+3065><U+30FC><U+30C4><U+8A08><U+30C4><U+7B97>
| ^~~~~~~~
main.c:14:15: error: stray '\343' in program
14 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>//<U+30C4><U+5404><U+30C4><U+9759><U+30B7><U+30C4><U+9589><U+30A7><U+30C4><U+3065><U+500B><U+9673><U+30AD><U+30C4><U+3064><U+30A6><U+30C4><U+3065><U+30FC><U+30C4><U+8A08><U+30C4><U+7B97>
| ^~~~~~~~
main.c:15:3: error: stray '\343' in program
15 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>a = sqrt(fabs((bx - cx) * (bx - cx) + (by - cy) * (by- cy)));
| ^~~~~~~~
main.c:15:7: error: stray '\343' in program
15 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>a = sqrt(fabs((bx - cx) * (bx - cx) + (by - cy) * (by- cy)));
| ^~~~~~~~
main.c:15:11: error: stray '\343' in program
15 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>a = sqrt(fabs((bx - cx) * (bx - cx) + (by - cy) * (by- cy)));
| ^~~~~~~~
main.c:15:15: error: stray '\343' in program
15 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>a = sqrt(fabs((bx - cx) * (bx - cx) + (by - cy) * (by- cy)));
| ^~~~~~~~
main.c:16:3: error: stray '\343' in program
16 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>b = sqrt(fabs((ax - cx) * (ax - cx) + (ay - cy) * (ay- cy)));
| ^~~~~~~~
main.c:16:7: error: stray '\343' in program
16 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>b = sqrt(fabs((ax - cx) * (ax - cx) + (ay - cy) * (ay- cy)));
| ^~~~~~~~
main.c:16:11: error: stray '\343' in program
16 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>b = sqrt(fabs((ax - cx) * (ax - cx) + (ay - cy) * (ay- cy)));
| ^~~~~~~~
main.c:16:15: error: stray '\343' in program
16 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>b = sqrt(fabs((ax - cx) * (ax - cx) + (ay - cy) * (ay- cy)));
| ^~~~~~~~
main.c:17:3: error: stray '\343' in program
17 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>c = sqrt(fabs((ax - bx) * (ax - bx) + (ay - by) * (ay- by)));
| ^~~~~~~~
main.c:17:7: error: stray '\343' in program
17 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>c = sqrt(fabs((ax - bx) * (ax - bx) + (ay - by) * (ay- by)));
| ^~~~~~~~
main.c:17:11: error: stray '\343' in program
17 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>c = sqrt(fabs((ax - bx) * (ax - bx) + (ay - by) * (ay- by)));
| ^~~~~~~~
main.c:17:15: error: stray '\343' in program
17 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>c = sqrt(fabs((ax - bx) * (ax - bx) + (ay - by) * (ay- by)));
| ^~~~~~~~
main.c:18:3: error: stray '\343' in program
18 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>ap = sqrt(fabs((ax - px) * (ax - px) + (ay - py) * (ay- py)));
| ^~~~~~~~
main.c:18:7: error: stray '\343' in program
18 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>ap = sqrt(fabs((ax - px) * (ax - px) + (ay - py) * (ay- py)));
| ^~~~~~~~
main.c:18:11: error: stray '\343' in program
18 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>ap = sqrt(fabs((ax - px) * (ax - px) + (ay - py) * (ay- py)));
| ^~~~~~~~
main.c:18:15: error: stray '\343' in program
18 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>ap = sqrt(fabs((ax - px) * (ax - px) + (ay - py) * (ay- py)));
| ^~~~~~~~
main.c:19:3: error: stray '\343' in program
19 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>bp = sqrt(fabs((bx - px) * (bx - px) + (by - py) * (by- py)));
| ^~~~~~~~
main.c:19:7: error: stray '\343' in program
19 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>bp = sqrt(fabs((bx - px) * (bx - px) + (by - py) * (by- py)));
| ^~~~~~~~
main.c:19:11: error: stray '\343' in program
19 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>bp = sqrt(fabs((bx - px) * (bx - px) + (by - py) * (by- py)));
| ^~~~~~~~
main.c:19:15: error: stray '\343' in program
19 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>bp = sqrt(fabs((bx - px) * (bx - px) + (by - py) * (by- py)));
| ^~~~~~~~
main.c:20:3: error: stray '\343' in program
20 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>cp = sqrt(fabs((cx - px) * (cx - px) + (cy - py) * (cy- py)));
| ^~~~~~~~
main.c:20:7: error: stray '\343' in program
20 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>cp = sqrt(fabs((cx - px) * (cx - px) + (cy - py) * (cy- py)));
| ^~~~~~~~
main.c:20:11: error: stray '\343' in program
20 | <U+30C4><U+3000><U+30C4><U+3000><U
|
s829619472
|
p00012
|
C
|
main(){for(float d,e,f,g,h,i,m,n;~scanf("%f%f%f%f%f%f%f%f",&d,&e,&f,&g,&h,&i,&m,&n);puts((f-d)*(n-e)*(f=(h-f)*(n-g)-(m-f)*(i-g))>f*(m-d)*(g-e)&f*(d-h)*(n-i)>f*(m-h)*(e-i)?"YES":"NO"));}
|
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){for(float d,e,f,g,h,i,m,n;~scanf("%f%f%f%f%f%f%f%f",&d,&e,&f,&g,&h,&i,&m,&n);puts((f-d)*(n-e)*(f=(h-f)*(n-g)-(m-f)*(i-g))>f*(m-d)*(g-e)&f*(d-h)*(n-i)>f*(m-h)*(e-i)?"YES":"NO"));}
| ^~~~
main.c: In function 'main':
main.c:1:35: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(){for(float d,e,f,g,h,i,m,n;~scanf("%f%f%f%f%f%f%f%f",&d,&e,&f,&g,&h,&i,&m,&n);puts((f-d)*(n-e)*(f=(h-f)*(n-g)-(m-f)*(i-g))>f*(m-d)*(g-e)&f*(d-h)*(n-i)>f*(m-h)*(e-i)?"YES":"NO"));}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(){for(float d,e,f,g,h,i,m,n;~scanf("%f%f%f%f%f%f%f%f",&d,&e,&f,&g,&h,&i,&m,&n);puts((f-d)*(n-e)*(f=(h-f)*(n-g)-(m-f)*(i-g))>f*(m-d)*(g-e)&f*(d-h)*(n-i)>f*(m-h)*(e-i)?"YES":"NO"));}
main.c:1:35: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(){for(float d,e,f,g,h,i,m,n;~scanf("%f%f%f%f%f%f%f%f",&d,&e,&f,&g,&h,&i,&m,&n);puts((f-d)*(n-e)*(f=(h-f)*(n-g)-(m-f)*(i-g))>f*(m-d)*(g-e)&f*(d-h)*(n-i)>f*(m-h)*(e-i)?"YES":"NO"));}
| ^~~~~
main.c:1:35: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:85: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | main(){for(float d,e,f,g,h,i,m,n;~scanf("%f%f%f%f%f%f%f%f",&d,&e,&f,&g,&h,&i,&m,&n);puts((f-d)*(n-e)*(f=(h-f)*(n-g)-(m-f)*(i-g))>f*(m-d)*(g-e)&f*(d-h)*(n-i)>f*(m-h)*(e-i)?"YES":"NO"));}
| ^~~~
main.c:1:85: note: include '<stdio.h>' or provide a declaration of 'puts'
|
s977230389
|
p00012
|
C
|
using System;
using System.Collections.Generic;
using System.Linq;
namespace AOJ
{
class Point
{
public double X { get; private set; }
public double Y { get; private set; }
public Point(double x, double y)
{
X = x;
Y = y;
}
public static Point operator+ (Point p1, Point p2)
{
return new Point(p1.X + p2.X, p1.Y + p2.Y);
}
public static Point operator- (Point p1, Point p2)
{
return new Point(p1.X - p2.X, p1.Y - p2.Y);
}
}
class Program
{
public static void Main()
{
foreach (var points in ReadPoints())
{
if (IsInTriangle(points[0], points[1], points[2], points[3]))
Console.WriteLine("YES");
else
Console.WriteLine("NO");
}
}
static IEnumerable<Point[]> ReadPoints()
{
string line;
while ((line = Console.ReadLine()) != null)
yield return line.Split(' ').Select((s, i) => new { Index = i, Value = double.Parse(s) })
.GroupBy(x => x.Index / 2)
.Select(x => x.Select(v => v.Value))
.Select(x => new Point(x.First(), x.Skip(1).First()))
.ToArray();
}
static bool IsInTriangle(Point a, Point b, Point c, Point p)
{
var center = new Point((a.X + b.X + c.X) / 3.0, (a.Y + b.Y + c.Y) / 3.0);
if (IntersectionLine(a, b, p, center)
|| IntersectionLine(a, c, p, center)
|| IntersectionLine(b, c, p, center)) return false;
return true;
}
static bool IntersectionLine(Point a1, Point a2, Point b1, Point b2)
{
return ((a1.X - a2.X) * (b1.Y - a1.Y) + (a1.Y - a2.Y) * (a1.X - b1.X))
* ((a1.X - a2.X) * (b2.Y - a1.Y) + (a1.Y - a2.Y) * (a1.X - b2.X)) < 0;
}
}
}
|
main.c:1:1: error: unknown type name 'using'
1 | using System;
| ^~~~~
main.c:2:1: error: unknown type name 'using'
2 | using System.Collections.Generic;
| ^~~~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
2 | using System.Collections.Generic;
| ^
main.c:3:1: error: unknown type name 'using'
3 | using System.Linq;
| ^~~~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
3 | using System.Linq;
| ^
main.c:5:1: error: unknown type name 'namespace'
5 | namespace AOJ
| ^~~~~~~~~
main.c:6:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
6 | {
| ^
|
s678247377
|
p00012
|
C
|
#include <stdio.h>
double hantei(double,double,double,double,double,double,double,double);
int main(){
double x1,x2,x3,y1,y2,y3,xp,yp;
double heix,heiy;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
f=0;
heix=(x1+x2+x3)/3;
heiy=(y1+y2+y3)/3;
if(hantei(x1,y1,x2,y2,xp,yp,heix,heiy)<0.0){
f=1;
}
if(hantei(x1,y1,x3,y3,xp,yp,heix,heiy)<0.0){
f=1;
}
if(hantei(x2,y2,x3,y3,xp,yp,heix,heiy)<0.0){
f=1;
}
if(f==1){
printf("NO\n");
}
else if(f==0){
printf("YES\n");
}
}
return 0;
}
double hantei(double p1x,double p1y,double p2x,double p2y,double p3x,double p3y,double p4x,double p4y)
{
double a;
a=((p1x-p2x)*(p3y-p1y)+(p1y-p2y)*(p1x-p3x))*((p1x-p2x)*(p4y-p1y)+(p1y-p2y)*(p1x-p4x));
return a;
}
|
main.c: In function 'main':
main.c:10:1: error: 'f' undeclared (first use in this function)
10 | f=0;
| ^
main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in
|
s155999701
|
p00012
|
C
|
import math
def L(x1,y1,x2,y2):
return math.sqrt((x1-x2)**2+(y1-y2)**2)
def S(a,b,c):
s=(a+b+c)/2
return math.sqrt(s*(s-a)*(s-b)*(s-c))
while True:
try:
x1,y1,x2,y2,x3,y3,xp,yp = map(float, raw_input().split())
a = L(x1,y1,x2,y2)
b = L(x1,y1,x3,y3)
c = L(x2,y2,x3,y3)
pa = L(x3,y3,xp,yp)
pb = L(x2,y2,xp,yp)
pc = L(x1,y1,xp,yp)
if S(a,pb,pc)+S(b,pc,pa)+S(c,pa,pb)-S(a,b,c) > 0.0000001:
print "NO"
else:
print "YES"
except:
break
|
main.c:1:1: error: unknown type name 'import'
1 | import math
| ^~~~~~
main.c:3:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'def'
3 | def L(x1,y1,x2,y2):
| ^~~
main.c:3:1: error: unknown type name 'def'
|
s784700491
|
p00012
|
C
|
#include<stdio.h>
#include<math.h>
int main(void) {
    double x[4]={0};
    double y[4]={0};
    double t1, t2, t3, s1, s2;
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
        s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
        t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
        t2=fabs(x[0]*(y[1]-y[3])+x[1]*(y[3]-y[0])+x[3]*(y[0]-y[1]))/2;
        t3=fabs(x[0]*(y[2]-y[3])+x[2]*(y[3]-y[0])+x[3]*(y[0]-y[2]))/2;
        s2=t1+t2+t3;
        if(s1==s2) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}
|
main.c: In function 'main':
main.c:4:2: error: stray '#' in program
4 |     double x[4]={0};
| ^
main.c:4:1: error: lvalue required as unary '&' operand
4 |     double x[4]={0};
| ^
main.c:4:8: error: stray '#' in program
4 |     double x[4]={0};
| ^
main.c:4:7: error: lvalue required as unary '&' operand
4 |     double x[4]={0};
| ^
main.c:4:14: error: stray '#' in program
4 |     double x[4]={0};
| ^
main.c:4:13: error: lvalue required as unary '&' operand
4 |     double x[4]={0};
| ^
main.c:4:20: error: stray '#' in program
4 |     double x[4]={0};
| ^
main.c:4:19: error: lvalue required as unary '&' operand
4 |     double x[4]={0};
| ^
main.c:5:2: error: stray '#' in program
5 |     double y[4]={0};
| ^
main.c:5:1: error: lvalue required as unary '&' operand
5 |     double y[4]={0};
| ^
main.c:5:8: error: stray '#' in program
5 |     double y[4]={0};
| ^
main.c:5:7: error: lvalue required as unary '&' operand
5 |     double y[4]={0};
| ^
main.c:5:14: error: stray '#' in program
5 |     double y[4]={0};
| ^
main.c:5:13: error: lvalue required as unary '&' operand
5 |     double y[4]={0};
| ^
main.c:5:20: error: stray '#' in program
5 |     double y[4]={0};
| ^
main.c:5:19: error: lvalue required as unary '&' operand
5 |     double y[4]={0};
| ^
main.c:6:2: error: stray '#' in program
6 |     double t1, t2, t3, s1, s2;
| ^
main.c:6:1: error: lvalue required as unary '&' operand
6 |     double t1, t2, t3, s1, s2;
| ^
main.c:6:8: error: stray '#' in program
6 |     double t1, t2, t3, s1, s2;
| ^
main.c:6:7: error: lvalue required as unary '&' operand
6 |     double t1, t2, t3, s1, s2;
| ^
main.c:6:14: error: stray '#' in program
6 |     double t1, t2, t3, s1, s2;
| ^
main.c:6:13: error: lvalue required as unary '&' operand
6 |     double t1, t2, t3, s1, s2;
| ^
main.c:6:20: error: stray '#' in program
6 |     double t1, t2, t3, s1, s2;
| ^
main.c:6:19: error: lvalue required as unary '&' operand
6 |     double t1, t2, t3, s1, s2;
| ^
main.c:7:2: error: stray '#' in program
7 |     while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
| ^
main.c:7:1: error: lvalue required as unary '&' operand
7 |     while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
| ^
main.c:7:8: error: stray '#' in program
7 |     while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
| ^
main.c:7:7: error: lvalue required as unary '&' operand
7 |     while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
| ^
main.c:7:14: error: stray '#' in program
7 |     while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
| ^
main.c:7:13: error: lvalue required as unary '&' operand
7 |     while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
| ^
main.c:7:20: error: stray '#' in program
7 |     while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
| ^
main.c:7:19: error: lvalue required as unary '&' operand
7 |     while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[0],&y[0]) != EOF){
| ^
main.c:8:2: error: stray '#' in program
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:1: error: lvalue required as unary '&' operand
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:8: error: stray '#' in program
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:7: error: lvalue required as unary '&' operand
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:14: error: stray '#' in program
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:13: error: lvalue required as unary '&' operand
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:20: error: stray '#' in program
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:19: error: lvalue required as unary '&' operand
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:26: error: stray '#' in program
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:25: error: lvalue required as unary '&' operand
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:32: error: stray '#' in program
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:31: error: lvalue required as unary '&' operand
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:38: error: stray '#' in program
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:37: error: lvalue required as unary '&' operand
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:44: error: stray '#' in program
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:8:43: error: lvalue required as unary '&' operand
8 |         s1=fabs(x[1]*(y[2]-y[3])+x[2]*(y[3]-y[1])+x[3]*(y[1]-y[2]))/2;
| ^
main.c:9:2: error: stray '#' in program
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:1: error: lvalue required as unary '&' operand
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:8: error: stray '#' in program
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:7: error: lvalue required as unary '&' operand
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:14: error: stray '#' in program
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:13: error: lvalue required as unary '&' operand
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:20: error: stray '#' in program
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:19: error: lvalue required as unary '&' operand
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:26: error: stray '#' in program
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:25: error: lvalue required as unary '&' operand
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:32: error: stray '#' in program
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:31: error: lvalue required as unary '&' operand
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
| ^
main.c:9:38: error: stray '#' in program
9 |         t1=fabs(x[0]*(y[1]-y[2])+x[1]*(y[2]-y[0])+x[2]*(y[0]-y[1]))/2;
|
|
s523183328
|
p00012
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
double x[4],y[4],a,b,c;
while(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])!=EOF){
x[0]-=x[3];
x[1]-=x[3];
x[2]-=x[3];
y[0]-=y[3];
y[1]-=y[3];
y[2]-=y[3];
a=sqrt(x[0]*x[0]+y[0]*y[0]);
b=sqrt(x[1]*x[1]+y[1]*y[1]);
c=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
x[3]=(a*a+b*b-c*c)/(2*a*b);
b=sqrt(x[2]*x[2]+y[2]*y[2]);
c=sqrt((x[0]-x[2])*(x[0]-x[2])+(y[0]-y[2])*(y[0]-y[2]));
y[3]=(a*a+b*b-c*c)/(2*a*b);
a=sqrt(1-y[3]*y[3])*x[3]+sqrt(1-x[3]*x[3])*y[3];
if(a>0){
printf("NO\n");
}else{
printf("YES\n")
}
}
return 0;
}
|
main.c: In function 'main':
main.c:27:40: error: expected ';' before '}' token
27 | printf("YES\n")
| ^
| ;
28 | }
| ~
|
s607722892
|
p00012
|
C
|
#include<stdio.h>
#include<math.h>
int dist(int x1,int y1,int x2,int y2){
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
}
int area(int p,int q,int r){
int s=(p+q+r)/2;
return sqrt(s*(s-p)*(s-q)*(s-r));
}
int main(void){
double x[4],y[4],a,b,c,d;
while(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])!=EOF){
a=area(dist(x[0],y[0],x[1],y[1]),dist(x[1],y[1],x[2],y[2]),dist(x[2],y[2],x[0],y[0]));
b=area(dist(x[0],y[0],x[1],y[1]),dist(x[0],y[0],x[3],y[3]),dist(x[3],y[3],x[1],y[1]));
c=area(dist(x[1],y[1],x[2],y[2]),dist(x[1],y[1],x[3],y[3]),dist(x[3],y[3],x[2],y[2]));
d=area(dist(x[2],y[2],x[0],y[0]),dist(x[2],y[2],x[3],y[3]),dist(x[3],y[3],x[0],y[0]));
if((b+c+d)==a){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
}
|
main.c: In function 'dist':
main.c:5:53: error: expected ';' before '}' token
5 | return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
| ^
| ;
6 | }
| ~
|
s134693640
|
p00012
|
C++
|
#include <iostream>
#include <complex>
using namespace std;
double cross(complex<double> A, complex<double> B){
return (conj(A)*B).imag();
}
int main(){
complex<double> Points[3], P;
while(true){
double x, y;
for(int i=0; i<3; i++){
cin >> x >> y;
V[i] = {x, y};
}
cin >> x >> y;
P = {x, y};
if(!cin)break;
int sum = 0;
for(int i=0; i<3; i++){
sum += cross(Points[(i+1)%3]-Points[i], (P-Points[i])) > 0;
}
cout << (sum==0 || sum==3? "YES": "NO") << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:13: error: 'V' was not declared in this scope
15 | V[i] = {x, y};
| ^
|
s792749927
|
p00012
|
C++
|
#include <iostream>
using namespace std;
double distance(double x1, double y1, double x2, double y2)
{
return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
double helon(double a, double b, double c)
{
double s = (a + b + c) / 2;
return sqrt(s * (s - a) * (s - b) * (s - c));
}
double helon(double x1, double y1, double x2, double y2, double x3, double y3)
{
double a = distance(x1, y1, x2, y2);
double b = distance(x2, y2, x3, y3);
double c = distance(x3, y3, x1, y1);
return helon(a, b, c);
}
int main()
{
double x1, y1, x2, y2, x3, y3, xp, yp;
while ( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
if (round(helon(x1, y1, x2, y2, x3, y3)*100) == round((helon(x1, y1, x2, y2, xp, yp) + helon(x2, y2, x3, y3, xp, yp) + helon(x3, y3, x1, y1, xp, yp)) *100)) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc: In function 'double distance(double, double, double, double)':
a.cc:7:16: error: 'sqrt' was not declared in this scope
7 | return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
| ^~~~
a.cc: In function 'double helon(double, double, double)':
a.cc:14:16: error: 'sqrt' was not declared in this scope
14 | return sqrt(s * (s - a) * (s - b) * (s - c));
| ^~~~
a.cc: In function 'int main()':
a.cc:31:21: error: 'round' was not declared in this scope
31 | if (round(helon(x1, y1, x2, y2, x3, y3)*100) == round((helon(x1, y1, x2, y2, xp, yp) + helon(x2, y2, x3, y3, xp, yp) + helon(x3, y3, x1, y1, xp, yp)) *100)) {
| ^~~~~
|
s063142620
|
p00012
|
C++
|
0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
| ^~~
|
s447468575
|
p00012
|
C++
|
import sys
def side(p1, p2, p3): return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0
for s in sys.stdin:
x = map(float, raw_input().split())
p1 = x[0:2]
p2 = x[2:4]
p3 = x[4:6]
p0 = x[6:]
print ["NO","YES"][(side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0))]
|
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'
|
s502837550
|
p00012
|
C++
|
#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()
const int INF = 1e9;
const double PI = 3.14159;
int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
using namespace std;
typedef long long ll;
//typedef pair<int, int> P;
/* struct P {
int x, y, n;
P(int n, int x, int y):n(n), x(x), y(y){}
P(){}
}; */
/** 幾何ライブラリ **/
#include <complex>
#define X real()
#define Y imag()
const double EPS = 1e-11;
typedef double D;
typedef complex<D> P; // Point
struct L { // Line
P a, b;
L(){}
L(P aa, P bb) : a(aa), b(bb){}
};
// 共役複素数 conj(a);
// 符号
int sig(D a, D b=0) { return a < b - EPS ? -1 : (a > b + EPS ? 1 : 0); }
// 内積
D dot(P a, P b) { return (conj(a)*b).real(); }
// 外積
D cross(P a, P b) { return (conj(a)*b).imag(); }
// 線分abに対する点cの位置
enum STATE{LEFT=1, RIGHT=-1, BACK=2, FRONT=-2, ON=0, IN=3, OUT=-3};
int ccw(P a, P b, P c)
{
b -= a, c -= a;
D s = sig(cross(b, c));
if (s) return s>0 ? LEFT : RIGHT;
if (sig(dot(b, c))<0) return BACK;
if (sig(abs(c), abs(b))>0) return FRONT;
return ON;
}
// 直線lに対する点pの写像
P projection(L l, P p)
{
return l.a + (l.b-l.a)/abs(l.b-l.a) * dot(l.b-l.a, p-l.a)/abs(l.b-l.a);
}
// 直線lに対する点pの反射
P reflection(L l, P p)
{
return p + (projection(l, p)-p)*P(2, 0);
}
// 直線abと点cの距離
D dLP(L l, P c)
{
return abs(cross(l.b-l.a, c-l.a))/abs(l.b-l.a);
}
// 線分abと点cの距離
D dSP(L l, P c)
{
if (sig(dot(l.b-l.a, c-l.a))<0) return abs(c-l.a);
if (sig(dot(l.a-l.b, c-l.b))<0) return abs(c-l.b);
return abs(cross(l.b-l.a, c-l.a))/abs(l.b-l.a);
}
// 線分と線分の交差判定
bool iSS(L s, L t)
{
return (ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0)
&& (ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0);
}
// 線分と線分の距離
D dSS(L s, L t)
{
if (iSS(s, t)) return 0;
return min(min(dSP(t, s.a), dSP(t, s.b)), min(dSP(s, t.a), dSP(s, t.b)));
}
// 線分と線分の交点 (公差していることが前提)
P cSS(L s, L t)
{
D d1 = dLP(t, s.a);
D d2 = dLP(t, s.b);
D tmp = d1 / (d1 + d2);
return s.a + (s.b-s.a)*tmp;
}
// 直線と直線の交差判定
bool iLL(L s, L t)
{
return sig(cross(s.b-s.a, t.b-t.a))!=0;
}
// 直線と直線の交点 iLLを確認してから使用
P cLL(L s, L t)
{
P ss = s.b - s.a, tt = t.b - t.a;
return s.a + ss*cross(tt, t.a-s.a)/cross(tt, ss);
}
// 多角形
typedef vector<P> G;
#define GET(v, i) v[i%v.size()]
int containsGP(G g, P p)
{
bool in=false;
for (int i=0; i<g.size(); i++) {
P a = GET(g, i)-p, b = GET(g, i+1)-p;
if (ccw(a, b, p) == ON) return ON;
if (a.Y > b.Y) swap(a, b);
if (a.Y<0 && b.Y>=0 && sig(cross(a, b))>0) in = !in;
}
return in?IN:OUT;
}
/** Problem0012 : A Point In Triangle **/
int main()
{
P a, b, c, p;
while (cin>>a.X>>a.Y>>b.X>>b.Y>>c.X>>c.Y>>p.X>>p.Y) {
G g;
g.push_back(a);
g.push_back(b);
g.push_back(c);
cout << (containsGP(g, p)==IN?"YES":"NO") << endl;
}
}
|
a.cc:124:9: error: 'vector' does not name a type
124 | typedef vector<P> G;
| ^~~~~~
a.cc:127:16: error: 'G' was not declared in this scope
127 | int containsGP(G g, P p)
| ^
a.cc:127:23: error: expected primary-expression before 'p'
127 | int containsGP(G g, P p)
| ^
a.cc:127:24: error: expression list treated as compound expression in initializer [-fpermissive]
127 | int containsGP(G g, P p)
| ^
a.cc: In function 'int main()':
a.cc:143:16: error: 'cin' was not declared in this scope
143 | while (cin>>a.X>>a.Y>>b.X>>b.Y>>c.X>>c.Y>>p.X>>p.Y) {
| ^~~
a.cc:23:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
22 | #include <complex>
+++ |+#include <iostream>
23 |
a.cc:144:17: error: 'G' was not declared in this scope
144 | G g;
| ^
a.cc:145:17: error: 'g' was not declared in this scope
145 | g.push_back(a);
| ^
a.cc:148:17: error: 'cout' was not declared in this scope
148 | cout << (containsGP(g, p)==IN?"YES":"NO") << endl;
| ^~~~
a.cc:148:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:148:36: error: 'containsGP' cannot be used as a function
148 | cout << (containsGP(g, p)==IN?"YES":"NO") << endl;
| ~~~~~~~~~~^~~~~~
|
s431187891
|
p00012
|
C++
|
#include <iostream>
#include <vector>
#include <limits.h>
using namespace std;
struct Point
{
Point() :x(0.0), y(0.0) {}
Point(double _x, double _y) : x(_x), y(_y) {}
double x;
double y;
};
bool HalfPlaneTest(const Point& P1, const Point& P2, const Point& P)
{
return ((P2.y - P1.y) * P.x - (P2.x - P1.x) * P.y + (P2.x * P1.y - P1.x * P2.y)) > 0;
}
struct Triangle
{
Triangle() : minX(DBL_MAX), maxX(DBL_MIN), minY(DBL_MAX), maxY(DBL_MIN) {}
void add(double x, double y) {
vP.push_back(Point(x, y));
if (x < minX) minX = x;
if (x > maxX) maxX = x;
if (y < minY) minY = y;
if (y > maxY) maxY = y;
if (vP.size() == 3){
if (HalfPlaneTest(vP[0], vP[1], vP[2]))
swap(vP[1], vP[2]);
}
}
bool IsInclude(double x, double y){
if (x <= minX || x >= maxX || y <= minY || y >= maxY)
return false;
Point p(x, y);
if (HalfPlaneTest(vP[0], vP[1], p)) return false;
if (HalfPlaneTest(vP[1], vP[2], p)) return false;
if (HalfPlaneTest(vP[2], vP[0], p)) return false;
return true;
}
vector<Point> vP;
double minX;
double maxX;
double minY;
double maxY;
};
int main()
{
double x1, y1, x2, y2, x3, y3, x, y;
while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){
Triangle triangle;
triangle.add(x1, y1);
triangle.add(x2, y2);
triangle.add(x3, y3);
if (triangle.IsInclude(x, y)) cout << "YES\n";
else cout << "NO\n";
}
return 0;
}
|
a.cc: In constructor 'Triangle::Triangle()':
a.cc:18:27: error: 'DBL_MAX' was not declared in this scope
18 | Triangle() : minX(DBL_MAX), maxX(DBL_MIN), minY(DBL_MAX), maxY(DBL_MIN) {}
| ^~~~~~~
a.cc:4:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
3 | #include <limits.h>
+++ |+#include <cfloat>
4 | using namespace std;
a.cc:18:42: error: 'DBL_MIN' was not declared in this scope
18 | Triangle() : minX(DBL_MAX), maxX(DBL_MIN), minY(DBL_MAX), maxY(DBL_MIN) {}
| ^~~~~~~
a.cc:18:42: note: 'DBL_MIN' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
|
s378329555
|
p00012
|
C++
|
#include <iostream>
#include <vector>
#include <limits>
using namespace std;
struct Point
{
Point() :x(0.0), y(0.0) {}
Point(double _x, double _y) : x(_x), y(_y) {}
double x;
double y;
};
bool HalfPlaneTest(const Point& P1, const Point& P2, const Point& P)
{
return ((P2.y - P1.y) * P.x - (P2.x - P1.x) * P.y + (P2.x * P1.y - P1.x * P2.y)) > 0;
}
struct Triangle
{
Triangle() : minX(DBL_MAX), maxX(DBL_MIN), minY(DBL_MAX), maxY(DBL_MIN) {}
void add(double x, double y) {
vP.push_back(Point(x, y));
if (x < minX) minX = x;
if (x > maxX) maxX = x;
if (y < minY) minY = y;
if (y > maxY) maxY = y;
if (vP.size() == 3){
if (HalfPlaneTest(vP[0], vP[1], vP[2]))
swap(vP[1], vP[2]);
}
}
bool IsInclude(double x, double y){
if (x <= minX || x >= maxX || y <= minY || y >= maxY)
return false;
Point p(x, y);
if (HalfPlaneTest(vP[0], vP[1], p)) return false;
if (HalfPlaneTest(vP[1], vP[2], p)) return false;
if (HalfPlaneTest(vP[2], vP[0], p)) return false;
return true;
}
vector<Point> vP;
double minX;
double maxX;
double minY;
double maxY;
};
int main()
{
double x1, y1, x2, y2, x3, y3, x, y;
while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){
Triangle triangle;
triangle.add(x1, y1);
triangle.add(x2, y2);
triangle.add(x3, y3);
if (triangle.IsInclude(x, y)) cout << "YES\n";
else cout << "NO\n";
}
return 0;
}
|
a.cc: In constructor 'Triangle::Triangle()':
a.cc:18:27: error: 'DBL_MAX' was not declared in this scope
18 | Triangle() : minX(DBL_MAX), maxX(DBL_MIN), minY(DBL_MAX), maxY(DBL_MIN) {}
| ^~~~~~~
a.cc:4:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
3 | #include <limits>
+++ |+#include <cfloat>
4 | using namespace std;
a.cc:18:42: error: 'DBL_MIN' was not declared in this scope
18 | Triangle() : minX(DBL_MAX), maxX(DBL_MIN), minY(DBL_MAX), maxY(DBL_MIN) {}
| ^~~~~~~
a.cc:18:42: note: 'DBL_MIN' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
|
s995393739
|
p00012
|
C++
|
#include <cstdio>
#include <iostream>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
bool judge(double x[3], double y[3]) {
double rad1 = atan2(y[0], x[0]);
cout << rad1 << endl;
double rad2 = atan2(y[1], x[1]);
cout << rad2 << endl;
double rad3 = atan2(y[2], x[2]);
cout << rad3 << endl;
if(rad3 < rad1 && rad2 < rad3 || rad1 < rad3 && rad3 < rad2) return true;
else return false;
}
int main() {
double x1, y1, x2, y2, x3, y3, xp, yp;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
double x[3], y[3];
x[0] = x2 - x1;
y[0] = y2 - y1;
x[1] = x3 - x1;
y[1] = y3 - y1;
x[2] = xp - x1;
y[2] = yp - y1;
if(!judge(x, y)) {
cout << "NO" << endl;
break;
}
x[0] = x1 - x2;
y[0] = y1 - y2;
x[1] = x3 - x2;
y[1] = y3 - y2;
x[2] = xp - x2;
y[2] = yp - y2;
if(!judge(x, y)) {
cout << "NO" << endl;
break;
}
cout << "YES" << endl;
}
return 0;
}
|
a.cc: In function 'bool judge(double*, double*)':
a.cc:8:23: error: 'atan2' was not declared in this scope
8 | double rad1 = atan2(y[0], x[0]);
| ^~~~~
|
s392129940
|
p00012
|
C++
|
#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
bool judge(double x[2], double y[2]) {
double cross = x[0] * y[1] - y[0] * x[1];
if(cross >= 0) return true;
else return false;
}
int main() {
double x1, y1, x2, y2, x3, y3, xp, yp;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
double ax[2], ay[2];
x[0] = x2 - x1;
y[0] = y2 - y1;
x[1] = xp - x1;
y[1] = yp - y1;
double bx[2], by[2];
x[0] = x3 - x2;
y[0] = y3 - y2;
x[1] = xp - x2;
y[1] = yp - y2;
double cx[2], cy[2];
x[0] = x1 - x3;
y[0] = y1 - y3;
x[1] = xp - x3;
y[1] = yp - y3;
if(judge(ax, ay) && judge(bx, by) && judge(cx, cy) || !judge(ax, ay) && !judge(bx, by) && !judge(cx, cy)) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:17: error: 'x' was not declared in this scope; did you mean 'ax'?
17 | x[0] = x2 - x1;
| ^
| ax
a.cc:18:17: error: 'y' was not declared in this scope; did you mean 'ay'?
18 | y[0] = y2 - y1;
| ^
| ay
|
s729862721
|
p00012
|
C++
|
#include <iostream>
#include <iomanip>
#include <math.h>
#include <utility>
#include <cstdlib>
using namespace std;
int main(){
int n;
cin >> n;
while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
bool ans=true;
double x[3],y[3],xp,yp;
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp;
//???????????¨????????????
double gaiseki[3]; //gaiseki[i]???????????????P0P1??¨????????????P0Q????????????z??§?¨?
for(int i=0;i<3;i++){
int k = (i+1)%3;
double vx,vy,vpx,vpy;
vx = x[k]-x[i];
vy = y[k]-y[i];
vpx = xp-x[i];
vpy = yp-y[i];
gaiseki[i] = vx*vpy-vy*vpx;
if(gaiseki[i]<=0) ans = false;
}
if(ans){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:22: error: 'x' was not declared in this scope
11 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
| ^
a.cc:11:30: error: 'y' was not declared in this scope
11 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
| ^
a.cc:11:70: error: 'xp' was not declared in this scope; did you mean 'exp'?
11 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
| ^~
| exp
a.cc:11:76: error: 'yp' was not declared in this scope; did you mean 'yn'?
11 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
| ^~
| yn
|
s829954920
|
p00012
|
C++
|
#include <iostream>
#include <iomanip>
#include <math.h>
#include <utility>
#include <cstdlib>
using namespace std;
int main(){
while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
bool ans=true;
double x[3],y[3],xp,yp;
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp;
//???????????¨????????????
double gaiseki[3]; //gaiseki[i]???????????????P0P1??¨????????????P0Q????????????z??§?¨?
for(int i=0;i<3;i++){
int k = (i+1)%3;
double vx,vy,vpx,vpy;
vx = x[k]-x[i];
vy = y[k]-y[i];
vpx = xp-x[i];
vpy = yp-y[i];
gaiseki[i] = vx*vpy-vy*vpx;
if(gaiseki[i]<=0) ans = false;
}
if(ans){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:22: error: 'x' was not declared in this scope
9 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
| ^
a.cc:9:30: error: 'y' was not declared in this scope; did you mean 'yn'?
9 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
| ^
| yn
a.cc:9:70: error: 'xp' was not declared in this scope; did you mean 'exp'?
9 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
| ^~
| exp
a.cc:9:76: error: 'yp' was not declared in this scope; did you mean 'yn'?
9 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
| ^~
| yn
|
s207981512
|
p00012
|
C++
|
#include <iostream>
#include <iomanip>
#include <math.h>
#include <utility>
#include <cstdlib>
using namespace std;
int main(){
double x[3],y[3],xp,yp;
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp)
bool ans=true;
for(int i=0;i<3;i++){
double gaiseki;
int k = (i+1)%3;
double vx,vy,vpx,vpy;
vx = x[k]-x[i];
vy = y[k]-y[i];
vpx = xp-x[i];
vpy = yp-y[i];
gaiseki = vx*vpy-vy*vpx;
if(gaiseki<=0) ans = false;
}
if(ans){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:72: error: expected ';' before ')' token
10 | cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp)
| ^
| ;
a.cc:21:40: error: 'ans' was not declared in this scope; did you mean 'abs'?
21 | if(gaiseki<=0) ans = false;
| ^~~
| abs
a.cc:23:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
23 | if(ans){
| ^~~
| abs
|
s959764426
|
p00012
|
C++
|
#include <iostream>
#include <iomanip>
#include <math.h>
#include <utility>
#include <cstdlib>
using namespace std;
int main(){
double x[3],y[3],xp,yp;
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp
bool ans=true;
for(int i=0;i<3;i++){
double gaiseki;
int k = (i+1)%3;
double vx,vy,vpx,vpy;
vx = x[k]-x[i];
vy = y[k]-y[i];
vpx = xp-x[i];
vpy = yp-y[i];
gaiseki = vx*vpy-vy*vpx;
if(gaiseki<=0) ans = false;
}
if(ans){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:72: error: expected ';' before 'bool'
10 | cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp
| ^
| ;
11 | bool ans=true;
| ~~~~
a.cc:21:40: error: 'ans' was not declared in this scope; did you mean 'abs'?
21 | if(gaiseki<=0) ans = false;
| ^~~
| abs
a.cc:23:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
23 | if(ans){
| ^~~
| abs
|
s828362127
|
p00012
|
C++
|
def side(p1, p2)
#the line from p1(a,b) to p2(c,d). return [e,f,g] where ex+fy=g
a,b = p1
c,d = p2
e = b - d
f = c - a
g = b*c - d*a
return [e,f,g]
end
def between?(p1, p2, p3, q)
#Is q between p1 ~ line from p2 to p3?
a,b,c = side(p2,p3)
dist_array = [p1, q].map{|point| (point[0]*a + point[1]*b - c).abs }
if dist_array[0] > dist_array[1]
return true
else
return false
end
end
while num = gets
a,b,c,d,e,f,g,h= num.split(' ').map(&:to_f)
p1, p2, p3, q = [a,b],[c,d],[e,f],[g,h]
if between?(p1, p2, p3, q) && between?(p2, p3, p1, q) && between?(p3, p1, p2, q)
puts "YES"
else
puts "NO"
end
end
|
a.cc:2:5: error: invalid preprocessing directive #the
2 | #the line from p1(a,b) to p2(c,d). return [e,f,g] where ex+fy=g
| ^~~
a.cc:12:5: error: invalid preprocessing directive #Is
12 | #Is q between p1 ~ line from p2 to p3?
| ^~
a.cc:1:1: error: 'def' does not name a type
1 | def side(p1, p2)
| ^~~
a.cc:15:4: error: expected unqualified-id before 'if'
15 | if dist_array[0] > dist_array[1]
| ^~
|
s894985699
|
p00012
|
C++
|
import java.util.*;
public class Main{
private static String a;
static double xp,yp,z,x1,y1;
public static double[] w(double[] x, double[] y) {
x[2] = -x[2];
y[2] = -y[2];
z = (x[0] * y[1] )- (x[1] * y[0]);
x1 = +(y[1] * x[2]) - (x[1] * y[2]);
y1 = +(x[0] * y[2]) - (y[0] * x[2]);
return new double[] { (x1 / z), (y1 / z) };
}
public static void main(String [] args){
Scanner cs = new Scanner(System.in);
double[] x = new double[3];
double[] y = new double[3];
while (cs.hasNextDouble()) { {
for (int i = 0; i < 3; i++) {
x[i] = cs.nextDouble();
y[i] = cs.nextDouble();
}
xp = cs.nextDouble();
yp = cs.nextDouble();
for (int i = 0; i < 3; i++) {
x[i] -= xp;
y[i] -= yp;
}
}
double[] X = w(x, y);
if (X[0] >= 0 && X[1] >= 0) System.out.println("YES");
else System.out.println("NO");
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main{
| ^~~~~~
|
s279569203
|
p00012
|
C++
|
Ginclude <iostream>
#include <algorithm>
using namespace std;
int check(double x1, double y1, double x2, double y2, double x3, double y3){
double ab = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
double bc = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
double ca = sqrt((x3 - x1) * (x3 - x1) + (y3 - y1) * (y3 - y1));
double s = (ab + bc + ca) * 0.5;
double S = sqrt(s * (s - ab) * (s - bc) * (s - ca));
return S;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
double x1, y1, x2, y2, x3, y3, xp, yp;
while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
double abc = check(x1, y1, x2, y2, x3, y3);
double abp = check(x1, y1, x2, y2, xp, yp);
double bcp = check(x2, y2, x3, y3, xp, yp);
double cap = check(x3, y3, x1, y1, xp, yp);
double var = abc - (abp + bcp + cap);
if(var <= 0.001 && var >= -0.001){
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc:1:1: error: 'Ginclude' does not name a type
1 | Ginclude <iostream>
| ^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
|
s132775477
|
p00012
|
C++
|
#include <stdio.h>
using namespace std;
int main(){
double px,py;
double tx[3],ty[3];
bool flag;
bool v[3];
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&tx[0],&ty[0],&tx[1],&ty[1],&tx[2],&ty[2],&px,&py) == 8){
for(int i=0;i<3;i++){
tx[i]=tx[i]-px;
ty[i]=ty[i]-py;
}
//t[i]→t[i+1]のベクトルに対してt[i]→(px,py)のベクトルが同じ方向を向いているかを判定する
//t[i]を90度回転させたベクトルとの内積で求める
for(int i=0;i<3;i++){
if((tx[i%3]*ty[(i+1)%3])-(ty[i%3]*tx[(i+1)%3])<0){
v[i]=true;
}else{
v[i]=false;
}
}
if(v[0]!=v[1]){
cout<<"NO"<<endl;
}else if(v[1]!=v[2]){
cout<<"NO"<<endl;
}else {
cout<<"YES"<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:23:1: error: 'cout' was not declared in this scope
23 | cout<<"NO"<<endl;
| ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <stdio.h>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:23:13: error: 'endl' was not declared in this scope
23 | cout<<"NO"<<endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include <stdio.h>
+++ |+#include <ostream>
2 | using namespace std;
a.cc:25:1: error: 'cout' was not declared in this scope
25 | cout<<"NO"<<endl;
| ^~~~
a.cc:25:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:13: error: 'endl' was not declared in this scope
25 | cout<<"NO"<<endl;
| ^~~~
a.cc:25:13: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:27:1: error: 'cout' was not declared in this scope
27 | cout<<"YES"<<endl;
| ^~~~
a.cc:27:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:14: error: 'endl' was not declared in this scope
27 | cout<<"YES"<<endl;
| ^~~~
a.cc:27:14: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s657939068
|
p00012
|
C++
|
#include <stdio.h>
using namespace std;
int main(){
double px,py;
double tx[3],ty[3];
bool flag;
bool v[3];
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&tx[0],&ty[0],&tx[1],&ty[1],&tx[2],&ty[2],&px,&py) == 8){
for(int i=0;i<3;i++){
tx[i]=tx[i]-px;
ty[i]=ty[i]-py;
}
for(int i=0;i<3;i++){
if((tx[i%3]*ty[(i+1)%3])-(ty[i%3]*tx[(i+1)%3])<0){
v[i]=true;
}else{
v[i]=false;
}
}
if(v[0]!=v[1]){
cout<<"NO"<<endl;
}else if(v[1]!=v[2]){
cout<<"NO"<<endl;
}else {
cout<<"YES"<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:1: error: 'cout' was not declared in this scope
21 | cout<<"NO"<<endl;
| ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <stdio.h>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:21:13: error: 'endl' was not declared in this scope
21 | cout<<"NO"<<endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include <stdio.h>
+++ |+#include <ostream>
2 | using namespace std;
a.cc:23:1: error: 'cout' was not declared in this scope
23 | cout<<"NO"<<endl;
| ^~~~
a.cc:23:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:13: error: 'endl' was not declared in this scope
23 | cout<<"NO"<<endl;
| ^~~~
a.cc:23:13: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:25:1: error: 'cout' was not declared in this scope
25 | cout<<"YES"<<endl;
| ^~~~
a.cc:25:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:14: error: 'endl' was not declared in this scope
25 | cout<<"YES"<<endl;
| ^~~~
a.cc:25:14: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s788035207
|
p00012
|
C++
|
#include <bits/stdc++.h>
using namespace std;
class D3
{
public:
long double X , Y , Z , EPS;
D3(long double , long double , long double);
bool operator== (D3 Partner);
D3 operator*(long double);
D3 operator/(long double);
};
class Point :private D3
{
public:
Point(long double , long double , long double);
long double getX();
long double getY();
long double getZ();
bool operator== (Point);
long double S_point(Point , Point);
};
class Vec
{
private:
Point SP;//Starting Point ?§????
D3 D;//Direction ??????
Vec(D3 Direction_ , Point SP_);
public:
Vec(long double x_ , long double y_ , long double z_ , Point);
Vec operator+(Vec Partner);
Vec operator*(Vec Partner);
Vec operator*(long double ld);
Vec operator-(Vec Partner);
Vec operator/(Vec Partner);
Vec operator/(long double);
bool operator== (Vec);
Vec Cross_product(Vec);
double Inner_product(Vec);
Vec(Point A , Point B);
Point getSP();
Point getGP();
D3 getD();
long double length();
Vec Unit_vec();
Vec Inverse_vec();
Vec Reverse_vec();
bool Vertical(Vec);
bool Parallel(Vec);
long double S_vec(Vec);
};
//D3
D3::D3(long double x_ = 0.0L , long double y_ = 0.0L , long double z_ = 0.0L)
{
X = x_;
Y = y_;
Z = z_;
EPS = 1e-9L;
}
bool D3::operator== (D3 Partner)
{
return abs(X - Partner.X) < EPS&&abs(Y - Partner.Y) < EPS&&abs(Z - Partner.Z) < EPS;
}
D3 D3::operator*(long double ld)
{
return D3(X*ld , Y*ld , Z*ld);
}
D3 D3::operator/(long double ld)
{
return *this*( ld*-1.L );
}
//Point
Point::Point(long double x_ = 0.0L , long double y_ = 0.0L , long double z_ = 0.0L)
{
X = x_;
Y = y_;
Z = z_;
}
//x??§?¨??????????
long double Point::getX()
{
return X;
}
//y??§?¨??????????
long double Point::getY()
{
return Y;
}
//z??§?¨??????????
long double Point::getZ()
{
return Z;
}
bool Point::operator== (Point Partner)
{
return D3(*this) == D3(Partner);
}
//??????????????¢???????±???????
long double Point::S_point(Point B , Point C)
{
Vec AB(*this , B) , AC(*this , C);
return AB.S_vec(AC);
}
//Vec
//??????????????¨?§???????????????????????????????
Vec::Vec(D3 Direction_ , Point SP_)
{
D = Direction_;
SP = SP_;
}
//?§??????¨???????????????????????????????????????????????????
Vec::Vec(long double x_ = 0.0L , long double y_ = 0.0L , long double z_ = 0.0L , Point SP_ = Point())
{
*this = Vec(D3(x_ , y_ , z_) , SP_);
}
Vec Vec::operator+(Vec Partner)
{
return Vec(D.X + Partner.D.X , D.Y + Partner.D.Y , D.Z + Partner.D.Z , SP);
}
Vec Vec::operator*(Vec Partner)
{
return Vec(D.X * Partner.D.X , D.Y * Partner.D.Y , D.Z * Partner.D.Z , SP);
}
Vec Vec::operator*(long double ld)
{
return Vec(D*ld , SP);
}
Vec Vec::operator-(Vec Partner)
{
return *this + ( Partner*( -1.L ) );
}
Vec Vec::operator/(Vec Partner)
{
return Vec(D.X / Partner.D.X , D.Y / Partner.D.Y , D.Z / Partner.D.Z , SP);
}
Vec Vec::operator/(long double ld)
{
return *this*( 1.L / ld );
}
bool Vec::operator== (Vec Partner)
{
return D == Partner.D&&SP == Partner.SP;
}
//??????
Vec Vec::Cross_product(Vec Partner)
{
return Vec(D.Y*Partner.D.Z - D.Z*Partner.D.Y , D.Z*Partner.D.X - D.X*Partner.D.Z , D.X*Partner.D.Y - D.Y*Partner.D.X);
}
//??????
double Vec::Inner_product(Vec Partner)
{
return D.X*Partner.D.X + D.Y*Partner.D.Y + D.Z*Partner.D.Z;
}
//???????????????????????????????????????
Vec::Vec(Point A , Point B)
{
*this = Vec(B.getX() - A.getX() , B.getY() - A.getY() , B.getZ() - A.getZ() , A);
}
//?§?????????????
Point Vec::getSP()
{
return SP;
}
//???????????????
Point Vec::getGP()
{
return Point(SP.getX() + D.X , SP.getZ() + D.Z , SP.getZ() + D.Z);
}
//???????????????
D3 Vec::getD()
{
return D;
}
//???????????????
long double Vec::length()
{
return sqrtl(D.X*D.X + D.Y*D.Y + D.Z*D.Z);
}
//??????????????????(??????1)?????????
Vec Vec::Unit_vec()
{
return Vec(*this) / ( *this ).length();
}
//????????????????????????(?§??????????????????????)
Vec Vec::Inverse_vec()
{
return ( *this )*-1.L;
}
//????????????????????????(?§??????¨???????????\????????????)
Vec Vec::Reverse_vec()
{
return Vec(( *this ).Inverse_vec().getD() , ( *this ).getGP());
}
//?????´????????????
bool Vec::Vertical(Vec Partner)
{
return ( *this ).Inner_product(Partner) == 0;
}
//??????????????????
bool Vec::Parallel(Vec Partner)
{
return ( *this ).Unit_vec().getD() == Partner.Unit_vec().getD() || ( *this ).Unit_vec().Inverse_vec().getD() == Partner.Unit_vec().getD();
}
//???????§????2????????????????????¢???????±???????
long double Vec::S_vec(Vec B)
{
//if(( ( *this ).getSP() == B.getSP() ))
{
Vec G = ( *this ).Cross_product(B);
return sqrtl(G.Inner_product(G)) / 2.L;
}
if(( *this ).getGP() == B.getSP())
{
return ( *this ).Reverse_vec().S_vec(B);
}
if(( *this ).getSP() == B.getGP())
{
return ( *this ).S_vec(B.Reverse_vec());
}
if(( *this ).getGP() == B.getGP())
{
return ( *this ).Reverse_vec().S_vec(B.Reverse_vec());
}
return -1.L;
}
int main()
{
double x1 , y1 , x2 , y2 , x3 , y3 , xp , yp;
while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
{
D3 X(x1 , y1) , Y(x2 , y2) , Z(x3 , y3) , P(xp , yp) , calc;
if(abs(calc.S_point(X , Y , Z) - ( calc.S_point(X , Y , P) + calc.S_point(X , Z , P) + calc.S_point(Z , Y , P) )) < 1e-6)
{
cout << "YES" << endl;
} else
{
cout << "NO" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:278:29: error: 'class D3' has no member named 'S_point'
278 | if(abs(calc.S_point(X , Y , Z) - ( calc.S_point(X , Y , P) + calc.S_point(X , Z , P) + calc.S_point(Z , Y , P) )) < 1e-6)
| ^~~~~~~
a.cc:278:57: error: 'class D3' has no member named 'S_point'
278 | if(abs(calc.S_point(X , Y , Z) - ( calc.S_point(X , Y , P) + calc.S_point(X , Z , P) + calc.S_point(Z , Y , P) )) < 1e-6)
| ^~~~~~~
a.cc:278:83: error: 'class D3' has no member named 'S_point'
278 | if(abs(calc.S_point(X , Y , Z) - ( calc.S_point(X , Y , P) + calc.S_point(X , Z , P) + calc.S_point(Z , Y , P) )) < 1e-6)
| ^~~~~~~
a.cc:278:109: error: 'class D3' has no member named 'S_point'
278 | if(abs(calc.S_point(X , Y , Z) - ( calc.S_point(X , Y , P) + calc.S_point(X , Z , P) + calc.S_point(Z , Y , P) )) < 1e-6)
| ^~~~~~~
|
s533751293
|
p00012
|
C++
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD
double dot(P a,P b){return real(conj(a)*b)};
double cross(P a,P b){return imag(conj(a)*b)};
int main(){
double x1,y1,x2,y2,x3,y3,xp,yp;
while(~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)){
P a(x1,y1), b(x2,y2), c(x3,y3), p(xp,yp);
double cra = cross(b-a,p-a);
double crb = cross(c-b,p-b);
double crc = cross(a-c,p-c);
if(cra<0){
cra*=-1;
crb*=-1;
crc*=-1;
}
if(cra>0 && crb>0 && crc>0){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
return 0;
}
|
a.cc: In function 'double dot(P, P)':
a.cc:22:43: error: expected ';' before '}' token
22 | double dot(P a,P b){return real(conj(a)*b)};
| ^
| ;
a.cc: In function 'double cross(P, P)':
a.cc:23:45: error: expected ';' before '}' token
23 | double cross(P a,P b){return imag(conj(a)*b)};
| ^
| ;
|
s125750846
|
p00012
|
C++
|
import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
public class Main{
static PrintWriter out;
static InputReader ir;
static void solve(){
while(ir.hasNext()){
P[] ps=new P[3];
for(int i=0;i<3;i++) ps[i]=new P(ir.nextDouble(),ir.nextDouble());
P p=new P(ir.nextDouble(),ir.nextDouble());
double tot=0;
for(int i=0;i<3;i++){
tot+=Math.abs(ps[i].sub(p).det(ps[(i+1)%3].sub(p)));
}
if(accurateTotal(-tot,Math.abs(ps[1].sub(ps[0]).det(ps[2].sub(ps[0]))))==0.0) out.println("YES");
else out.println("NO");
}
}
static final double EPS=1e-10;
public static double accurateTotal(double a,double b){
if(Math.abs(a+b)<EPS*(Math.abs(a)+Math.abs(b))) return 0.0;
return a+b;
}
static class P{
public double x,y;
public P(double x,double y){
this.x=x; this.y=y;
}
public double getX(){
return this.x;
}
public double getY(){
return this.y;
}
public P add(P v){
return new P(accurateTotal(this.x,v.x),accurateTotal(this.y,v.y));
}
public P sub(P v){
return new P(accurateTotal(this.x,-v.x),accurateTotal(this.y,-v.y));
}
public P mul(double k){
return new P(this.x*k,this.y*k);
}
public double dot(P v){
return accurateTotal(this.x*v.x,this.y*v.y);
}
public double det(P v){
return accurateTotal(this.x*v.y,-this.y*v.x);
}
}
public static void main(String[] args) throws Exception{
ir=new InputReader(System.in);
out=new PrintWriter(System.out);
solve();
out.flush();
}
static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;
public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}
public boolean hasNextByte() {
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}catch(IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0) return false;
}
return true;
}
private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}
private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}
private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}
public boolean hasNext(){skip(); return hasNextByte();}
public String next(){
if(!hasNext()) throw new NoSuchElementException();
StringBuilder sb=new StringBuilder();
int b=readByte();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
public int nextInt() {
if(!hasNext()) throw new NoSuchElementException();
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}
public long nextLong() {
if(!hasNext()) throw new NoSuchElementException();
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}
public double nextDouble(){return Double.parseDouble(next());}
public int[] nextIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++) a[i]=nextInt();
return a;
}
public long[] nextLongArray(int n){
long[] a=new long[n];
for(int i=0;i<n;i++) a[i]=nextLong();
return a;
}
public char[][] nextCharMap(int n,int m){
char[][] map=new char[n][m];
for(int i=0;i<n;i++) map[i]=next().toCharArray();
return map;
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.io.InputStream;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.io.PrintWriter;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.util.ArrayList;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import java.util.Arrays;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import java.util.Comparator;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
7 | import java.util.InputMismatchException;
| ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: 'import' does not name a type
8 | import java.util.NoSuchElementException;
| ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: 'import' does not name a type
9 | import java.math.BigInteger;
| ^~~~~~
a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:1: error: expected unqualified-id before 'public'
11 | public class Main{
| ^~~~~~
|
s144097941
|
p00012
|
C++
|
$ cat A_point_in_a_triangle.cpp
#include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;
double dist(double x1, double y1, double x2, double y2){
return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}
double triangleArea(double x, double y, double z){
return (y * z * sin( acos( (y * y + z * z - x * x) / (2 * y * z) ) )) / 2;
}
double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
double x, y ,z;
x = dist(x1, y1, x2, y2);
y = dist(x2, y2, x3, y3);
z = dist(x3, y3, x1, y1);
return triangleArea(x, y, z);
}
int main(){
double x1, y1, x2, y2, x3, y3, xp, yp;
double allArea, area12, area23, area31;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
allArea = inputXY(x1, y1, x2, y2, x3, y3);
area12 = inputXY(xp, yp, x2, y2, x1, y1);
area23 = inputXY(x2, y2, x3, y3, xp, yp);
area31 = inputXY(x3, y3, x1, y1, xp, yp);
if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
else cout << "NO" << endl;
}
|
a.cc:2:9: fatal error: bits\stdc++.h: No such file or directory
2 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s338336908
|
p00012
|
C++
|
#include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;
double dist(double x1, double y1, double x2, double y2){
return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}
double triangleArea(double x, double y, double z){
return (y * z * sin( acos( (y * y + z * z - x * x) / (2 * y * z) ) )) / 2;
}
double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
double x, y ,z;
x = dist(x1, y1, x2, y2);
y = dist(x2, y2, x3, y3);
z = dist(x3, y3, x1, y1);
return triangleArea(x, y, z);
}
int main(){
double x1, y1, x2, y2, x3, y3, xp, yp;
double allArea, area12, area23, area31;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
allArea = inputXY(x1, y1, x2, y2, x3, y3);
area12 = inputXY(xp, yp, x2, y2, x1, y1);
area23 = inputXY(x2, y2, x3, y3, xp, yp);
area31 = inputXY(x3, y3, x1, y1, xp, yp);
if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
else cout << "NO" << endl;
}
|
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s320608404
|
p00012
|
C++
|
#include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;
double dist(double x1, double y1, double x2, double y2){
return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}
double triangleArea(double x, double y, double z){
return (y * z * sin( acos( (y * y + z * z - x * x) / (2 * y * z) ) )) / 2;
}
double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
double x, y ,z;
x = dist(x1, y1, x2, y2);
y = dist(x2, y2, x3, y3);
z = dist(x3, y3, x1, y1);
return triangleArea(x, y, z);
}
int main(){
double x1, y1, x2, y2, x3, y3, xp, yp;
double allArea, area12, area23, area31;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
allArea = inputXY(x1, y1, x2, y2, x3, y3);
area12 = inputXY(xp, yp, x2, y2, x1, y1);
area23 = inputXY(x2, y2, x3, y3, xp, yp);
area31 = inputXY(x3, y3, x1, y1, xp, yp);
if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
else cout << "NO" << endl;
}
|
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s037112290
|
p00012
|
C++
|
#include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;
double dist(double x1, double y1, double x2, double y2){
return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}
double triangleArea(double x, double y, double z){
return (y * z * sin( acos( (y * y + z * z - x * x) / (2 * y * z) ) )) / 2;
}
double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
double x, y ,z;
x = dist(x1, y1, x2, y2);
y = dist(x2, y2, x3, y3);
z = dist(x3, y3, x1, y1);
return triangleArea(x, y, z);
}
int main(){
double x1, y1, x2, y2, x3, y3, xp, yp;
double allArea, area12, area23, area31;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
allArea = inputXY(x1, y1, x2, y2, x3, y3);
area12 = inputXY(xp, yp, x2, y2, x1, y1);
area23 = inputXY(x2, y2, x3, y3, xp, yp);
area31 = inputXY(x3, y3, x1, y1, xp, yp);
if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}
|
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s189418341
|
p00012
|
C++
|
#include<iostream>
using namespace std;
struct Point { long double px, py; };
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
long double norm(Point a) { return a.x*a.x + a.y*a.y; }
Point Minus(Point p1, Point p2) {
Point A1;
A1.px = p1.px - p2.px;
A1.py = p1.py - p2.py;
return A1;
}
int ccw(Point p0, Point p1, Point p2) {
Point a = Minus(p1, p0), b = Minus(p2, p0);
if (crs(a, b) > 1e-10) return 1;
if (crs(a, b) < -1e-10) return -1;
if (dot(a, b) < -1e-10) return 2;
if (norm(a) < norm(b)) return -2;
return 0;
}
bool its(Point p1, Point p2, Point p3, Point p4) {
return (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 && ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0);
}
Point P1, P2, P3, P4;
int main() {
while (cin >> P1.px >> P1.py >> P2.px >> P2.py >> P3.px >> P3.py >> P4.px >> P4.py) {
int OK = 0;
if (its(P1, P2, P3, P4) == true) { OK = 1; }
if (its(P1, P3, P2, P4) == true) { OK = 1; }
if (its(P1, P4, P2, P3) == true) { OK = 1; }
if (OK == 1) { cout << "NO" << endl; }
else { cout << "YES" << endl; }
}
}
|
a.cc: In function 'long double norm(Point)':
a.cc:6:38: error: 'struct Point' has no member named 'x'; did you mean 'px'?
6 | long double norm(Point a) { return a.x*a.x + a.y*a.y; }
| ^
| px
a.cc:6:42: error: 'struct Point' has no member named 'x'; did you mean 'px'?
6 | long double norm(Point a) { return a.x*a.x + a.y*a.y; }
| ^
| px
a.cc:6:48: error: 'struct Point' has no member named 'y'; did you mean 'py'?
6 | long double norm(Point a) { return a.x*a.x + a.y*a.y; }
| ^
| py
a.cc:6:52: error: 'struct Point' has no member named 'y'; did you mean 'py'?
6 | long double norm(Point a) { return a.x*a.x + a.y*a.y; }
| ^
| py
|
s781390575
|
p00012
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
double x1, y1, x2, y2, x3, y3, xp, yp;
while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
double a = x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2);
double b = x*(y1 - y2) + x1*(y2 - y) + x2*(y - y1);
double c = x*(y2 - y3) + x2*(y3 - y) + x3*(y - y2);
double d = x*(y3 - y1) + x3*(y1 - y) + x1*(y - y3);
if((a<0 && b<0 && c<0 && d<0) || (a>0 && b>0 && c>0 && d>0))
puts("YES");
else puts("NO");
}
}
|
a.cc: In function 'int main()':
a.cc:11:16: error: 'x' was not declared in this scope
11 | double b = x*(y1 - y2) + x1*(y2 - y) + x2*(y - y1);
| ^
a.cc:11:39: error: 'y' was not declared in this scope
11 | double b = x*(y1 - y2) + x1*(y2 - y) + x2*(y - y1);
| ^
|
s479079037
|
p00012
|
C++
|
using namespace std;
typedef complex<double> xy_t;
xy_t a, b, c, p;
double x1, x2, x3, xp, y_1, y2, y3, yp;
double s1, s2, s3;
int main()
{
while(cin >> x1 >> y_1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
{
a=xy_t(x1, y_1);
b=xy_t(x2, y2);
c=xy_t(x3, y3);
p=xy_t(xp, yp);
s1=(conj(a-p)*(b-p)).imag();
s2=(conj(b-p)*(c-p)).imag();
s3=(conj(c-p)*(a-p)).imag();
if(((s1>0)&&(s2>0)&&(s3>0))||((s1<0)&&(s2<0)&&(s3<0)))
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc:2:9: error: 'complex' does not name a type
2 | typedef complex<double> xy_t;
| ^~~~~~~
a.cc:3:1: error: 'xy_t' does not name a type
3 | xy_t a, b, c, p;
| ^~~~
a.cc: In function 'int main()':
a.cc:8:15: error: 'cin' was not declared in this scope
8 | while(cin >> x1 >> y_1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:10:17: error: 'a' was not declared in this scope
10 | a=xy_t(x1, y_1);
| ^
a.cc:10:19: error: 'xy_t' was not declared in this scope
10 | a=xy_t(x1, y_1);
| ^~~~
a.cc:11:17: error: 'b' was not declared in this scope
11 | b=xy_t(x2, y2);
| ^
a.cc:12:17: error: 'c' was not declared in this scope
12 | c=xy_t(x3, y3);
| ^
a.cc:13:17: error: 'p' was not declared in this scope; did you mean 'yp'?
13 | p=xy_t(xp, yp);
| ^
| yp
a.cc:14:21: error: 'conj' was not declared in this scope
14 | s1=(conj(a-p)*(b-p)).imag();
| ^~~~
a.cc:19:25: error: 'cout' was not declared in this scope
19 | cout << "YES" << endl;
| ^~~~
a.cc:19:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:42: error: 'endl' was not declared in this scope
19 | cout << "YES" << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
a.cc:23:25: error: 'cout' was not declared in this scope
23 | cout << "NO" << endl;
| ^~~~
a.cc:23:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:41: error: 'endl' was not declared in this scope
23 | cout << "NO" << endl;
| ^~~~
a.cc:23:41: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s543915655
|
p00012
|
C++
|
#include<iostream>
#include<complex>
#include<cmath>
#include<queue>
using namespace std;
typedef complex<double> xy_t;
double cross_product(xy_t p,xy_t q);
{
return (conj(p)*q).imag();
}
int main()
{
double x[4],y[4];
while(true){
for( int i = 0; i < 4; ++i) cin >> x[i] >> y[i];
if(!cin) break;
xy_t a(x[0],y[0]),b(x[1],y[1]),c(x[2],y[2]),p(x[3],y[3]);
double S1,S2,S3;
S1 = cross_product(a - p, b - p);
S2 = cross_product(b - p, c - p);
S3 = cross_product(c - p, a - p);
bool ok = (S1 > 0 && S2 > 0 && S3 > 0) || (S1 < 0 && S2 < 0 && S3 < 0);
cout << (ok ? "YES":"NO") << endl;
}
}
|
a.cc:8:1: error: expected unqualified-id before '{' token
8 | {
| ^
|
s510835495
|
p00012
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
double x[4],y[4],r[3];
void che(a,b){
if(x[a]>x[b]){
swap(x[a],x[b]);
swap(y[a],y[b]);
}
}
int main(){
int m=0;
while(cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>x[3]>>y[3]){
che(0,1);
che(1,2);
che(0,1);
if(y[0]<=y[3] && y[3]<=y[1]){
r[0]=x[0]+(x[2]-x[0])*(y[3]-y[0])/(y[2]-y[0]);
r[1]=x[0]+(x[1]-x[0])*(y[3]-y[0])/(y[1]-y[0]);
if(r[0]>r[1])swap(r[0],r[1]);
}else if(y[1]<=y[3] && y[3]<=y[2]){
r[0]=x[2]+(x[0]-x[2])*(y[2]-y[3])/(y[2]-y[0]);
r[1]=x[2]+(x[1]-x[2])*(y[2]-y[3])/(y[2]-y[1]);
if(r[0]>r[1])swap(r[0],r[1]);
}else{
cout<<"NO"<<endl;
continue;
}
if(r[0]<=x[3] && x[3]<=r[1]){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
return 0;
}
|
a.cc:5:6: error: variable or field 'che' declared void
5 | void che(a,b){
| ^~~
a.cc:5:10: error: 'a' was not declared in this scope
5 | void che(a,b){
| ^
a.cc:5:12: error: 'b' was not declared in this scope
5 | void che(a,b){
| ^
a.cc: In function 'int main()':
a.cc:14:17: error: 'che' was not declared in this scope
14 | che(0,1);
| ^~~
|
s024588328
|
p00012
|
C++
|
#include<iostream>
using namespace std;
double cross(double x1, double y1, double x2, double y2){
return (x1 * y2) - (y1 * x2);
}
int main(){
double x[3], y[3], x, y;
while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
double ret[3];
for(int i = 0; i < 3; ++i ){
int n =( i+1 ) % 3;
ret[i] = cross( px - x[i], py - y[i], x[n] - x[i], y[n] - y[i] );
}
if(ret[0] < 0 && ret[1] < 0 && ret[2] < 0
|| ret[0] > 0 && ret[1] > 0 && ret[2] > 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:7:28: error: conflicting declaration 'double x'
7 | double x[3], y[3], x, y;
| ^
a.cc:7:16: note: previous declaration as 'double x [3]'
7 | double x[3], y[3], x, y;
| ^
a.cc:7:31: error: conflicting declaration 'double y'
7 | double x[3], y[3], x, y;
| ^
a.cc:7:22: note: previous declaration as 'double y [3]'
7 | double x[3], y[3], x, y;
| ^
a.cc:8:70: error: 'px' was not declared in this scope; did you mean 'x'?
8 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
| ^~
| x
a.cc:8:76: error: 'py' was not declared in this scope; did you mean 'y'?
8 | while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
| ^~
| y
|
s163764995
|
p00012
|
C++
|
#include <iostream>
using namespace std;
class point{ // as necessary
private:
static const double EPS=1e-5;
public:
static const int COUNTER_CLOCKWISE=1;
static const int CLOCKWISE=-1;
static const int ONLINE_BACK=2;
static const int ONLINE_FRONT=-2;
static const int ON_SEGMENT=0;
double x;
double y;
point(double x=0,double y=0):x(x),y(y){}
point operator+(point p){return point(x+p.x,y+p.y);}
point operator-(point p){return point(x-p.x,y-p.y);}
point operator*(const double a){return point(x*a,y*a);}
point operator/(const double a){return point(x/a,y/a);}
static double dot(const point &p1,const point &p2){
return p1.x*p2.x+p1.y*p2.y;
}
double norm(){
return x*x+y*y;
}
double abs(){
return sqrt(norm());
}
static double cross(point p1,point p2){
return p1.x*p2.y-p1.y*p2.x;
}
static int ccw(point p0,point p1,point p2){
point a=p1-p0; // ??????p0p1
point b=p2-p0; // ??????p0p2
if(cross(a,b)>EPS) return COUNTER_CLOCKWISE; // a????????????b??????????¨?
if(cross(a,b)<-EPS) return CLOCKWISE; // a????????????b???????¨?
if(dot(a,b)<-EPS) return ONLINE_BACK; // p2-p0-p1???????????¢???
if(a.norm(),b.norm()) return ONLINE_FRONT; // p0-p1-p2???????????¢???
return ON_SEGMENT; // p0-p2-p1???????????¢???
}
};
int main(void){
double x,y;
while(cin>>x>>y){
int rcw=0;
int cw=0;
point a(x,y);
cin>>x>>y;
point b(x,y);
cin>>x>>y;
point c(x,y);
cin>>x>>y;
point d(x,y);
switch(point::ccw(d,a,b)){
case point::COUNTER_CLOCKWISE:rcw++;break;
case point::CLOCKWISE:cw++;break;
}
switch(point::ccw(d,b,c)){
case point::COUNTER_CLOCKWISE:rcw++;break;
case point::CLOCKWISE:cw++;break;
}
switch(point::ccw(d,c,a)){
case point::COUNTER_CLOCKWISE:rcw++;break;
case point::CLOCKWISE:cw++;break;
}
if(rcw==1&&cw==2)cout<<"NO"<<endl;
else cout<<"YES"<<endl;
}
}
|
a.cc:6:37: error: 'constexpr' needed for in-class initialization of static data member 'const double point::EPS' of non-integral type [-fpermissive]
6 | static const double EPS=1e-5;
| ^~~
a.cc: In member function 'double point::abs()':
a.cc:32:32: error: 'sqrt' was not declared in this scope
32 | return sqrt(norm());
| ^~~~
|
s521740937
|
p00012
|
C++
|
#include <bits/stdc++.h>
using namespace std;
using db = double;
const db eps = 1e-6;
struct poi {
db x, y;
void r() { cin >> x >> y; }
poi operator -(poi p) {
return {x - p.x, y - p.y};
}
db cross(poi p) {
return x * p.y - y * p.x;
}
};
db xmul(poi a, poi b, poi c) {
return (b - a).cross(c - a);
}
int main() {
ios :: sync_with_stdio(false);
poi a, b, c, p;
while(cin >> a.x >> a.y) {
b.r(); c.r(); p.r();
poi s = abs(xmul(a, b, c));
poi t = abs(xmul(p, a, b)) + abs(xmul(p, b, c)) + abs(xmul(p, c, a));
if(s < t + eps && t < s + eps)
cout << "YES\n";
else
cout << "NO\n";
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:26:28: error: conversion from 'double' to non-scalar type 'poi' requested
26 | poi s = abs(xmul(a, b, c));
| ~~~^~~~~~~~~~~~~~~
a.cc:27:65: error: conversion from 'double' to non-scalar type 'poi' requested
27 | poi t = abs(xmul(p, a, b)) + abs(xmul(p, b, c)) + abs(xmul(p, c, a));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:28:26: error: no match for 'operator+' (operand types are 'poi' and 'const db' {aka 'const double'})
28 | if(s < t + eps && t < s + eps)
| ~ ^ ~~~
| | |
| poi const db {aka const double}
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'const db' {aka 'const double'}
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'const db' {aka 'const double'}
28 | if(s < t + eps && t < s + eps)
| ^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: 'poi' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3616 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: mismatched types 'const _CharT*' and 'poi'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'const db' {aka 'const double'}
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: 'poi' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: 'poi' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: 'poi' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: 'poi' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: 'poi' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3719 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: mismatched types 'const _CharT*' and 'poi'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3726 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'const db' {aka 'const double'}
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed:
a.cc:28:28: note: 'poi' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
28 | if(s < t + eps && t < s + eps)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)'
3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substit
|
s704945076
|
p00012
|
C++
|
#include <iostream>
using namespace std;
struct TPoint
{
double x;
double y;
};
double GetCrossProduct(const TPoint& V1, const TPoint& V2)
{
return V1.x * V2.y - V1.y * V2.x;
}
double Vector(const TPoint& P1, const TPoint& P2)
{
return {P2.x - P1.x, P2.y - P1.y};
}
bool IsSameSide(const TPoint& P1, const TPoint& P2, const TPoint& L1, const TPoint& L2)
{
return GetCrossProduct(Vector(L1, P1), Vector(L1, L2)) * GetCrossProduct(Vector(L1, P2), Vector(L1, L2)) > 0;
}
int main()
{
while(true){
TPoint A1, A2, A3, Ap;
cin >> A1.x >> A1.y >> A2.x >> A2.y >> A3.x >> A3.y >> Ap.x >> Ap.y;
if(cin.eof() == true) break;
if(IsSameSide(A3, Ap, A1, A2) && IsSameSide(A1, Ap, A2, A3) && IsSameSide(A2, Ap, A3, A1)){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc: In function 'double Vector(const TPoint&, const TPoint&)':
a.cc:17:41: error: cannot convert '<brace-enclosed initializer list>' to 'double' in return
17 | return {P2.x - P1.x, P2.y - P1.y};
| ^
a.cc: In function 'bool IsSameSide(const TPoint&, const TPoint&, const TPoint&, const TPoint&)':
a.cc:22:38: error: invalid initialization of reference of type 'const TPoint&' from expression of type 'double'
22 | return GetCrossProduct(Vector(L1, P1), Vector(L1, L2)) * GetCrossProduct(Vector(L1, P2), Vector(L1, L2)) > 0;
| ~~~~~~^~~~~~~~
a.cc:10:38: note: in passing argument 1 of 'double GetCrossProduct(const TPoint&, const TPoint&)'
10 | double GetCrossProduct(const TPoint& V1, const TPoint& V2)
| ~~~~~~~~~~~~~~^~
a.cc:22:88: error: invalid initialization of reference of type 'const TPoint&' from expression of type 'double'
22 | return GetCrossProduct(Vector(L1, P1), Vector(L1, L2)) * GetCrossProduct(Vector(L1, P2), Vector(L1, L2)) > 0;
| ~~~~~~^~~~~~~~
a.cc:10:38: note: in passing argument 1 of 'double GetCrossProduct(const TPoint&, const TPoint&)'
10 | double GetCrossProduct(const TPoint& V1, const TPoint& V2)
| ~~~~~~~~~~~~~~^~
|
s249628667
|
p00012
|
C++
|
#include<iostream>
using namespace std;
int main()
double x
{
double x1,y1,x2,y2,x3,y3,xp,yp;
while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
{
if(y1<y2&&y3<y2)
{
for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)>(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)>(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)<(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
cout<<"YES"<<endl;
break;
}
}
else if(y1>y2&&y1>y1)
{
for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)>(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)<(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)>(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
cout<<"YES"<<endl;
break;
}
}
}
else if(y3>y1&&y3>y2)
{
for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)<(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)>(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)>(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
cout<<"YES"<<endl;
break;
}
else
{
cout<<"NO"<<endl;
}
return 0;
}
|
a.cc:4:1: error: expected initializer before 'double'
4 | double x
| ^~~~~~
|
s960108040
|
p00012
|
C++
|
import java.util.*;
import java.io.*;
import java.math.*;
public class Main {
public static void main(String args[])throws Exception{
Scanner cin= new Scanner(System.in);
while(cin.hasNextDouble()){
double in[] = new double[8];
for(int i=0;i<8;i++) in[i]= cin.nextDouble();
int t1,t2,t3;
t1= java.awt.geom.Line2D.relativeCCW(in[0],in[1],in[2],in[3],in[6],in[7]);
t2= java.awt.geom.Line2D.relativeCCW(in[2],in[3],in[4],in[5],in[6],in[7]);
t3= java.awt.geom.Line2D.relativeCCW(in[4],in[5],in[0],in[1],in[6],in[7]);
if((t1==1 && t2==1 && t3==1) || (t1==-1 && t2==-1 && t3==-1)) System.out.println("YES");
else System.out.println("NO");
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.math.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
5 | public class Main {
| ^~~~~~
|
s556911540
|
p00012
|
C++
|
import java.util.Scanner;
class Main
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
while (true)
{
double x1, y1, x2, y2, x3, y3, xp, yp;
try
{
x1 = sc.nextDouble();
y1 = sc.nextDouble();
x2 = sc.nextDouble();
y2 = sc.nextDouble();
x3 = sc.nextDouble();
y3 = sc.nextDouble();
xp = sc.nextDouble();
yp = sc.nextDouble();
}
catch (Exception e)
{
break;
}
if (!((f(x1, y1, x2, y2, x3) < y3 && f(x1, y1, x2, y2, xp) < yp)
|| (f(x1, y1, x2, y2, x3) > y3 && f(x1, y1, x2, y2, xp) > yp)
)) {
System.out.println("NO");
continue;
}
if (!((f(x2, y2, x3, y3, x1) < y1 && f(x2, y2, x3, y3, xp) < yp)
|| (f(x2, y2, x3, y3, x1) > y1 && f(x2, y2, x3, y3, xp) > yp)
)) {
System.out.println("NO");
continue;
}
if (!((f(x3, y3, x1, y1, x2) < y2 && f(x3, y3, x1, y1, xp) < yp)
|| (f(x3, y3, x1, y1, x2) > y2 && f(x3, y3, x1, y1, xp) > yp)
)) {
System.out.println("NO");
continue;
}
System.out.println("YES");
}
}
private static double f(double x1, double y1, double x2, double y2, double x)
{
return (y1 - y2) / (x1 - x2) * (x - x1) + y1;
}
}
|
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:5:15: error: expected ':' before 'static'
5 | public static void main(String args[])
| ^~~~~~~
| :
a.cc:5:33: error: 'String' has not been declared
5 | public static void main(String args[])
| ^~~~~~
a.cc:49:16: error: expected ':' before 'static'
49 | private static double f(double x1, double y1, double x2, double y2, double x)
| ^~~~~~~
| :
a.cc:53:2: error: expected ';' after class definition
53 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:7:17: error: 'Scanner' was not declared in this scope
7 | Scanner sc = new Scanner(System.in);
| ^~~~~~~
a.cc:14:38: error: 'sc' was not declared in this scope
14 | x1 = sc.nextDouble();
| ^~
a.cc:23:32: error: 'Exception' does not name a type
23 | catch (Exception e)
| ^~~~~~~~~
a.cc:31:33: error: 'System' was not declared in this scope
31 | System.out.println("NO");
| ^~~~~~
a.cc:37:33: error: 'System' was not declared in this scope
37 | System.out.println("NO");
| ^~~~~~
a.cc:43:33: error: 'System' was not declared in this scope
43 | System.out.println("NO");
| ^~~~~~
a.cc:46:25: error: 'System' was not declared in this scope
46 | System.out.println("YES");
| ^~~~~~
|
s361848089
|
p00012
|
C++
|
#include <iostream>
#include <cmath>
#define mul(s, t) ((s-t)*(s-t))
using namespace std;
int main()
{
double x[3], y[3], u[2], s, t, v;
while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> s >> t){
bool f = true;
for(int i = 0; i < 3; i++){
int p = 0;
for(int j = 0; j < 3; j++){
if(i != j){
u[p++] = sqrt(mul(x[i], x[j])+mul(y[i], y[j]));
}
}
v = sqrt(mul(x[i], s)+mul(y[i], t));
if(u[0] =< v || u[1] =< v){
f = false;
break;
}
}
cout << ((f)? "YES" : "NO") << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:34: error: expected primary-expression before '<' token
22 | if(u[0] =< v || u[1] =< v){
| ^
a.cc:22:47: error: expected primary-expression before '<' token
22 | if(u[0] =< v || u[1] =< v){
| ^
|
s733098666
|
p00012
|
C++
|
#include <iostream>
using namespace std;
double x[4],y[4],px,py,ax,ay,bx,by;
int main()
{
while(true)
{
for(int i = 1;i<=3;i++){cin >> x[i];cin >> y[i];}
if(cin.eof()){break;}
cin >> px;
cin >> py;
double m,n;
ax = x[2]-x[1];
ay = y[2]-y[1];
bx = x[3]-x[1];
by = y[3]-y[1];
double det = ax*by-ay*bx;
m = (by*px-bx*py)/det;
n = (-ay*px+ax*py)/det;
if(m>0 && m < 1 && n > 0 && n < 1 && m+n < 1 ) {cout << "YES" << endl;}
else {cout << "NO" << endl};
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:43: error: expected ';' before '}' token
21 | else {cout << "NO" << endl};
| ^
| ;
|
s888387318
|
p00012
|
C++
|
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
public class Main {
Scanner sc;
void run() {
sc = new Scanner(System.in);
Point[] a = new Point [4];
while (sc.hasNext()){
for (int i=0;i<4;i++) {
double x = sc.nextDouble();
double y = sc.nextDouble();
a[i] = new Point(x,y);
}
Line[] l = new Line[3];
Line[] lc = new Line [3];
boolean flg = true;
for (int i=0;i<3;i++) {
l[i] = new Line(a[i%3], a[(i+1)%3]);
lc[i] = new Line(a[(i+2)%3], a[3]);
if (l[i].judgeCloss(lc[i])) {
flg = false;
break;
}
}
if (flg)
System.out.println("YES");
else System.out.println("NO");
}
}
public static void main(String[] args) {
new Main().run();
}
}
class Point {
private double x;
private double y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public double getX(){
return x;
}
public double getY() {
return y;
}
}
class Line {
Point a1;
Point a2;
public Line (Point a, Point b) {
a1 = a;
a2 = b;
}
public Point getS() {
return a1;
}
public Point getE() {
return a2;
}
public boolean judgeCloss(Line l) {
double a = ( (a1.getY() - l.getS().getY()) * (l.getS().getX() - l.getE().getX() - (l.getS().getY() - l.getE().getY()) * (a1.getX() - l.getS().getX())) );
double b = ( (a2.getY() - l.getS().getY()) * (l.getS().getX() - l.getE().getX() - (l.getS().getY() - l.getE().getY()) * (a2.getX() - l.getS().getX())) );
// System.out.println( a + " " + b );
if (a*b >= 0)
return false;
else return true;
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.lang.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.math.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.io.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
6 | public class Main {
| ^~~~~~
a.cc:42:16: error: expected ':' before 'double'
42 | private double x;
| ^~~~~~~
| :
a.cc:43:16: error: expected ':' before 'double'
43 | private double y;
| ^~~~~~~
| :
a.cc:44:15: error: expected ':' before 'Point'
44 | public Point(double x, double y) {
| ^~~~~~
| :
a.cc:48:15: error: expected ':' before 'double'
48 | public double getX(){
| ^~~~~~~
| :
a.cc:51:15: error: expected ':' before 'double'
51 | public double getY() {
| ^~~~~~~
| :
a.cc:54:2: error: expected ';' after class definition
54 | }
| ^
| ;
a.cc: In constructor 'Point::Point(double, double)':
a.cc:45:22: error: request for member 'x' in '(Point*)this', which is of pointer type 'Point*' (maybe you meant to use '->' ?)
45 | this.x = x;
| ^
a.cc:46:22: error: request for member 'y' in '(Point*)this', which is of pointer type 'Point*' (maybe you meant to use '->' ?)
46 | this.y = y;
| ^
a.cc: At global scope:
a.cc:59:15: error: expected ':' before 'Line'
59 | public Line (Point a, Point b) {
| ^~~~~
| :
a.cc:63:15: error: expected ':' before 'Point'
63 | public Point getS() {
| ^~~~~~
| :
a.cc:66:15: error: expected ':' before 'Point'
66 | public Point getE() {
| ^~~~~~
| :
a.cc:69:15: error: expected ':' before 'boolean'
69 | public boolean judgeCloss(Line l) {
| ^~~~~~~~
| :
a.cc:69:16: error: 'boolean' does not name a type; did you mean 'bool'?
69 | public boolean judgeCloss(Line l) {
| ^~~~~~~
| bool
a.cc:80:2: error: expected ';' after class definition
80 | }
| ^
| ;
a.cc: In constructor 'Line::Line(Point, Point)':
a.cc:59:40: error: no matching function for call to 'Point::Point()'
59 | public Line (Point a, Point b) {
| ^
a.cc:44:16: note: candidate: 'Point::Point(double, double)'
44 | public Point(double x, double y) {
| ^~~~~
a.cc:44:16: note: candidate expects 2 arguments, 0 provided
a.cc:41:7: note: candidate: 'constexpr Point::Point(const Point&)'
41 | class Point {
| ^~~~~
a.cc:41:7: note: candidate expects 1 argument, 0 provided
a.cc:41:7: note: candidate: 'constexpr Point::Point(Point&&)'
a.cc:41:7: note: candidate expects 1 argument, 0 provided
a.cc:59:40: error: no matching function for call to 'Point::Point()'
59 | public Line (Point a, Point b) {
| ^
a.cc:44:16: note: candidate: 'Point::Point(double, double)'
44 | public Point(double x, double y) {
| ^~~~~
a.cc:44:16: note: candidate expects 2 arguments, 0 provided
a.cc:41:7: note: candidate: 'constexpr Point::Point(const Point&)'
41 | class Point {
| ^~~~~
a.cc:41:7: note: candidate expects 1 argument, 0 provided
a.cc:41:7: note: candidate: 'constexpr Point::Point(Point&&)'
a.cc:41:7: note: candidate expects 1 argument, 0 provided
|
s338547741
|
p00012
|
C++
|
#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
double x1, y1, x2, y2, x3, y3, xp, yp;
while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
double sall = (x1-x2)*(y1+y2) + (x2-x3)*(y2+y3) + (x3-x1)*(y3+y1);
double s1 = (x1-x2)*(y1+y2) + (x2-xp)*(y2+yp) + (xp-x1)*(yp+y1);
double s2 = (x1-xp)*(y1+yp) + (xp-x3)*(yp+y3) + (x3-x1)*(y3+y1);
double s3 = (xp-x2)*(yp+y2) + (x2-x3)*(y2+y3) + (x3-xp)*(y3+yp);
if(fabs(sall) == fabs(s1)+fabs(s2)+fabs(s3)){
cout<<"YES"<<endl;
} else {
cout<<"NO"<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:20: error: 'fabs' was not declared in this scope; did you mean 'labs'?
12 | if(fabs(sall) == fabs(s1)+fabs(s2)+fabs(s3)){
| ^~~~
| labs
|
s055962959
|
p00012
|
C++
|
#include <iostream>
#include <cmath>
using namespace std;
int main(void){
ツ ツ double x1, y1, x2, y2, x3, y3, px, py;
ツ ツ double a, b, c, ap, bp, cp;
ツ ツ double tmp;
ツ ツ double s2, sa2, sb2, sc2;
ツ ツ double s, sa, sb, sc;
ツ ツ while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>px>>py){
ツ ツ ツ ツ a = sqrt(fabs((x2-x3) * (x2-x3) + (y2-y3) * (y2-y3)));
ツ ツ ツ ツ b = sqrt(fabs((x1-x3) * (x1-x3) + (y1-y3) * (y1-y3)));
ツ ツ ツ ツ c = sqrt(fabs((x1-x2) * (x1-x2) + (y1-y2) * (y1-y2)));
ツ ツ ツ ツ ap = sqrt(fabs((x1-px) * (x1-px) + (y1-py) * (y1-py)));
ツ ツ ツ ツ bp = sqrt(fabs((x2-px) * (x2-px) + (y2-py) * (y2-py)));
ツ ツ ツ ツ cp = sqrt(fabs((x3-px) * (x3-px) + (y3-py) * (y3-py)));
ツ ツ ツ ツ
ツ ツ ツ ツ tmp = (a+b+c) / 2;
ツ ツ ツ ツ s2 = tmp * (tmp-a) * (tmp-b) * (tmp-c);
ツ ツ ツ ツ s = sqrt(s2);
ツ ツ ツ ツ tmp = (a+bp+cp) / 2;
ツ ツ ツ ツ sa2 = tmp * (tmp-a) * (tmp-bp) * (tmp-cp);
ツ ツ ツ ツ sa = sqrt(sa2);
ツ ツ ツ ツ tmp = (b+ap+cp) / 2;
ツ ツ ツ ツ sb2 = tmp * (tmp-b) * (tmp-ap) * (tmp-cp);
ツ ツ ツ ツ sb = sqrt(sb2);
ツ ツ ツ ツ tmp = (c+ap+bp) / 2;
ツ ツ ツ ツ sc2 = tmp * (tmp-c) * (tmp-ap) * (tmp-bp);
ツ ツ ツ ツ sc = sqrt(sc2);
ツ ツ ツ ツ if(fabs(sa+sb+sc-s) < ie-9) cout << "YES" << endl;
ツ ツ ツ ツ else cout << "NO" << endl;
ツ ツ }
ツ ツ return 0;
}
|
a.cc:6:1: error: extended character is not valid in an identifier
6 | ツ ツ double x1, y1, x2, y2, x3, y3, px, py;
| ^
a.cc:6:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
7 | ツ ツ double a, b, c, ap, bp, cp;
| ^
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
8 | ツ ツ double tmp;
| ^
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:9:1: error: extended character is not valid in an identifier
9 | ツ ツ double s2, sa2, sb2, sc2;
| ^
a.cc:9:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
10 | ツ ツ double s, sa, sb, sc;
| ^
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
12 | ツ ツ while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>px>>py){
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
13 | ツ ツ ツ ツ a = sqrt(fabs((x2-x3) * (x2-x3) + (y2-y3) * (y2-y3)));
| ^
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
14 | ツ ツ ツ ツ b = sqrt(fabs((x1-x3) * (x1-x3) + (y1-y3) * (y1-y3)));
| ^
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
15 | ツ ツ ツ ツ c = sqrt(fabs((x1-x2) * (x1-x2) + (y1-y2) * (y1-y2)));
| ^
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
16 | ツ ツ ツ ツ ap = sqrt(fabs((x1-px) * (x1-px) + (y1-py) * (y1-py)));
| ^
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
17 | ツ ツ ツ ツ bp = sqrt(fabs((x2-px) * (x2-px) + (y2-py) * (y2-py)));
| ^
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
18 | ツ ツ ツ ツ cp = sqrt(fabs((x3-px) * (x3-px) + (y3-py) * (y3-py)));
| ^
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
19 | ツ ツ ツ ツ
| ^
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
20 | ツ ツ ツ ツ tmp = (a+b+c) / 2;
| ^
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
21 | ツ ツ ツ ツ s2 = tmp * (tmp-a) * (tmp-b) * (tmp-c);
| ^
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
22 | ツ ツ ツ ツ s = sqrt(s2);
| ^
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
23 | ツ ツ ツ ツ tmp = (a+bp+cp) / 2;
| ^
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
24 | ツ ツ ツ ツ sa2 = tmp * (tmp-a) * (tmp-bp) * (tmp-cp);
| ^
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
25 | ツ ツ ツ ツ sa = sqrt(sa2);
| ^
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
26 | ツ ツ ツ ツ tmp = (b+ap+cp) / 2;
| ^
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
27 | ツ ツ ツ ツ sb2 = tmp * (tmp-b) * (tmp-ap) * (tmp-cp);
| ^
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
28 | ツ ツ ツ ツ sb = sqrt(sb2);
| ^
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:29:1: error: extended character is not valid in an identifier
29 | ツ ツ ツ ツ tmp = (c+ap+bp) / 2;
| ^
a.cc:29:1: error: extended character is not valid in an identifier
a.cc:29:1: error: extended character is not valid in an identifier
a.cc:29:1: error: extended character is not valid in an identifier
a.cc:30:1: error: extended character is not valid in an identifier
30 | ツ ツ ツ ツ sc2 = tmp * (tmp-c) * (tmp-ap) * (tmp-bp);
| ^
a.cc:30:1: error: extended character is not valid in an identifier
a.cc:30:1: error: extended character is not valid in an identifier
a.cc:30:1: error: extended character is not valid in an identifier
a.cc:31:1: error: extended character is not valid in an identifier
31 | ツ ツ ツ ツ sc = sqrt(sc2);
| ^
a.cc:31:1: error: extended character is not valid in an identifier
a.cc:31:1: error: extended character is not valid in an identifier
a.cc:31:1: error: extended character is not valid in an identifier
a.cc:32:1: error: extended character is not valid in an identifier
32 | ツ ツ ツ ツ if(fabs(sa+sb+sc-s) < ie-9) cout << "YES" << endl;
| ^
a.cc:32:1: error: extended character is not valid in an identifier
a.cc:32:1: error: extended character is not valid in an identifier
a.cc:32:1: error: extended character is not valid in an identifier
a.cc:33:1: error: extended character is not valid in an identifier
33 | ツ ツ ツ ツ else cout << "NO" << endl;
| ^
a.cc:33:1: error: extended character is not valid in an identifier
a.cc:33:1: error: extended character is not valid in an identifier
a.cc:33:1: error: extended character is not valid in an identifier
a.cc:34:1: error: extended character is not valid in an identifier
34 | ツ ツ }
| ^
a.cc:34:1: error: extended character is not valid in an identifier
a.cc:35:1: error: extended character is not valid in an identifier
35 | ツ ツ return 0;
| ^
a.cc:35:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:6:1: error: '\U000030c4\U00003000\U000030c4\U00003000double' was not declared in this scope
6 | ツ ツ double x1, y1, x2, y2, x3, y3, px, py;
| ^~~~~~~~~~~~~~
a.cc:7:15: error: expected ';' before 'a'
7 | ツ ツ double a, b, c, ap, bp, cp;
| ^~
| ;
a.cc:8:15: error: expected ';' before 'tmp'
8 | ツ ツ double tmp;
| ^~~~
| ;
a.cc:9:15: error: expected ';' before 's2'
9 | ツ ツ double s2, sa2, sb2, sc2;
| ^~~
| ;
a.cc:10:15: error: expected ';' before 's'
10 | ツ ツ double s, sa, sb, sc;
| ^~
| ;
a.cc:12:20: error: 'x1' was not declared in this scope; did you mean 'y1'?
12 | ツ ツ while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>px>>py){
| ^~
| y1
a.cc:12:28: error: 'x2' was not declared in this scope
12 | ツ ツ while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>px>>py){
| ^~
a.cc:12:32: e
|
s735136979
|
p00012
|
C++
|
#include <iostream> |#include <iostream>
using namespace std; |#include <stdio.h>
|#include <math.h>
int main() { |using namespace std;
double x1,y1,x2,y2,x3,y3,xp,yp; |
double a[2],b[2]; |int main() {
double A,B; | double a, b, c, d, e, f;
while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) { | double x, y;
a[0] = x2 - x1; | while( cin >> a >> b >> c >> d >> e >> f) {
a[1] = y2- y1; |x = (c * e - b * f) / (a * e - b * d);
b[0] = x3 - x1; | y = (a * f - c * d) / (a * e - b * d);
b[1] = y3 - y1; | x *= 1000;
//vect[0] = A * a[0] + B * b[0]; | x += 0.5;
//vect[1] = A * a[1] + B * b[1]; | x = floor(x);
A = (xp * b[1] - b[0] * yp) / (a[0] * b[1] - b[0] * a[1]); | x /= 1000;
B = (a[0] * yp - xp * a[1]) / (a[0] * b[1] - b[0] * a[1]); | y *= 1000;
if ((A+B <= 1) && (A > 0) && (B > 0)) { | y += 0.5;
cout << "YES" << endl; | y = floor(y);
} | y /= 1000;
else { |
cout << "NO" << endl; | printf("%.3f %.3f\n", x, y);
} |
} | }
}
|
a.cc:1:90: warning: extra tokens at end of #include directive
1 | #include <iostream> |#include <iostream>
| ^
a.cc:2:91: error: stray '#' in program
2 | using namespace std; |#include <stdio.h>
| ^
a.cc:3:91: error: stray '#' in program
3 | |#include <math.h>
| ^
a.cc:2:90: error: expected unqualified-id before '|' token
2 | using namespace std; |#include <stdio.h>
| ^
|
s724691793
|
p00012
|
C++
|
#include <iostream>
#include <algorithm>
#include <utility>
using namespace std;
pair<double,double> tp[3];
pair<double,double> p;
bool flag=true;
int main(){
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&tp[0].first,&tp[0].second,&tp[1].first,&tp[1].second,&tp[2].first,&tp[2].second,&p.first,&p.second) == 8){
flag=true;
for(int i=0;i<3;i++){
if (tp[i%3].second-tp[(i+1)%3].second==0){
if(
(p.second-tp[i%3].second)
*(tp[(i+2)%2].second-tp[i%3].second)
<0
)flag=false;
}else {
printf("%lf\n",
(p.second - (tp[i%3].first-tp[(i+1)%3].first)/(tp[i%3].second-tp[(i+1)%3].second)*(p.first-tp[i%3].first)+tp[i%3].second)
*(tp[(i+2)%2].second - (tp[i%3].first-tp[(i+1)%3].first)/(tp[i%3].second-tp[(i+1)%3].second)*(tp[(i+2)%2].first-tp[i%3].first)+tp[i%3].second));
if(
(p.second - (tp[i%3].first-tp[(i+1)%3].first)/(tp[i%3].second-tp[(i+1)%3].second)*(p.first-tp[i%3].first)+tp[i%3].second)
*(tp[(i+2)%2].second - (tp[i%3].first-tp[(i+1)%3].first)/(tp[i%3].second-tp[(i+1)%3].second)*(tp[(i+2)%2].first-tp[i%3].first)+tp[i%3].second)
<0
)flag=false;
}
}
if(flag)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}
|
a.cc:50:1: error: extended character is not valid in an identifier
50 |
| ^
a.cc:50:1: error: '\U00003000' does not name a type
50 |
| ^~
|
s777314583
|
p00012
|
C++
|
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>
using namespace std;
double EPS = 1e-10;
double add(double a, double b){
if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
return a+b;
}
struct point{
double x, y;
point(){}
point(double x,double y) : x(x) , y(y){}
point operator + (point p){
return point(add(x,p.x), add(y,p.y));
}
point operator - (point p){
return point(add(x,-p.x), add(y,-p.y));
}
point operator * (double d){
return point(x*d,y*d);
}
};
double dot(point a, point b) {
return (a.x * b.x + a.y * b.y);
}
double cross(point a, point b) {
return (a.x * b.y - a.y * b.x);
}
int is_point_on_line(point a, point b, point c) {
return cross(b-a, c-a)==0.0 &&
(dot(b-a, c-a) > -EPS) &&
(dot(a-b, c-b) > -EPS);
}
int is_intersected_ls(point a1, point a2, point b1, point b2) {
if(cross(a1-a2,b1-b2)==0){
return is_point_on_line(a1,a2,b1) || is_point_on_line(a1,a2,b2)
|| is_point_on_line(b1,b2,a1) || is_point_on_line(b1,b2,a2);
}
else {
return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}
}
int inside(point p, vector<point> ps){
point a,b;
a=b=p;
b.x=1000000;
int n=ps.size();
ps.push_back(ps[0]);
if(a.y<=ymn||a.y>=ymx)return 0;
for(int i=0;i<n;i++){
if(is_point_on_line(ps[i],ps[i+1],p))return 0;
}
int cnt1=0;
for(int i=0;i<n;i++)
if(is_point_on_line(a,b,ps[i]))cnt1++;
int cnt=0;
for(int i=0;i<n;i++)
if(is_intersected_ls(ps[i],ps[i+1],a,b))cnt++;
return (cnt-cnt1)%2;
}
int main(void){
point in[4],p;
vector<point>ps;
while(cin>>in[1].x>>in[1].y>>in[2].x>>in[2].y>>in[3].x>>in[3].y>>p.x>>p.y){
ps.clear();
for(int i=1;i<4;i++)
ps.push_back(in[i]);
if(inside(p,ps))cout << "YES" << endl;
else cout << "NO" << endl;
}
return 0;
}
|
a.cc: In function 'int inside(point, std::vector<point>)':
a.cc:70:11: error: 'ymn' was not declared in this scope; did you mean 'yn'?
70 | if(a.y<=ymn||a.y>=ymx)return 0;
| ^~~
| yn
a.cc:70:21: error: 'ymx' was not declared in this scope
70 | if(a.y<=ymn||a.y>=ymx)return 0;
| ^~~
|
s581394675
|
p00012
|
C++
|
struct Vec2 {
double x, y;
Vec2(double x_, double y_) : x(x_), y(y_) {}
};
bool in_the_triangle(const Vec2& a, const Vec2& b, const Vec2& c, const Vec2& p) {
Vec2 aa(a.x-p.x, a.y-p.y);
Vec2 bb(b.x-p.x, b.y-p.y);
Vec2 cc(c.x-p.x, c.y-p.y);
double k = aa.x*bb.y - bb.x*aa.y;
double l = bb.x*cc.y - cc.x*bb.y;
double m = cc.x*aa.y - aa.x*cc.y;
return (k * l > 0 && k * m > 0);
}
int main() {
Vec2 a,b,c,p;
while (scanf("%f%f%f%f%f%f%f%f",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y,&p.x,&p.y)) {
puts(in_the_triangle(a,b,c,p) ? "YES" : "NO");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:6: error: no matching function for call to 'Vec2::Vec2()'
17 | Vec2 a,b,c,p;
| ^
a.cc:3:3: note: candidate: 'Vec2::Vec2(double, double)'
3 | Vec2(double x_, double y_) : x(x_), y(y_) {}
| ^~~~
a.cc:3:3: note: candidate expects 2 arguments, 0 provided
a.cc:1:8: note: candidate: 'constexpr Vec2::Vec2(const Vec2&)'
1 | struct Vec2 {
| ^~~~
a.cc:1:8: note: candidate expects 1 argument, 0 provided
a.cc:1:8: note: candidate: 'constexpr Vec2::Vec2(Vec2&&)'
a.cc:1:8: note: candidate expects 1 argument, 0 provided
a.cc:17:8: error: no matching function for call to 'Vec2::Vec2()'
17 | Vec2 a,b,c,p;
| ^
a.cc:3:3: note: candidate: 'Vec2::Vec2(double, double)'
3 | Vec2(double x_, double y_) : x(x_), y(y_) {}
| ^~~~
a.cc:3:3: note: candidate expects 2 arguments, 0 provided
a.cc:1:8: note: candidate: 'constexpr Vec2::Vec2(const Vec2&)'
1 | struct Vec2 {
| ^~~~
a.cc:1:8: note: candidate expects 1 argument, 0 provided
a.cc:1:8: note: candidate: 'constexpr Vec2::Vec2(Vec2&&)'
a.cc:1:8: note: candidate expects 1 argument, 0 provided
a.cc:17:10: error: no matching function for call to 'Vec2::Vec2()'
17 | Vec2 a,b,c,p;
| ^
a.cc:3:3: note: candidate: 'Vec2::Vec2(double, double)'
3 | Vec2(double x_, double y_) : x(x_), y(y_) {}
| ^~~~
a.cc:3:3: note: candidate expects 2 arguments, 0 provided
a.cc:1:8: note: candidate: 'constexpr Vec2::Vec2(const Vec2&)'
1 | struct Vec2 {
| ^~~~
a.cc:1:8: note: candidate expects 1 argument, 0 provided
a.cc:1:8: note: candidate: 'constexpr Vec2::Vec2(Vec2&&)'
a.cc:1:8: note: candidate expects 1 argument, 0 provided
a.cc:17:12: error: no matching function for call to 'Vec2::Vec2()'
17 | Vec2 a,b,c,p;
| ^
a.cc:3:3: note: candidate: 'Vec2::Vec2(double, double)'
3 | Vec2(double x_, double y_) : x(x_), y(y_) {}
| ^~~~
a.cc:3:3: note: candidate expects 2 arguments, 0 provided
a.cc:1:8: note: candidate: 'constexpr Vec2::Vec2(const Vec2&)'
1 | struct Vec2 {
| ^~~~
a.cc:1:8: note: candidate expects 1 argument, 0 provided
a.cc:1:8: note: candidate: 'constexpr Vec2::Vec2(Vec2&&)'
a.cc:1:8: note: candidate expects 1 argument, 0 provided
a.cc:18:8: error: 'scanf' was not declared in this scope
18 | while (scanf("%f%f%f%f%f%f%f%f",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y,&p.x,&p.y)) {
| ^~~~~
a.cc:19:3: error: 'puts' was not declared in this scope
19 | puts(in_the_triangle(a,b,c,p) ? "YES" : "NO");
| ^~~~
|
s805220544
|
p00012
|
C++
|
struct Vec2 {
double x, y;
Vec2(double x_, double y_) : x(x_), y(y_) {}
};
bool in_the_triangle(const Vec2& a, const Vec2& b, const Vec2& c, const Vec2& p) {
Vec2 aa(a.x-p.x, a.y-p.y);
Vec2 bb(b.x-p.x, b.y-p.y);
Vec2 cc(c.x-p.x, c.y-p.y);
double k = aa.x*bb.y - bb.x*aa.y;
double l = bb.x*cc.y - cc.x*bb.y;
double m = cc.x*aa.y - aa.x*cc.y;
return (k * l > 0 && k * m > 0);
}
int main() {
double a,b,c,d,e,f,g,h;
while (scanf("%f%f%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f,&g,&h)) {
puts(in_the_triangle(Vec2(a,b),Vec2(c,d),Vec2(e,f),Vec2(g,h)) ? "YES" : "NO");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:8: error: 'scanf' was not declared in this scope
18 | while (scanf("%f%f%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f,&g,&h)) {
| ^~~~~
a.cc:19:3: error: 'puts' was not declared in this scope
19 | puts(in_the_triangle(Vec2(a,b),Vec2(c,d),Vec2(e,f),Vec2(g,h)) ? "YES" : "NO");
| ^~~~
|
s812411683
|
p00012
|
C++
|
/*problem C*/
#include<stdio.h>
typedef struct{
double x,y;
}point_obj;
int isClossLine(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
return ( (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}
int main(){
point_obj p[5];
int i,j;
p[3].x=0;
p[3].y=0;
while(cin>>p[0].x){
cin>>p[0].y;
p[3].x=p[0].x;
p[3].y=p[0].y;
for(int i=0;i<3;i++){
cin>>p[i].x,cin>>p[i].y;
p[3].x+=p[i].x;
p[3].y+=p[i].y;
}
p[3].x+=p[0].x;
p[3].y+=p[0].y;
p[3].x/=3.0;
p[3].y/=3.0;
if(isClossLine(p[0].x,p[0].y,p[1].x,p[1].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0 &&
isClossLine(p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) >0 &&
isClossLine(p[0].x,p[0].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0){
printf("YES");
}
else{
printf("NO");
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:15: error: 'cin' was not declared in this scope
19 | while(cin>>p[0].x){
| ^~~
a.cc: At global scope:
a.cc:50:9: error: expected unqualified-id before 'return'
50 | return 0;
| ^~~~~~
a.cc:51:1: error: expected declaration before '}' token
51 | }
| ^
|
s826512622
|
p00012
|
C++
|
/*problem C*/
#include <iostream>
using namespace std;
typedef struct{
double x,y;
}point_obj;
int isClossLine(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
return ( (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}
int main(){
point_obj p[5];
int i,j;
p[3].x=0;
p[3].y=0;
while(cin>>p[0].x){
cin>>p[0].y;
p[3].x=p[0].x;
p[3].y=p[0].y;
for(int i=0;i<3;i++){
cin>>p[i].x,cin>>p[i].y;
p[3].x+=p[i].x;
p[3].y+=p[i].y;
}
p[3].x+=p[0].x;
p[3].y+=p[0].y;
p[3].x/=3.0;
p[3].y/=3.0;
if(isClossLine(p[0].x,p[0].y,p[1].x,p[1].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0 &&
isClossLine(p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) >0 &&
isClossLine(p[0].x,p[0].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0){
printf("YES");
}
else{
printf("NO");
}
}
}
return 0;
}
|
a.cc:51:9: error: expected unqualified-id before 'return'
51 | return 0;
| ^~~~~~
a.cc:52:1: error: expected declaration before '}' token
52 | }
| ^
|
s689336780
|
p00012
|
C++
|
double x1, y1, x2, y2, x3, y3, xp, yp;
while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
pair<double, double> a, b, p;
a.first = x2 - x1;
a.second = y2 - y1;
b.first = x3 - x1;
b.second = y3 - y1;
p.first = xp - x1;
p.second = yp - y1;
double theta = angle(a, b);
double phi = angle(a, p);
double psi = angle(b, p);
if (norm(p) > norm(a) || norm(p) > norm(b)) {
anslist.push_back("NO");
break;
}
if (phi > theta || psi > theta) {
anslist.push_back("NO");
break;
}
anslist.push_back("YES");
}
for(auto ans : anslist) {
cout << ans << endl;
}
return 0;
}
|
a.cc:3:16: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
3 | double x1, y1, x2, y2, x3, y3, xp, yp;
| ^~
a.cc:4:5: error: expected unqualified-id before 'while'
4 | while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
| ^~~~~
a.cc:27:5: error: expected unqualified-id before 'for'
27 | for(auto ans : anslist) {
| ^~~
a.cc:31:5: error: expected unqualified-id before 'return'
31 | return 0;
| ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
32 | }
| ^
|
s685915095
|
p00012
|
C++
|
double x1, y1, x2, y2, x3, y3, xp, yp;
while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
pair<double, double> a, b, p;
a.first = x2 - x1;
a.second = y2 - y1;
b.first = x3 - x1;
b.second = y3 - y1;
p.first = xp - x1;
p.second = yp - y1;
double theta = angle(a, b);
double phi = angle(a, p);
double psi = angle(b, p);
if (norm(p) > norm(a) || norm(p) > norm(b)) {
anslist.push_back("NO");
break;
}
if (phi > theta || psi > theta) {
anslist.push_back("NO");
break;
}
anslist.push_back("YES");
}
for(auto ans : anslist) {
cout << ans << endl;
}
return 0;
}
|
a.cc:3:16: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
3 | double x1, y1, x2, y2, x3, y3, xp, yp;
| ^~
a.cc:4:5: error: expected unqualified-id before 'while'
4 | while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
| ^~~~~
a.cc:27:5: error: expected unqualified-id before 'for'
27 | for(auto ans : anslist) {
| ^~~
a.cc:31:5: error: expected unqualified-id before 'return'
31 | return 0;
| ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
32 | }
| ^
|
s281727900
|
p00012
|
C++
|
#include<iostream>
#include<stdio.h>
using namespace std;
#define EPS 1e-10
struct point{
double x;
double y;
};
struct line{
double a; // 傾き
double b; // 切片
};
int recog_point_place( const point& a , const point&b , const point& c );
bool get_line( const point& a , const point& b , line *a_b );
int main(void)
{
point a, b, c, p;
int num_of_data;
while( scanf("%d", &num_of_data ) != EOF )
{
cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> p.x >> p.y;
int result_ab_c = recog_point_place( a , b , c );
int result_ab_p = recog_point_place( a , b , p );
int result_bc_a = recog_point_place( b , c , a );
int result_bc_p = recog_point_place( b , c , p );
int result_ca_b = recog_point_place( c , a , b );
int result_ca_p = recog_point_place( c , a , p );
if( result_ab_c == result_ab_p && result_bc_a == result_bc_p && result_ca_b == result_ca_p ) cout << "YES" << endl;
else cout << "NO" << endl;
}
return 0;
}
int recog_point_place( const point& a , const point&b , const point& c )
{
line a_b;
bool result = get_line( a , b , &a_b );
if( result == false )
{
if( (a.x + b.x)/2 < c.x ) return 1; // 点が直線より右にある場合に1をリターン
else return 0;
}
else if( result == true )
{
if( c.y > a_b.a * c.x + a_b.b ) return 1; // 点が直線より上にある場合に1をリターン
else return 0;
}
}
bool get_line( const point& a , const point& b , line *a_b )
{
if( fabs(a.x - b.x) < EPS )
{
return false;
}
else
{
a_b->a = (a.y - b.y) / (a.x - b.x);
a_b->b = a.y - a_b->a * a.x;
return true;
}
}
|
a.cc: In function 'bool get_line(const point&, const point&, line*)':
a.cc:63:13: error: 'fabs' was not declared in this scope; did you mean 'labs'?
63 | if( fabs(a.x - b.x) < EPS )
| ^~~~
| labs
a.cc: In function 'int recog_point_place(const point&, const point&, const point&)':
a.cc:59:1: warning: control reaches end of non-void function [-Wreturn-type]
59 | }
| ^
a.cc: In function 'bool get_line(const point&, const point&, line*)':
a.cc:74:1: warning: control reaches end of non-void function [-Wreturn-type]
74 | }
| ^
|
s891567548
|
p00012
|
C++
|
def side(p1, p2, p3):
return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0
while True:
try:
x = map(float, raw_input().split())
p1 = x[0:2]
p2 = x[2:4]
p3 = x[4:6]
p0 = x[6:]
if (side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0)):
print "YES"
else:
print "NO"
except:
break
|
a.cc:1:1: error: 'def' does not name a type
1 | def side(p1, p2, p3):
| ^~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.