submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s749941389
|
p00057
|
C++
|
#include<cstdio>
main(n,s){for(;~scanf("%d",&n);printf("%d\n",1+(n+1)*n/2));}
|
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
2 | main(n,s){for(;~scanf("%d",&n);printf("%d\n",1+(n+1)*n/2));}
| ^
|
s499813546
|
p00057
|
C++
|
#include<iostream>
int main(){
int n;
while(cin>>n)
std::cout<<n*(n+1)/2+1<<endl;
}
|
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | while(cin>>n)
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:5:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | std::cout<<n*(n+1)/2+1<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s928081796
|
p00057
|
C++
|
main(n){for(;~scanf("%d",&n);)printf("%d\n",(n+1)*n/2+1);}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(n){for(;~scanf("%d",&n);)printf("%d\n",(n+1)*n/2+1);}
| ^
|
s762583538
|
p00057
|
C++
|
main(N){while(~scanf("%d",&N))printf("%d\n",N*(N+1)/2+1);}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(N){while(~scanf("%d",&N))printf("%d\n",N*(N+1)/2+1);}
| ^
|
s756038345
|
p00057
|
C++
|
#include <iostream>
using namespace std;
int main() {
int n;
while(cin>>n) {
int res=0;
for (int i=0; i<n; i++) res += 2;
}
cout << res << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:17: error: 'res' was not declared in this scope
9 | cout << res << endl;
| ^~~
|
s207227199
|
p00057
|
C++
|
main(n){for(;~scanf("%d",&n);)printf("%d\n",n*-~n/2+1);}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(n){for(;~scanf("%d",&n);)printf("%d\n",n*-~n/2+1);}
| ^
|
s085289543
|
p00057
|
C++
|
main(n){for(;~scanf("%d",&n);)printf("%d\n",1-n*~n/2);}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(n){for(;~scanf("%d",&n);)printf("%d\n",1-n*~n/2);}
| ^
|
s199176698
|
p00057
|
C++
|
#include<iostream>
using namespace std;
int ans(int a){
if(a==1) return 2;
return a+ans(a-1);
}
int main(){
int n;
while(){
cout<<ans(n)<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before ')' token
9 | while(){
| ^
|
s973938443
|
p00057
|
C++
|
i,a;main(n){for(;i=~scanf("%d",&n);printf("%d\n",a))for(i=a=1;i<=n;)a+=i++;}
|
a.cc:1:1: error: 'i' does not name a type
1 | i,a;main(n){for(;i=~scanf("%d",&n);printf("%d\n",a))for(i=a=1;i<=n;)a+=i++;}
| ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
1 | i,a;main(n){for(;i=~scanf("%d",&n);printf("%d\n",a))for(i=a=1;i<=n;)a+=i++;}
| ^
|
s471801189
|
p00057
|
C++
|
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<windows.h>
using namespace std;
int main(){
int n;
while(scanf("%d",&n) != EOF){
int sum = 1;
for(int i = 1; i <= n; i++)
sum += i;
cout << sum << endl;
}
return 0;
}
|
a.cc:5:9: fatal error: windows.h: No such file or directory
5 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s738727051
|
p00057
|
C++
|
import sys
N=10000+1
d=[0]*N
d[0]=1
for i in xrange(1,N):
d[i]=d[i-1]+i
for line in sys.stdin.readlines():
print d[int(line.strip())]
|
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'
|
s165680185
|
p00057
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int x, m ,count;
while(cin>>n)
{
if(n>2)
{
for(int i=0; i<n-2; i++)
{
m+=count;
count++;
}
cout<<n*2+m<<endl;
}
else
{
cout<<n*2<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:13: error: 'n' was not declared in this scope
7 | while(cin>>n)
| ^
|
s623508706
|
p00057
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
if(n>2)
{
int m=1, count=0;
for(int i=0; i<n-2; i++)
{
m+=count;
count++;
}
cout<<n*m+count<<endl;
}
else
{
cout<<n*m<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:13: error: 'm' was not declared in this scope
21 | cout<<n*m<<endl;
| ^
|
s585168786
|
p00057
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
if(n>2)
{
static_int m=1, count=0;
for(int i=0; i<n-2; i++)
{
m+=count;
count++;
}
cout<<n*m+count<<endl;
}
else
{
cout<<n*2<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:4: error: 'static_int' was not declared in this scope; did you mean 'static'?
11 | static_int m=1, count=0;
| ^~~~~~~~~~
| static
a.cc:14:9: error: 'm' was not declared in this scope
14 | m+=count;
| ^
a.cc:14:12: error: 'count' was not declared in this scope
14 | m+=count;
| ^~~~~
a.cc:17:14: error: 'm' was not declared in this scope
17 | cout<<n*m+count<<endl;
| ^
a.cc:17:16: error: 'count' was not declared in this scope
17 | cout<<n*m+count<<endl;
| ^~~~~
|
s925784269
|
p00058
|
Java
|
import java.io.*;
class Main{
public static void main(String[] args) throws IOExcetion{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
String[] values=line.split(" ");
double xa=Double.parseDouble(values[0]);
double ya=Double.parseDouble(values[1]);
double xb=Double.parseDouble(values[2]);
double yb=Double.parseDouble(values[3]);
double xc=Double.parseDouble(values[4]);
double yc=Double.parseDouble(values[5]);
double xd=Double.parseDouble(values[6]);
double yd=Double.parseDouble(values[7]);
if(xa==xb){
if(yc==yd){
System.out.println("YES");
}
else{
System.out.println("NO");
}
continue;
}
if(xc==xd){
if(ya==yb){
System.out.println("YES");
}
else{
System.out.println("NO");
}
continue;
}
double mab=(ya-yb)/(xa-xb);
double mcd=(yc-yd)/(xc-xd);
System.out.println(mab*mcd==-1.0?"YES":"NO");
}
}
}
|
Main.java:4: error: cannot find symbol
public static void main(String[] args) throws IOExcetion{
^
symbol: class IOExcetion
location: class Main
1 error
|
s457492095
|
p00058
|
Java
|
import java.io.*;
????
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
String[] values=line.split(" ");
double xa=Double.parseDouble(values[0]);
double ya=Double.parseDouble(values[1]);
double xb=Double.parseDouble(values[2]);
double yb=Double.parseDouble(values[3]);
double xc=Double.parseDouble(values[4]);
double yc=Double.parseDouble(values[5]);
double xd=Double.parseDouble(values[6]);
double yd=Double.parseDouble(values[7]);
if(xa==xb&&yc==yd){
System.out.println("YES");
}
else if(xc==xd&&ya==yb){
System.out.println("YES");
}
double my=(ya-yb)*(yc-yd);
double mx=(xa-xb)*(xc-xd);
else if(mx==my*-1){
System.out.println("YES");
}
else{
System.out.println("NO");
}
}
}
}
|
Main.java:2: error: class, interface, enum, or record expected
????
^
Main.java:25: error: 'else' without 'if'
else if(mx==my*-1){
^
2 errors
|
s802202582
|
p00058
|
Java
|
import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
String[] values=line.split(" ");
double ax=Double.parseDouble(values[0]);
double ay=Double.parseDouble(values[1]);
double bx=Double.parseDouble(values[2]);
double by=Double.parseDouble(values[3]);
double cx=Double.parseDouble(values[4]);
double cy=Double.parseDouble(values[5]);
double dx=Double.parseDouble(values[6]);
double dy=Double.parseDouble(values[7]);
if(ax==bx&&cy==dy){
System.out.println("YES")
}
else if(ay==by&&cx==dx){
System.out.println("YES")
}
else if((ay-by)*(cx-dx)==(ax-bx)*(cy-dy)){
System.out.println("YES");
}
else{
System.out.println("NO");
}
}
}
}
|
Main.java:18: error: ';' expected
System.out.println("YES")
^
Main.java:21: error: ';' expected
System.out.println("YES")
^
2 errors
|
s698178173
|
p00058
|
Java
|
import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
String[] values=line.split(" ");
double ax=Double.parseDouble(values[0]);
double ay=Double.parseDouble(values[1]);
double bx=Double.parseDouble(values[2]);
double by=Double.parseDouble(values[3]);
double cx=Double.parseDouble(values[4]);
double cy=Double.parseDouble(values[5]);
double dx=Double.parseDouble(values[6]);
double dy=Double.parseDouble(values[7]);
double det1=(ay-by)*(dx--cx);
double det2=(ax-bx)*(cy-dy);
if(ax==bx&&cy==dy){
System.out.println("YES");
}
else if(ay==by&&cx==dx){
System.out.println("YES");
}
else if(det1==det2&&det1!=0.0){
System.out.println("YES");
}
else{
System.out.println("NO");
}
}
}
}
|
Main.java:17: error: ')' expected
double det1=(ay-by)*(dx--cx);
^
Main.java:17: error: ';' expected
double det1=(ay-by)*(dx--cx);
^
2 errors
|
s698780734
|
p00058
|
Java
|
#include<stdio.h>
int main(){
double ax,ay,bx,by,cx,cy,dx,dy;
double abx,aby,cdx,cdy;
for(;scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy)!=EOF;){
abx=bx-ax;aby=by-ay;
cdx=dx-cx;cdy=dy-cy;
if(abx*cdx+aby*cdy==0)printf("YES\n");
else printf("NO\n");
}
return 0;
}
|
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:4: error: class, interface, enum, or record expected
double abx,aby,cdx,cdy;
^
Main.java:5: error: class, interface, enum, or record expected
for(;scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy)!=EOF;){
^
Main.java:5: error: class, interface, enum, or record expected
for(;scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy)!=EOF;){
^
Main.java:5: error: class, interface, enum, or record expected
for(;scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy)!=EOF;){
^
Main.java:6: error: class, interface, enum, or record expected
abx=bx-ax;aby=by-ay;
^
Main.java:7: error: class, interface, enum, or record expected
cdx=dx-cx;cdy=dy-cy;
^
Main.java:7: error: class, interface, enum, or record expected
cdx=dx-cx;cdy=dy-cy;
^
Main.java:8: error: class, interface, enum, or record expected
if(abx*cdx+aby*cdy==0)printf("YES\n");
^
Main.java:9: error: class, interface, enum, or record expected
else printf("NO\n");
^
Main.java:10: error: class, interface, enum, or record expected
}
^
Main.java:12: error: class, interface, enum, or record expected
}
^
13 errors
|
s841387556
|
p00058
|
Java
|
import java.util.Scanner;
//Orthogonal
public class AOJ0058 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
double[][] p = new double[4][2];
for(int i=0;i<4;i++){
p[i][0] = sc.nextDouble();
p[i][1] = sc.nextDouble();
}
double vx1 = p[1][0]-p[0][0];
double vy1 = p[1][1]-p[0][1];
double vx2 = p[3][0]-p[2][0];
double vy2 = p[3][1]-p[2][1];
System.out.println((vx1*vx2+vy1*vy2)==0?"YES":"NO");
}
}
}
|
Main.java:4: error: class AOJ0058 is public, should be declared in a file named AOJ0058.java
public class AOJ0058 {
^
1 error
|
s846295267
|
p00058
|
Java
|
#include <iostream>
#include <cmath>
#include<cstdio>
#include <algorithm>
using namespace std;
int main(){
double xA,yA,xB,yB,xC,yC,xD,yD;
while(~scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
if((xB-xA)*(xD-xC)+(yB-yA)*(yD-yC) == 0){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
}
}
|
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <cmath>
^
Main.java:3: error: illegal character: '#'
#include<cstdio>
^
Main.java:4: error: illegal character: '#'
#include <algorithm>
^
Main.java:14: error: not a statement
cout << "YES" << endl;
^
Main.java:16: error: not a statement
cout << "NO" << endl;
^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
(use --enable-preview to enable unnamed classes)
Main.java:12: error: illegal start of expression
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
^
Main.java:12: error: illegal start of expression
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
^
Main.java:12: error: illegal start of expression
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
^
Main.java:12: error: illegal start of expression
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
^
Main.java:12: error: illegal start of expression
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
^
Main.java:12: error: illegal start of expression
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
^
Main.java:12: error: illegal start of expression
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
^
Main.java:12: error: illegal start of expression
&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD)){
^
15 errors
|
s151992503
|
p00058
|
Java
|
import java.util.Scanner;
public class Main{
public static final double EPS = 1e-8;
public static class P implements Comparable<P>{
public double x;
public double y;
public P(double x, double y) {
this.x = x;
this.y = y;
}
//ÀWª¶ºÉ éÙÇ\[gñɨ¢ÄOÉé
public int compareTo(P o) {
if(equals(o))return 0;
if(Math.abs(x-o.x)<EPS){
return y-o.y<0?1:y-o.y>0?-1:0;
}
return x-o.x<0?1:x-o.x>0?-1:0;
}
public boolean equals(P o){
return Math.abs(x-o.x)<EPS && Math.abs(y-o.y)<EPS;
}
}
/**
* s->txNg
* @author y-koashi
*
*/
public static class Vec{
public P s;
public P t;
public double dx;
public double dy;
public Vec(P s, P t) {
this.s = s;
this.t = t;
dx = t.x-s.x;
dy = t.y-s.y;
}
/**
* àÏ
*/
public double dotProduct(Vec o){
return dx*o.dx + dy*o.dy;
}
/**
* OÏ
*/
public double crossProduct(Vec o){
return dx*o.dy - dy*o.dx;
}
/**
* xNgoƼðµÄ¢é©
* ð_ðÁÄ¢éKvÍÈ¢
* @param o
* @return
*/
public boolean isOrthogonal(Vec o){
return dotProduct(o)==0;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
P p1 = new P(sc.nextDouble(), sc.nextDouble());
P p2 = new P(sc.nextDouble(), sc.nextDouble());
P p3 = new P(sc.nextDouble(), sc.nextDouble());
P p4 = new P(sc.nextDouble(), sc.nextDouble());
//Vec v1 = new Vec(p1, p2);
//Vec v2 = new Vec(p3, p4);
if(v1==null||v2==null)System.out.println("WRONG");else
System.out.println(v1.isOrthogonal(v2)?"YES":"NO");
}
}
}
}
|
Main.java:74: error: cannot find symbol
if(v1==null||v2==null)System.out.println("WRONG");else
^
symbol: variable v1
location: class Vec
Main.java:74: error: cannot find symbol
if(v1==null||v2==null)System.out.println("WRONG");else
^
symbol: variable v2
location: class Vec
Main.java:75: error: cannot find symbol
System.out.println(v1.isOrthogonal(v2)?"YES":"NO");
^
symbol: variable v2
location: class Vec
Main.java:75: error: cannot find symbol
System.out.println(v1.isOrthogonal(v2)?"YES":"NO");
^
symbol: variable v1
location: class Vec
4 errors
|
s343196996
|
p00058
|
Java
|
import java.util.Scanner;
public class Orthogonal {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double x[]=new double[4];
double y[]=new double[4];
double xab,yab,xcd,ycd,ns;
int i;
while(sc.hasNext()){
for(i=0;i<4;i++){
x[i]=sc.nextDouble();
y[i]=sc.nextDouble();
}
xab=x[1]-x[0];
yab=y[1]-y[0];
xcd=x[3]-x[2];
ycd=y[3]-y[2];
ns=(xab*xcd)+(yab*ycd);
if(ns==0){
System.out.println("YES");
}
else{
System.out.println("NO");
}
}//while
}
}
|
Main.java:3: error: class Orthogonal is public, should be declared in a file named Orthogonal.java
public class Orthogonal {
^
1 error
|
s301676425
|
p00058
|
Java
|
public class Main {
static Scanner in = new Scanner(System.in);
public static void main(String[] args) {
double x1, y1, x2, y2;
while (in.hasNext()) {
x1 = -in.nextDouble();
y1 = -in.nextDouble();
x1 += in.nextDouble();
y1 += in.nextDouble();
x2 = -in.nextDouble();
y2 = -in.nextDouble();
x2 += in.nextDouble();
y2 += in.nextDouble();
System.out.println((x1 * x2 + y1 * y2 == 0) ? "YES" : "NO");
}
}
}
|
Main.java:2: error: cannot find symbol
static Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:2: error: cannot find symbol
static Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s366676471
|
p00058
|
Java
|
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
double ep = 0.0;
while(s.hasNext()) {
double[] d = new double[8];
for(int i=0 ; i<8 ; i++)
d[i] = s.nextDouble();
double a = (d[3]-d[1])*(d[7]-d[5]) + (d[2]-d[0])*(d[6]-d[4]);
String ans;
if(a == 0)
ans = "YES";
else
ans = "NO";
}
System.out.println(ans);
}
}
}
|
Main.java:21: error: class, interface, enum, or record expected
}
^
1 error
|
s659959150
|
p00058
|
C
|
#include<stdio.h>
int main(void){
double a,b,c,d,e,f,g,h;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f,&g,&h) != EOF){
if(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f,&g,&h) = EOF){
break;
}
if(c-a==0&&h-f==0){
printf("YES\n");
}
else if(d-b==0&&g-e==0){
printf("YES\n");
}
else if(c-a==0&&g-e==0){
printf("NO\n");
}
else if(d-b==0&&h-f==0){
printf("NO\n");
}
else if((d-b)/(c-a) == -(h-f)/(g-e)){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:7:69: error: lvalue required as left operand of assignment
7 | if(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f,&g,&h) = EOF){
| ^
|
s034552595
|
p00058
|
C
|
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include <vector>
#include <map>
#include<cstdlib>
using namespace std;
void Solution()
{
double xA, yA;
double xB, yB;
double xC, yC;
double xD, yD;
while(cin>>xA>>yA>xB>>yB>>xC>>yC>>xD>>yD)
{
//algorithm
double a,b,c,d;
a = (yA-yB);
b = (xA-xB);
c = (yC-yD);
d = (xC-xD);
(a*c + b*d == 0) ? puts("YES") : puts("NO");
}
}
int main()
{
Solution();
return 0;
}
|
main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s106791526
|
p00058
|
C
|
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include <vector>
#include <map>
#include<cstdlib>
using namespace std;
void Solution()
{
double xA, yA;
double xB, yB;
double xC, yC;
double xD, yD;
while(cin>>xA>>yA>>xB>>yB>>xC>>yC>>xD>>yD)
{
//algorithm
double a, b, c, d;
a = (yA-yB);
b = (xA-xB);
c = (yC-yD);
d = (xC-xD);
if(a*c + b*d == 0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
int main()
{
Solution();
return 0;
}
|
main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s040032971
|
p00058
|
C
|
#include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>
#include<memory>
using namespace std;
class Vector{
public:
double x;
double y;
Vector(){}
Vector( double x, double y ) : x(x), y(y) {}
Vector operator + ( const Vector v ) { return Vector( x + v.x, y + v.y ); }
Vector operator - ( const Vector v ) { return Vector( x - v.x, y - v.y ); }
Vector operator * ( const double k ) { return Vector( x * k, y * k ); }
Vector operator / ( const double k ) { return Vector( x / k, y / k ); }
bool operator < ( const Vector &v ) const { return x * x + y * y < v.x * v.x + v.y * v.y; }
double abs() { return sqrt( norm() ); }
double norm() { return x * x + y * y; }
static double dot( Vector v1, Vector v2 ) { return v1.x * v2.x + v1.y * v2.y; }
static double cross( Vector v1, Vector v2 ) { return v1.x * v2.y - v1.y * v2.x; }
};
int main(){
const double eps = 1e-10;
Vector a, b, c, d;
while ( cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y ){
if ( fabs( Vector::dot( b - a, d - c ) ) < eps )
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s402254799
|
p00058
|
C
|
#include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>
#include<memory>
using namespace std;
class Vector
{
public:
double x;
double y;
Vector(){}
Vector( double x, double y ) : x(x), y(y) {}
Vector operator + ( const Vector v ) { return Vector( x + v.x, y + v.y ); }
Vector operator - ( const Vector v ) { return Vector( x - v.x, y - v.y ); }
Vector operator * ( const double k ) { return Vector( x * k, y * k ); }
Vector operator / ( const double k ) { return Vector( x / k, y / k ); }
bool operator < ( const Vector &v ) const { return x * x + y * y < v.x * v.x + v.y * v.y; }
double abs() { return sqrt( norm() ); }
double norm() { return x * x + y * y; }
static double dot( Vector v1, Vector v2 ) { return v1.x * v2.x + v1.y * v2.y; }
static double cross( Vector v1, Vector v2 ) { return v1.x * v2.y - v1.y * v2.x; }
};
int main()
{
const double eps = 1e-10;
Vector a, b, c, d;
while ( cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y )
{
if ( fabs( Vector::dot( b - a, d - c ) ) < eps )
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s349525201
|
p00058
|
C
|
#include<stdio.h>
int main(){
double x0,x1,x2,x3,y0,y1,y2,y3;
while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=-1){
while((x1-x0)*(x3-x2)+(y1-y0)*(y3-y2)==0)
puts("YES");{
}else{
puts("NO");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:7:6: error: 'else' without a previous 'if'
7 | }else{
| ^~~~
|
s882125498
|
p00058
|
C
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<stdio.h>
int main(){
int i/*,flag*/;
float x[4],y[4],a;
while(1){
for(i = 0/*,flag = 0*/;i < 4;i++){
if(scanf("%f%f",&x[i],&y[i]) == EOF){
/*
flag = 1;
break;
*/
return 0;
}
}
/*
if(flag){
flag = 0;
break;
}
*/
/*
if(x[0] == x[1] && y[2] == y[3]){
puts("YES");
}else if(x[2] == x[3] && y[0] == y[1]){
puts("YES");
}else if(x[0] == x[1] || x[2] == x[3]){
puts("NO");
}else{
*/
a = (y[1] - y[0]) * (y[3] - y[2]) + (x[1] - x[0]) * (x[3] - x[2]);
if(a==0){
puts("YES");
}else{
puts("NO");
}
//}
}
return 0;
}
|
main.c:2:1: error: expected identifier or '(' before numeric constant
2 | 1
| ^
In file included from /usr/include/stdio.h:47,
from main.c:45:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
28 | size_t __nbytes);
| ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
+++ |+#include <stddef.h>
1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc.
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t'
37 | size_t __nbytes);
| ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'?
57 | cookie_read_function_t *read; /* Read bytes. */
| ^~~~~~~~~~~~~~~~~~~~~~
| cookie_seek_function_t
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'?
58 | cookie_write_function_t *write; /* Write bytes. */
| ^~~~~~~~~~~~~~~~~~~~~~~
| cookie_close_function_t
/usr/include/stdio.h:314:35: error: unknown type name 'size_t'
314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
| ^~~~~~
/usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
129 | #include <bits/stdio_lim.h>
+++ |+#include <stddef.h>
130 |
/usr/include/stdio.h:320:47: error: unknown type name 'size_t'
320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW
| ^~~~~~
/usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:340:34: error: unknown type name 'size_t'
340 | int __modes, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:346:24: error: unknown type name 'size_t'
346 | size_t __size) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:385:44: error: unknown type name 'size_t'
385 | extern int snprintf (char *__restrict __s, size_t __maxlen,
| ^~~~~~
/usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:389:45: error: unknown type name 'size_t'
389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen,
| ^~~~~~
/usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:690:30: error: unknown type name 'size_t'
690 | size_t *__restrict __n, int __delimiter,
| ^~~~~~
/usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:693:28: error: unknown type name 'size_t'
693 | size_t *__restrict __n, int __delimiter,
| ^~~~~~
/usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:698:27: error: unknown type name 'size_t'
698 | size_t *__restrict __n,
| ^~~~~~
/usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:8: error: unknown type name 'size_t'
728 | extern size_t fread (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:46: error: unknown type name 'size_t'
728 | extern size_t fread (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:729:22: error: unknown type name 'size_t'
729 | size_t __n, FILE *__restrict __stream) __wur
| ^~~~~~
/usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:8: error: unknown type name 'size_t'
735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:53: error: unknown type name 'size_t'
735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:736:23: error: unknown type name 'size_t'
736 | size_t __n, FILE *__restrict __s) __nonnull((4));
| ^~~~~~
/usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:8: error: unknown type name 'size_t'
756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:55: error: unknown type name 'size_t'
756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:756:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:757:31: error: unknown type name 'size_t'
757 | size_t __n, FILE *__restrict __stream) __wur
| ^~~~~~
/usr/include/stdio.h:757:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:759:8: error: unknown type name 'size_t'
759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:759:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:759:62: error: unknown type name 'size_t'
759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:759:62: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:760:32: error: unknown type name 'size_t'
760 | size_t __n, FILE *__restrict __stream)
| ^~~~~~
/usr/include/stdio.h:760:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
|
s262239994
|
p00058
|
C
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<stdio.h>
int main(){
int i/*,flag*/;
float x[4],y[4],a;
while(1){
for(i = 0/*,flag = 0*/;i < 4;i++){
if(scanf("%f%f",&x[i],&y[i]) == EOF){
/*
flag = 1;
break;
*/
return 0;
}
}
/*
if(flag){
flag = 0;
break;
}
*/
/*
if(x[0] == x[1] && y[2] == y[3]){
puts("YES");
}else if(x[2] == x[3] && y[0] == y[1]){
puts("YES");
}else if(x[0] == x[1] || x[2] == x[3]){
puts("NO");
}else{
*/
a = (y[1] - y[0]) * (y[3] - y[2]) + (x[1] - x[0]) * (x[3] - x[2]);
if(a==0){
puts("YES");
}else{
puts("NO");
}
//}
}
return 0;
}
|
main.c:2:1: error: expected identifier or '(' before numeric constant
2 | 1
| ^
In file included from /usr/include/stdio.h:47,
from main.c:45:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
28 | size_t __nbytes);
| ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
+++ |+#include <stddef.h>
1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc.
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t'
37 | size_t __nbytes);
| ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'?
57 | cookie_read_function_t *read; /* Read bytes. */
| ^~~~~~~~~~~~~~~~~~~~~~
| cookie_seek_function_t
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'?
58 | cookie_write_function_t *write; /* Write bytes. */
| ^~~~~~~~~~~~~~~~~~~~~~~
| cookie_close_function_t
/usr/include/stdio.h:314:35: error: unknown type name 'size_t'
314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
| ^~~~~~
/usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
129 | #include <bits/stdio_lim.h>
+++ |+#include <stddef.h>
130 |
/usr/include/stdio.h:320:47: error: unknown type name 'size_t'
320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW
| ^~~~~~
/usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:340:34: error: unknown type name 'size_t'
340 | int __modes, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:346:24: error: unknown type name 'size_t'
346 | size_t __size) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:385:44: error: unknown type name 'size_t'
385 | extern int snprintf (char *__restrict __s, size_t __maxlen,
| ^~~~~~
/usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:389:45: error: unknown type name 'size_t'
389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen,
| ^~~~~~
/usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:690:30: error: unknown type name 'size_t'
690 | size_t *__restrict __n, int __delimiter,
| ^~~~~~
/usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:693:28: error: unknown type name 'size_t'
693 | size_t *__restrict __n, int __delimiter,
| ^~~~~~
/usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:698:27: error: unknown type name 'size_t'
698 | size_t *__restrict __n,
| ^~~~~~
/usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:8: error: unknown type name 'size_t'
728 | extern size_t fread (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:46: error: unknown type name 'size_t'
728 | extern size_t fread (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:729:22: error: unknown type name 'size_t'
729 | size_t __n, FILE *__restrict __stream) __wur
| ^~~~~~
/usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:8: error: unknown type name 'size_t'
735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:53: error: unknown type name 'size_t'
735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:736:23: error: unknown type name 'size_t'
736 | size_t __n, FILE *__restrict __s) __nonnull((4));
| ^~~~~~
/usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:8: error: unknown type name 'size_t'
756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:55: error: unknown type name 'size_t'
756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:756:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:757:31: error: unknown type name 'size_t'
757 | size_t __n, FILE *__restrict __stream) __wur
| ^~~~~~
/usr/include/stdio.h:757:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:759:8: error: unknown type name 'size_t'
759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:759:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:759:62: error: unknown type name 'size_t'
759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:759:62: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:760:32: error: unknown type name 'size_t'
760 | size_t __n, FILE *__restrict __stream)
| ^~~~~~
/usr/include/stdio.h:760:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
|
s699583594
|
p00058
|
C
|
#include <stdio.h>
typedef struct Point {
double x, 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 *(double t) { return Point(x*t, y*t);}
} Point;
typedef Point Vector;
int naiseki(Vector a, Vector b);
int isTyokko(Point a1, Point a2, Point b1, Point b2) {
if(naiseki(Vector(a1.x-a2.x, a1.y-a2.y), Vector(b1.x-b2.x, b1.y-b2.y)) == 0) {
return 1;
} else {
return 0;
}
}
int naiseki(Vector a, Vector b) {
return a.x*b.x + a.y*b.y;
}
int main() {
Point a, b, c, d;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y, &d.x, &d.y) != EOF) {
if(isTyokko(a, b, c, d)) printf("YES\n");
else printf("NO\n");
}
}
|
main.c:5:3: error: expected specifier-qualifier-list before 'Point'
5 | Point(double x = 0, double y = 0):x(x), y(y){}
| ^~~~~
main.c: In function 'isTyokko':
main.c:16:14: error: expected expression before 'Vector'
16 | if(naiseki(Vector(a1.x-a2.x, a1.y-a2.y), Vector(b1.x-b2.x, b1.y-b2.y)) == 0) {
| ^~~~~~
main.c:16:6: error: too few arguments to function 'naiseki'
16 | if(naiseki(Vector(a1.x-a2.x, a1.y-a2.y), Vector(b1.x-b2.x, b1.y-b2.y)) == 0) {
| ^~~~~~~
main.c:13:5: note: declared here
13 | int naiseki(Vector a, Vector b);
| ^~~~~~~
|
s996636383
|
p00058
|
C
|
double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
|
main.c:1:15: error: return type defaults to 'int' [-Wimplicit-int]
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
| ^~~~
main.c: In function 'main':
main.c:1:28: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
main.c:1:28: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
| ^~~~~
main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:45: error: invalid operands to binary % (have 'double' and 'int')
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
| ~~~^
| |
| double
main.c:1:51: error: invalid operands to binary % (have 'double' and 'int')
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
| ^
main.c:1:55: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
| ^~~~
main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:60: error: implicit declaration of function 'fabs' [-Wimplicit-function-declaration]
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
| ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'fabs'
+++ |+#include <math.h>
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
main.c:1:60: warning: incompatible implicit declaration of built-in function 'fabs' [-Wbuiltin-declaration-mismatch]
1 | double p[9],i;main(){for(;~scanf("%lf",p+i++%8);)i%8||puts(fabs((p[2]-*p)*(p[6]-p[4])+(p[3]-p[1])*(p[7]-p[5]))<1e-7?"YES":"NO");}
| ^~~~
main.c:1:60: note: include '<math.h>' or provide a declaration of 'fabs'
|
s580384415
|
p00058
|
C
|
#include<iostream>
#include<cmath>
#include<complex>
#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)
using namespace std;
typedef complex<double> P;
double dot(P,P);
int is_orthogonal(P,P,P,P);
int main(void){
P a,b,c,d;
while(~scanf("%lf %lf %lf %lf %lf %lf %lf %lf"
,&a.real(),&a.imag(),&b.real(),&b.imag()
,&c.real(),&c.imag(),&d.real(),&d.imag())){
if(is_orthogonal(a,b,c,d))cout << "YES" << endl;
else cout << "NO" << endl;
}
return 0;
}
double dot(P a,P b) {
return (a.real() * b.real() + a.imag() * b.imag());
}
int is_orthogonal(P a1,P a2,P b1,P b2) {
return EQ( dot(a1-a2, b1-b2), 0.0 );
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s995959437
|
p00058
|
C++
|
#include <cstdio>
using namespace std;
int main(){
double x1,x2,x3,x4,y1,y2,y3,y4,slope1,slope2;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF){
if(x1 == x2){
if(y3 == y4)printf("YES\n");
else{
printf("NO\n");
}
}else{ //x1 != x2
if(x3 == x4){
if(y1 == y2)printf("YES\n");
else{
printf("NO\n");
}
}else{
slope1 = (double)((y2-y1)/(x2-x1));
slope2 = (double)((y4-y3)/(x4-x3));
if(fabs(slope1*slope2 + 1) < EPS){
printf("YES\n");
}else{
printf("NO\n");
}
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:23:36: error: 'fabs' was not declared in this scope
23 | if(fabs(slope1*slope2 + 1) < EPS){
| ^~~~
a.cc:23:62: error: 'EPS' was not declared in this scope
23 | if(fabs(slope1*slope2 + 1) < EPS){
| ^~~
|
s898224844
|
p00058
|
C++
|
#include
<cstdio>
double
xA,yA,xB,yB,xC,yC,xD,yD;
int
main()
{
while
(~scanf(
"%lf%lf%lf%lf%lf%lf%lf%lf"
,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
{
if
((xB-xA)*(xD-xC)+(yB-yA)*(yD-yC)==0)printf(
"YES\n"
);
else
printf(
"NO\n"
);
}
}
|
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
1 | #include
| ^
a.cc:3:1: error: expected unqualified-id before '<' token
3 | <cstdio>
| ^
a.cc: In function 'int main()':
a.cc:19:3: error: 'xA' was not declared in this scope
19 | ,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
| ^~
a.cc:19:7: error: 'yA' was not declared in this scope
19 | ,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
| ^~
a.cc:19:11: error: 'xB' was not declared in this scope
19 | ,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
| ^~
a.cc:19:15: error: 'yB' was not declared in this scope
19 | ,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
| ^~
a.cc:19:19: error: 'xC' was not declared in this scope
19 | ,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
| ^~
a.cc:19:23: error: 'yC' was not declared in this scope
19 | ,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
| ^~
a.cc:19:27: error: 'xD' was not declared in this scope
19 | ,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
| ^~
a.cc:19:31: error: 'yD' was not declared in this scope
19 | ,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
| ^~
a.cc:16:3: error: 'scanf' was not declared in this scope
16 | (~scanf(
| ^~~~~
a.cc:28:37: error: 'printf' was not declared in this scope
28 | ((xB-xA)*(xD-xC)+(yB-yA)*(yD-yC)==0)printf(
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | #include
a.cc:36:1: error: 'printf' was not declared in this scope
36 | printf(
| ^~~~~~
a.cc:36:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s925864762
|
p00058
|
C++
|
#include
<cstdio>
using namespace std;
double
xA,yA,xB,yB,xC,yC,xD,yD;
int
main()
{
while
(~scanf(
"%lf%lf%lf%lf%lf%lf%lf%lf"
,&xA,&yA,&xB,&yB,&xC,&yC,&xD,&yD))
{
if
((xB-xA)*(xD-xC)+(yB-yA)*(yD-yC)==0)printf(
"YES\n"
);
else
printf(
"NO\n"
);
}
}
|
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
1 | #include
| ^
a.cc:3:1: error: expected unqualified-id before '<' token
3 | <cstdio>
| ^
a.cc: In function 'int main()':
a.cc:18:3: error: 'scanf' was not declared in this scope
18 | (~scanf(
| ^~~~~
a.cc:30:37: error: 'printf' was not declared in this scope
30 | ((xB-xA)*(xD-xC)+(yB-yA)*(yD-yC)==0)printf(
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | #include
a.cc:38:1: error: 'printf' was not declared in this scope
38 | printf(
| ^~~~~~
a.cc:38:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s584367015
|
p00058
|
C++
|
#include <iostream>
2.#include <cstdio>
3.using namespace std;
4.
5.struct point
6.{
7. double x, y;
8.};
9.
10.int main() {
11. point p[4];
12. while (true){
13. for (int i = 0; i < 4; i++){
14. if (scanf("%lf%lf", &p[i].x, &p[i].y) == EOF) return 0;
15. }
16. //cout << (p[1].x - p[0].x) * (p[3].x - p[2].x) + (p[1].y - p[0].y) * (p[3].y - p[2].y) << endl;
17. if ((p[1].x - p[0].x) * (p[3].x - p[2].x) +
18. (p[1].y - p[0].y) * (p[3].y - p[2].y) == 0.00){
19. cout << "YES" << endl;
20. }
21. else {
22. cout << "NO" << endl;
23. }
24. }
25.}
|
a.cc:3:3: error: stray '#' in program
3 | 2.#include <cstdio>
| ^
a.cc:3:1: error: expected unqualified-id before numeric constant
3 | 2.#include <cstdio>
| ^~
a.cc:7:1: error: expected unqualified-id before numeric constant
7 | 4.
| ^~
a.cc:17:1: error: expected unqualified-id before numeric constant
17 | 9.
| ^~
|
s076999103
|
p00058
|
C++
|
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
using namespace std;
typedef struct Point{
double x,y;
};
int main(){
Point p[4];
double x[2],y[2];
while(cin>>p[0].x){
cin>>p[0].y;
for(int i=1;i<4;i++){
cin>>p[i].x;
cin>>p[i].y;
}
x[0] = p[0].x - p[1].x;
x[1] = p[2].x - p[3].x;
y[0] = p[0].y - p[1].y;
y[1] = p[2].y - p[3].y;
if(x[0] * x[1] + y[0] * y[1] == 0){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
return 0;
}
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 9
| ^
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:39:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
179 | _GLIBCXX_NODI
|
s508681750
|
p00058
|
C++
|
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include <vector>
#include <map>
#include<cstdlib>
using namespace std;
void Solution()
{
double xA, yA;
double xB, yB;
double xC, yC;
double xD, yD;
while(cin>>xA>>yA>xB>>yB>>xC>>yC>>xD>>yD)
{
//algorithm
double a,b,c,d;
a = (yA-yB);
b = (xA-xB);
c = (yC-yD);
d = (xC-xD);
(a*c + b*d == 0) ? puts("YES") : puts("NO");
}
}
int main()
{
Solution();
return 0;
}
|
a.cc: In function 'void Solution()':
a.cc:20:25: error: invalid operands of types 'double' and 'double' to binary 'operator>>'
20 | while(cin>>xA>>yA>xB>>yB>>xC>>yC>>xD>>yD)
| ~~^~~~
| | |
| | double
| double
|
s299038745
|
p00058
|
C++
|
#include<iostream>
#include<cmath>
using namespace std;
 
int main(){
    double xa,ya,xb,yb,xc,yc,xd,yd;
    while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
        double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
        if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}
|
a.cc:4:2: error: stray '#' in program
4 |  
| ^
a.cc:6:2: error: stray '#' in program
6 |     double xa,ya,xb,yb,xc,yc,xd,yd;
| ^
a.cc:6:8: error: stray '#' in program
6 |     double xa,ya,xb,yb,xc,yc,xd,yd;
| ^
a.cc:6:14: error: stray '#' in program
6 |     double xa,ya,xb,yb,xc,yc,xd,yd;
| ^
a.cc:6:20: error: stray '#' in program
6 |     double xa,ya,xb,yb,xc,yc,xd,yd;
| ^
a.cc:7:2: error: stray '#' in program
7 |     while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
| ^
a.cc:7:8: error: stray '#' in program
7 |     while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
| ^
a.cc:7:14: error: stray '#' in program
7 |     while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
| ^
a.cc:7:20: error: stray '#' in program
7 |     while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
| ^
a.cc:8:2: error: stray '#' in program
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^
a.cc:8:8: error: stray '#' in program
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^
a.cc:8:14: error: stray '#' in program
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^
a.cc:8:20: error: stray '#' in program
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^
a.cc:8:26: error: stray '#' in program
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^
a.cc:8:32: error: stray '#' in program
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^
a.cc:8:38: error: stray '#' in program
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^
a.cc:8:44: error: stray '#' in program
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^
a.cc:9:2: error: stray '#' in program
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^
a.cc:9:8: error: stray '#' in program
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^
a.cc:9:14: error: stray '#' in program
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^
a.cc:9:20: error: stray '#' in program
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^
a.cc:9:26: error: stray '#' in program
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^
a.cc:9:32: error: stray '#' in program
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^
a.cc:9:38: error: stray '#' in program
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^
a.cc:9:44: error: stray '#' in program
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^
a.cc:10:2: error: stray '#' in program
10 |         else cout<<"NO"<<endl;
| ^
a.cc:10:8: error: stray '#' in program
10 |         else cout<<"NO"<<endl;
| ^
a.cc:10:14: error: stray '#' in program
10 |         else cout<<"NO"<<endl;
| ^
a.cc:10:20: error: stray '#' in program
10 |         else cout<<"NO"<<endl;
| ^
a.cc:10:26: error: stray '#' in program
10 |         else cout<<"NO"<<endl;
| ^
a.cc:10:32: error: stray '#' in program
10 |         else cout<<"NO"<<endl;
| ^
a.cc:10:38: error: stray '#' in program
10 |         else cout<<"NO"<<endl;
| ^
a.cc:10:44: error: stray '#' in program
10 |         else cout<<"NO"<<endl;
| ^
a.cc:11:2: error: stray '#' in program
11 |     }
| ^
a.cc:11:8: error: stray '#' in program
11 |     }
| ^
a.cc:11:14: error: stray '#' in program
11 |     }
| ^
a.cc:11:20: error: stray '#' in program
11 |     }
| ^
a.cc:12:2: error: stray '#' in program
12 |     return 0;
| ^
a.cc:12:8: error: stray '#' in program
12 |     return 0;
| ^
a.cc:12:14: error: stray '#' in program
12 |     return 0;
| ^
a.cc:12:20: error: stray '#' in program
12 |     return 0;
| ^
a.cc:4:3: error: expected unqualified-id before numeric constant
4 |  
| ^~~
a.cc: In function 'int main()':
a.cc:6:3: error: lvalue required as unary '&' operand
6 |     double xa,ya,xb,yb,xc,yc,xd,yd;
| ^~~
a.cc:6:9: error: lvalue required as unary '&' operand
6 |     double xa,ya,xb,yb,xc,yc,xd,yd;
| ^~~
a.cc:6:15: error: lvalue required as unary '&' operand
6 |     double xa,ya,xb,yb,xc,yc,xd,yd;
| ^~~
a.cc:6:21: error: lvalue required as unary '&' operand
6 |     double xa,ya,xb,yb,xc,yc,xd,yd;
| ^~~
a.cc:7:3: error: lvalue required as unary '&' operand
7 |     while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
| ^~~
a.cc:7:9: error: lvalue required as unary '&' operand
7 |     while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
| ^~~
a.cc:7:15: error: lvalue required as unary '&' operand
7 |     while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
| ^~~
a.cc:7:21: error: lvalue required as unary '&' operand
7 |     while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
| ^~~
a.cc:8:3: error: lvalue required as unary '&' operand
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^~~
a.cc:8:9: error: lvalue required as unary '&' operand
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^~~
a.cc:8:15: error: lvalue required as unary '&' operand
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^~~
a.cc:8:21: error: lvalue required as unary '&' operand
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^~~
a.cc:8:27: error: lvalue required as unary '&' operand
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^~~
a.cc:8:33: error: lvalue required as unary '&' operand
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^~~
a.cc:8:39: error: lvalue required as unary '&' operand
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^~~
a.cc:8:45: error: lvalue required as unary '&' operand
8 |         double dot = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
| ^~~
a.cc:9:3: error: lvalue required as unary '&' operand
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^~~
a.cc:9:9: error: lvalue required as unary '&' operand
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^~~
a.cc:9:15: error: lvalue required as unary '&' operand
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^~~
a.cc:9:21: error: lvalue required as unary '&' operand
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^~~
a.cc:9:27: error: lvalue required as unary '&' operand
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^~~
a.cc:9:33: error: lvalue required as unary '&' operand
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^~~
a.cc:9:39: error: lvalue required as unary '&' operand
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^~~
a.cc:9:45: error: lvalue required as unary '&' operand
9 |         if(fabs(dot) < 1e-10)cout<<"YES"<<endl;
| ^~~
a.cc:10:3: error: lvalue required as unary '&' operand
10 |     &#
|
s250262916
|
p00058
|
C++
|
main(){float 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((c-a)*(g-e)+(d-b)*(h-f)?"NO":"YES");}exit(0);}
|
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){float 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((c-a)*(g-e)+(d-b)*(h-f)?"NO":"YES");}exit(0);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:37: error: 'scanf' was not declared in this scope
1 | main(){float 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((c-a)*(g-e)+(d-b)*(h-f)?"NO":"YES");}exit(0);}
| ^~~~~
a.cc:1:88: error: 'puts' was not declared in this scope
1 | main(){float 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((c-a)*(g-e)+(d-b)*(h-f)?"NO":"YES");}exit(0);}
| ^~~~
a.cc:1:130: error: 'exit' was not declared in this scope
1 | main(){float 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((c-a)*(g-e)+(d-b)*(h-f)?"NO":"YES");}exit(0);}
| ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
+++ |+#include <cstdlib>
1 | main(){float 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((c-a)*(g-e)+(d-b)*(h-f)?"NO":"YES");}exit(0);}
|
s174291554
|
p00058
|
C++
|
#include <iostream>
using namespace std;
int main(){
double xa,ya,xb,yb,xc,yc,xd,yd;
while(cin>>xa>>ya>>xb>>yb>>xc>>yc>>xd>>yd){
if((yb-ya)*(yd-yc)+(xb-xa)*(xd-xc)==0) cout<<"YES"<<endl;;
else cout<<"NO"<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:5: error: 'else' without a previous 'if'
9 | else cout<<"NO"<<endl;
| ^~~~
|
s122656694
|
p00058
|
C++
|
#include <iostream>
using namespace std;
int main()
{
double x[4];
double y[4];
while (true)
{
for (int i = 0; i < 4; i++)
{
if (!(cin >> x[i] >> y[i])) break;
}
double dx1 = x[1] - x[0];
double dy1 = y[1] - y[0];
double dx2 = x[3] - x[2];
double dy2 = y[3] - y[2];
double innerProduct = (dx1 * dx2) + (dy1 * dy2);
if (fabs(innerProduct) < 0.0000001) cout << "YES" << endl;
else cout << "NO" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
21 | if (fabs(innerProduct) < 0.0000001) cout << "YES" << endl;
| ^~~~
| labs
|
s527519433
|
p00058
|
C++
|
#include<iostream>
using namespace std;
double ESP = 1e-10
struct point {
double x, y;
};
int main() {
point P[4];
while(true){
for(int i = 0; i < 4; i++){
cin >> P[i].x >> P[i].y;
}
if(cin.eof()) break;
if((P[1].y - P[0].y)*(P[3].y - P[2].y) + (P[3].x - P[2].x)*(P[1].x - P[0].x) < ESP) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc:7:1: error: expected ',' or ';' before 'struct'
7 | struct point {
| ^~~~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'point' was not declared in this scope
12 | point P[4];
| ^~~~~
a.cc:16:14: error: 'P' was not declared in this scope
16 | cin >> P[i].x >> P[i].y;
| ^
a.cc:20:9: error: 'P' was not declared in this scope
20 | if((P[1].y - P[0].y)*(P[3].y - P[2].y) + (P[3].x - P[2].x)*(P[1].x - P[0].x) < ESP) {
| ^
|
s915202975
|
p00058
|
C++
|
#include<iostream>
#include<algorithm>
#include<math>
using namespace std;
double ESP = 1e-10;
struct point {
double x, y;
};
int main() {
point P[4];
while(true){
for(int i = 0; i < 4; i++){
cin >> P[i].x >> P[i].y;
}
if(cin.eof()) break;
if(abs((P[1].y - P[0].y)*(P[3].y - P[2].y) + (P[3].x - P[2].x)*(P[1].x - P[0].x)) < ESP) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc:3:9: fatal error: math: No such file or directory
3 | #include<math>
| ^~~~~~
compilation terminated.
|
s714734301
|
p00058
|
C++
|
1.0 1.0 2.0 2.0 0.0 0.0 1.0 -1.0
0.0 0.0 2.0 0.0 -1.0 2.0 2.0 2.0
10.0 6.0 3.4 5.2 6.8 9.5 4.3 2.1
2.5 3.5 2.5 4.5 -3.3 -2.3 6.8 -2.3
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1.0 1.0 2.0 2.0 0.0 0.0 1.0 -1.0
| ^~~
|
s029000490
|
p00058
|
C++
|
#include<stdio.h>
#include<cstudio>
#include<iostream>
double abs(double a){return a<0?-a:a;}
int main(){
double xa,xb,xc,xd,ya,yb,yc,yd;
while(~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)){
double t=(xa-xb)*(xc-xd)+(ya-yb)*(yc-yd);
if(abs(t)<0.00001)printf("YES\n");
else printf("NO\n");
}
}
|
a.cc:2:9: fatal error: cstudio: No such file or directory
2 | #include<cstudio>
| ^~~~~~~~~
compilation terminated.
|
s588760372
|
p00058
|
C++
|
include <iostream>
using namespace std;
struct Point {
double x, 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 *(double t) { return Point(x*t, y*t);}
};
typedef Point Vector;
int naiseki(Vector a, Vector b);
int isTyokko(Point a1, Point a2, Point b1, Point b2) {
if(naiseki(Vector(a1.x-a2.x, a1.y-a2.y), Vector(b1.x-b2.x, b1.y-b2.y)) == 0) {
return 1;
} else {
return 0;
}
}
int naiseki(Vector a, Vector b) {
return a.x*b.x + a.y*b.y;
}
int main() {
Point a, b, c, d;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y, &d.x, &d.y) != EOF) {
if(isTyokko(a, b, c, d)) printf("YES\n");
else printf("NO\n");
}
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:30:9: error: 'scanf' was not declared in this scope
30 | while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y, &d.x, &d.y) != EOF) {
| ^~~~~
a.cc:30:101: error: 'EOF' was not declared in this scope
30 | while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y, &d.x, &d.y) != EOF) {
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include <iostream>
a.cc:31:30: error: 'printf' was not declared in this scope
31 | if(isTyokko(a, b, c, d)) printf("YES\n");
| ^~~~~~
a.cc:31:30: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:32:10: error: 'printf' was not declared in this scope
32 | else printf("NO\n");
| ^~~~~~
a.cc:32:10: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s146290450
|
p00058
|
C++
|
main(){
double xa, ya, xb, yb, xc, yc, xd, yd;
double A,B;//AAB
while((scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd))!=EOF){
// cout << xa << " "<<ya << " " << yd<< endl;
if((xa-xb) != 0){A=(ya-yb)/(xa-xb);}
if((xc-xd) != 0){B=(yc-yd)/(xc-xd);}
if(A*B==-1){cout << "YES"<<endl;}
else if((xa-xb)==0 && (ya-yb)==0 ||(xc-xd)==0 && (yc-yd)==0 ){cout << "YES"<<endl;}
else if((xa-xb)==0&&(xc-xd)==0){cout << "NO"<<endl;}
else if((xa-xb)==0&&B==0){cout << "YES"<<endl;}
else if((xc-xd)==0&&A==0){cout << "YES"<<endl;}
else {cout << "NO"<<endl;}
}
return 0;
}
|
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:5:10: error: 'scanf' was not declared in this scope
5 | while((scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd))!=EOF){
| ^~~~~
a.cc:5:78: error: 'EOF' was not declared in this scope
5 | while((scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd))!=EOF){
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 |
a.cc:12:17: error: 'cout' was not declared in this scope
12 | if(A*B==-1){cout << "YES"<<endl;}
| ^~~~
a.cc:12:32: error: 'endl' was not declared in this scope
12 | if(A*B==-1){cout << "YES"<<endl;}
| ^~~~
a.cc:13:67: error: 'cout' was not declared in this scope
13 | else if((xa-xb)==0 && (ya-yb)==0 ||(xc-xd)==0 && (yc-yd)==0 ){cout << "YES"<<endl;}
| ^~~~
a.cc:13:82: error: 'endl' was not declared in this scope
13 | else if((xa-xb)==0 && (ya-yb)==0 ||(xc-xd)==0 && (yc-yd)==0 ){cout << "YES"<<endl;}
| ^~~~
a.cc:14:37: error: 'cout' was not declared in this scope
14 | else if((xa-xb)==0&&(xc-xd)==0){cout << "NO"<<endl;}
| ^~~~
a.cc:14:51: error: 'endl' was not declared in this scope
14 | else if((xa-xb)==0&&(xc-xd)==0){cout << "NO"<<endl;}
| ^~~~
a.cc:15:31: error: 'cout' was not declared in this scope
15 | else if((xa-xb)==0&&B==0){cout << "YES"<<endl;}
| ^~~~
a.cc:15:46: error: 'endl' was not declared in this scope
15 | else if((xa-xb)==0&&B==0){cout << "YES"<<endl;}
| ^~~~
a.cc:16:31: error: 'cout' was not declared in this scope
16 | else if((xc-xd)==0&&A==0){cout << "YES"<<endl;}
| ^~~~
a.cc:16:46: error: 'endl' was not declared in this scope
16 | else if((xc-xd)==0&&A==0){cout << "YES"<<endl;}
| ^~~~
a.cc:17:11: error: 'cout' was not declared in this scope
17 | else {cout << "NO"<<endl;}
| ^~~~
a.cc:17:25: error: 'endl' was not declared in this scope
17 | else {cout << "NO"<<endl;}
| ^~~~
|
s377844940
|
p00058
|
C++
|
#include <cmath>
#include <complex>
#include <vector>
#include <cfloat>
#include <algorithm>
using namespace std;
///////////////////////
//二次元幾何テンプレート
//点クラス point->x,y
//直線クラス line->s,v
//
class point;
class line;
point vec_add(point vec1,point vec2);//ベクトルの足し算
point vec_sub(point vec1,point vec2);//ベクトルの引き算
double inner_product(point a,point b);//内積
double outer_product(point a,point b);//外積
bool vec_parallel(point vec1,point vec2);//ベクトルの並行判定(交差判定falseとしても使える)
bool vec_angle_right(point vec1,point vec2);//ベクトルの直行判定
bool cross_line_segment(line a,point p1,point p2);//直線と線分の交差判定
//
class point{
public:
double x,y;
point(){
x=0;
y=0;
}
point(double a,double b){
x=a;
y=b;
}
};
//直線クラス
class line{
public:
point s,v;
public:
line(point a,point b){
s=a;
v=vec_sub(a,b);
}
};
///////////////////////
int main(){
point a[4];
while(cin>>a[0].x>>a[0].y){
for(int i=1;i<4;i++){
cin>>a[i].x>>a[i].y;
}
bool f=vec_angle_right(vec_sub(a[0],a[1]),vec_sub(a[2],a[3]));
if(f){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
}
//
//多角形(頂点を保持する)
typedef vector<point> polygon;
//ベクトルの足し算
point vec_add(point vec1,point vec2){
point res(vec1.x+vec2.x,vec1.y+vec2.y);
return res;
}
//ベクトルの引き算
point vec_sub(point vec1,point vec2){
point res(vec1.x-vec2.x,vec1.y-vec2.y);
return res;
}
//内積
double inner_product(point a,point b){
return a.x * b.x + a.y * b.y;
}
//外積
double outer_product(point a,point b){
return a.x * b.y - a.y * b.x;
}
//ベクトルの並行判定
bool vec_parallel(point vec1,point vec2){
if(outer_product(vec1,vec2)==0){
return true;
}else{
return false;
}
}
//ベクトルの直交判定
bool vec_angle_right(point vec1,point vec2){
if(inner_product(vec1,vec2)==0){
return true;
}else{
return false;
}
}
bool cross_line_segment(line l,point p1,point p2){
p1=vec_sub(p1,l.s);
p2=vec_sub(p2,l.s);
if(outer_product(p1,l.v)*outer_product(p2,l.v)<0){
return true;
}else{
return false;
}
}
void bool_cout(bool a){
if(a==true){
cout<<"true"<<endl;
}else{
cout<<"false"<<endl;
}
}
//
|
a.cc: In function 'int main()':
a.cc:52:15: error: 'cin' was not declared in this scope
52 | while(cin>>a[0].x>>a[0].y){
| ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
5 | #include <algorithm>
+++ |+#include <iostream>
6 | using namespace std;
a.cc:58:25: error: 'cout' was not declared in this scope
58 | cout<<"YES"<<endl;
| ^~~~
a.cc:58:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:60:25: error: 'cout' was not declared in this scope
60 | cout<<"NO"<<endl;
| ^~~~
a.cc:60:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc: In function 'void bool_cout(bool)':
a.cc:119:17: error: 'cout' was not declared in this scope
119 | cout<<"true"<<endl;
| ^~~~
a.cc:119:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:121:17: error: 'cout' was not declared in this scope
121 | cout<<"false"<<endl;
| ^~~~
a.cc:121:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s474911201
|
p00058
|
C++
|
#include <cmath>
#include <complex>
#include <vector>
#include <cfloat>
#include <algorithm>
using namespace std;
///////////////////////
//二次元幾何テンプレート
//点クラス point->x,y
//直線クラス line->s,v
//
class point;
class line;
point vec_add(point vec1,point vec2);//ベクトルの足し算
point vec_sub(point vec1,point vec2);//ベクトルの引き算
double inner_product(point a,point b);//内積
double outer_product(point a,point b);//外積
bool vec_parallel(point vec1,point vec2);//ベクトルの並行判定(交差判定falseとしても使える)
bool vec_angle_right(point vec1,point vec2);//ベクトルの直行判定
bool cross_line_segment(line a,point p1,point p2);//直線と線分の交差判定
//
class point{
public:
double x,y;
point(){
x=0;
y=0;
}
point(double a,double b){
x=a;
y=b;
}
};
//直線クラス
class line{
public:
point s,v;
public:
line(point a,point b){
s=a;
v=vec_sub(a,b);
}
};
///////////////////////
int main(){
point a[4];
while(std::cin>>a[0].x>>a[0].y){
for(int i=1;i<4;i++){
cin>>a[i].x>>a[i].y;
}
bool f=vec_angle_right(vec_sub(a[0],a[1]),vec_sub(a[2],a[3]));
if(f){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
}
//
//多角形(頂点を保持する)
typedef vector<point> polygon;
//ベクトルの足し算
point vec_add(point vec1,point vec2){
point res(vec1.x+vec2.x,vec1.y+vec2.y);
return res;
}
//ベクトルの引き算
point vec_sub(point vec1,point vec2){
point res(vec1.x-vec2.x,vec1.y-vec2.y);
return res;
}
//内積
double inner_product(point a,point b){
return a.x * b.x + a.y * b.y;
}
//外積
double outer_product(point a,point b){
return a.x * b.y - a.y * b.x;
}
//ベクトルの並行判定
bool vec_parallel(point vec1,point vec2){
if(outer_product(vec1,vec2)==0){
return true;
}else{
return false;
}
}
//ベクトルの直交判定
bool vec_angle_right(point vec1,point vec2){
if(inner_product(vec1,vec2)==0){
return true;
}else{
return false;
}
}
bool cross_line_segment(line l,point p1,point p2){
p1=vec_sub(p1,l.s);
p2=vec_sub(p2,l.s);
if(outer_product(p1,l.v)*outer_product(p2,l.v)<0){
return true;
}else{
return false;
}
}
//
|
a.cc: In function 'int main()':
a.cc:52:20: error: 'cin' is not a member of 'std'
52 | while(std::cin>>a[0].x>>a[0].y){
| ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
5 | #include <algorithm>
+++ |+#include <iostream>
6 | using namespace std;
a.cc:54:25: error: 'cin' was not declared in this scope
54 | cin>>a[i].x>>a[i].y;
| ^~~
a.cc:54:25: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:58:25: error: 'cout' was not declared in this scope
58 | cout<<"YES"<<endl;
| ^~~~
a.cc:58:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:60:25: error: 'cout' was not declared in this scope
60 | cout<<"NO"<<endl;
| ^~~~
a.cc:60:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s741526641
|
p00058
|
C++
|
#include <iostream>
using namespace std;
/** Problem0058 : Orthogonal **/
int main()
{
double xA, yA, xB, yB, xC, yC, xD, yD, EPS=1e-12;
while (cin >> xA >> yA >>xB >> yB >> xC >> yC >> xD >> yD) {
if (fabs((xB-xA)*(xD-xC)+(yB-yA)*(yD-yC))<EPS)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
11 | if (fabs((xB-xA)*(xD-xC)+(yB-yA)*(yD-yC))<EPS)
| ^~~~
| labs
|
s605338636
|
p00059
|
Java
|
package aoj;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class aoj037 {
public static void main(String[] args){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String tmp = null;
int i = 0;
int counta=0;
int max = 0;
int min = Integer.MAX_VALUE;
int tmpp = Integer.MAX_VALUE;
ArrayList<Integer> ast1 = new ArrayList<Integer>();
ArrayList<String> ast = new ArrayList<String>();
String[] sprite;
double tmp1,tmp2;
double[] tmper = new double[8];
boolean flag;
double tmpkata=0,tmpx,tmpy;
double tmpkata2=0,tmpx2,tmpy2;
int uuuuu;
int ban =0;
int yokosen,bangou,atari,dansuu;
int yokosen2,bangou2,atari2,dansuu2;
boolean flagr = false;
while(true){
try {
tmp = br.readLine();
} catch (IOException e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
}
if(tmp == null){
break;
}
if(tmp.equals("")){
break;
}
String[] sprit = tmp.split(" ");
seihoukei sk1 = new seihoukei();
seihoukei sk2 = new seihoukei();
sk1.setXleft(Double.parseDouble(sprit[0]));
sk1.setYleft(Double.parseDouble(sprit[1]));
sk1.setXright(Double.parseDouble(sprit[2]));
sk1.setYright(Double.parseDouble(sprit[3]));
sk2.setXleft(Double.parseDouble(sprit[4]));
sk2.setYleft(Double.parseDouble(sprit[5]));
sk2.setXright(Double.parseDouble(sprit[6]));
sk2.setYright(Double.parseDouble(sprit[7]));
sk1.calc();
sk2.calc();
if(sk1.getXleft() >= sk2.getXleft() && sk1.getYleft() <= sk2.getYleft() ){
flagr = true;
}else if(sk1.getXleft2() <= sk2.getXleft2() && sk1.getYleft2() <= sk2.getYleft2() ){
flagr = true;
}else if(sk1.getXright() <= sk2.getXright() && sk1.getYright() >= sk2.getYright()){
flagr = true;
}else if(sk1.getXright2() >= sk2.getXright2() && sk1.getYright2() >= sk2.getYright2()){
flagr = true;
}
if(flagr){
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
}
class seihoukei{
private double xleft;
private double xright;
private double yleft;
private double yright;
private double xleft2;
private double xright2;
private double yleft2;
private double yright2;
public double getXleft() {
return xleft;
}
public void setXleft(double xleft) {
this.xleft = xleft;
}
public double getXright() {
return xright;
}
public void setXright(double xright) {
this.xright = xright;
}
public double getYleft() {
return yleft;
}
public void setYleft(double yleft) {
this.yleft = yleft;
}
public double getYright() {
return yright;
}
public void setYright(double yright) {
this.yright = yright;
}
public double getXleft2() {
return xleft2;
}
public double getXright2() {
return xright2;
}
public double getYleft2() {
return yleft2;
}
public double getYright2() {
return yright2;
}
public void calc(){
xleft2= xright;
yleft2= yleft;
xright2= xleft;
yright2= yright;
}
}
|
Main.java:8: error: class aoj037 is public, should be declared in a file named aoj037.java
public class aoj037 {
^
1 error
|
s571439335
|
p00059
|
Java
|
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
class Main {
static final eps = 1.0e-8;
static final int X = 0;
static final int Y = 1;
public static void main( String[] args ) {
final Scanner stdin = new Scanner( System.in );
while ( stdin.hasNextDouble() ) {
final double[][] ps = new double[4][2];
for ( int i = 0; i < 4; i++ ){
ps[i][X] = stdin.nextDouble();
ps[i][Y] = stdin.nextDouble();
}
if ( inside( ps[0], ps[1], ps[2][X], ps[2][Y] ) ||
inside( ps[0], ps[1], ps[2][X], ps[3][Y] ) ||
inside( ps[0], ps[1], ps[3][X], ps[2][Y] ) ||
inside( ps[0], ps[1], ps[3][X], ps[3][Y] ) ){
System.out.println( "YES" );
} else {
System.out.println( "NO" );
}
}
}
static boolean inside( final double[] p1, final double[] p2, final double x, final double y ) {
return ( min( p1[X], p2[X] ) - eps <= x && x <= max( p1[X], p2[X] ) + eps &&
min( p1[Y], p2[Y] ) - eps <= y && y <= max( p1[Y], p2[Y] ) + eps );
}
}
|
Main.java:7: error: <identifier> expected
static final eps = 1.0e-8;
^
1 error
|
s672049518
|
p00059
|
C
|
#include <stdio.h>
#include <math.h>
??
int main(void) {
????????double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
????????while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) {
????????????????if (fabs((xa1+xa2)-(xb1+xb2))/2.0 <= (fabs(xa2-xa1)+fabs(xb2-xb1))/2.0 || fabs((ya1+ya2)-(yb1+yb2))/2.0 <= (fabs(ya2-ya1)+fabs(yb2-yb1))/2.0)
????????????????????????printf("YES\n");
????????????????else
????????????????????????printf("NO\n");
????????}
????????return 0;
}
|
main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
|
s915981903
|
p00059
|
C
|
#include<stdio.h>
int main(void){
int xa1, xa2, xb1, xb2, ya1, ya2, yb1, yb2, key;
scanf("%d %d %d %d %d %d %d %d %d", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2);
if ( xa1 > xa2 ) { xa1 = key; xa1 = xa2; xa2 = key; }
if ( ya1 > ya2 ) { ya1 = key; ya1 = ya2; ya2 = key; }
if ( xb1 > xb2 ) { xb1 = key; xb1 = xb2; xb2 = key; }
if ( yb1 > yb2 ) { yb1 = key; yb1 = yb2; yb2 = key; }
if ( xa1 < xb1 && xb1 < xa2 ) {
if ( ya1 < yb1 && yb1< ya2) printf("YES");
else if (ya1 < yb2 && yb2 < ya2 ) printf("YES");
else printf("NO");
}
else if (xa1 < xb2 && xb2 < xa2 ) {
if ( ya1 < yb1 && yb1 < ya2 ) printf("YES");
else if ( ya1 < yb2 && yb2 < ya2 ) printf("NO");
else printf("NO");
else printf("NO");
return 0;
}
|
main.c: In function 'main':
main.c:19:4: error: expected '}' before 'else'
19 | else printf("NO");
| ^~~~
|
s570075289
|
p00059
|
C
|
include <stdio.h>
int main(){
double xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
&xa1,&ya1,&xa2,&ya2,&xb1,&yb1,&xb2,&yb2)!=EOF){
if (((xb1<=xa1 && xa1<=xb2) && (yb1<=ya2 && ya2<=yb2)) ||
((xb1<=xa1 && xa1<=xb2) && (yb1<=ya1 && ya1<=yb2)) ||
((xb1<=xa2 && xa2<=xb2) && (yb1<=ya2 && ya2<=yb2)) ||
((xb1<=xa2 && xa2<=xb2) && (yb1<=ya1 && ya1<=yb2)) ||
((xa1<=xb1 && xb1<=xa2) && (ya1<=yb2 && yb2<=ya2)) ||
((xa1<=xb1 && xb1<=xa2) && (ya1<=yb1 && yb1<=ya2)) ||
((xa1<=xb2 && xb2<=xa2) && (ya1<=yb2 && yb2<=ya2)) ||
((xa1<=xb2 && xb2<=xa2) && (ya1<=yb1 && yb1<=ya2)))
puts("YES");
else
puts("NO");
}
return 0;
}
|
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s381926172
|
p00059
|
C
|
#include <stdio.h>
int main(){
double xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
&xa1,&ya1,&xa2,&ya2,&xb1,&yb1,&xb2,&yb2)!=EOF){
if (((xb1<=xa1 && xa1<=xb2) && (yb1<=ya2 && ya2<=yb2)) ||
((xb1<=xa1 && xa1<=xb2) && (yb1<=ya1 && ya1<=yb2)) ||
)
puts("YES");
else
puts("NO");
}
return 0;
}
|
main.c: In function 'main':
main.c:9:1: error: expected expression before ')' token
9 | )
| ^
|
s093368531
|
p00059
|
C++
|
import sys
for s in sys.stdin:
a,b,c,d,e,f,g,h=map(float,s.split())
print ["YES","NO"][any([c<e,g<a,d<f,h<b])]
|
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'
|
s495469644
|
p00059
|
C++
|
#include <iostream>
using namespace std;
int function(double xa1,double ya1,double xb1,double yb1,double xa2,double ya2,double xb2,double yb2){
if( (xa1<=xa2&&xa2<=xb1) && (ya1<=yb2&&yb2<=yb1)||
(xa1<=xa2&&xb1<=xb2)&&(ya1<=ya2&&ya2<=yb1)||
(xa1<=xb2&&xb2<=xb1)&&(ya1<=yb2&&yb2<=yb1)||
(xa1<=xb2&&xb2<=xb1)&&(ya1<=ya2&&ya2<=yb1)||
(xa2<=xa1&&xb1<=xb2)&&(ya2<=ya1)&&(yb1<=yb2)
(xa1<=xa2&&xb2<=xb1)&&(ya1<=ya2)&&(yb2<=yb1)){
return 1;
}
else{
return 0;
}
}
int main(){
double xa1,ya1,xb1,yb1,xa2,ya2,xb2,yb2;
while(cin>>xa1){
cin>>ya1;
cin>>xb1;
cin>>yb1;
cin>>xa2;
cin>>ya2;
cin>>xb2;
cin>>yb2;
int flag = function(xa1,ya1,xb1,yb1,xa2,ya2,xb2,yb2);
if(flag==1){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
return 0;
}
|
a.cc: In function 'int function(double, double, double, double, double, double, double, double)':
a.cc:11:25: error: expression cannot be used as a function
10 | (xa2<=xa1&&xb1<=xb2)&&(ya2<=ya1)&&(yb1<=yb2)
| ~~~~~~~~~~
11 | (xa1<=xa2&&xb2<=xb1)&&(ya1<=ya2)&&(yb2<=yb1)){
| ^~~~~~~~~~~~~~~~~~~~
a.cc:17:1: warning: control reaches end of non-void function [-Wreturn-type]
17 | }
| ^
|
s778875469
|
p00059
|
C++
|
[13t4047y@hcs]~/prokon/aoj/volume0% cat 59k.cc
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n); (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define rev(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c) for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define ALL(v) (v).begin(), (v).end()
#define mp make_pair
#define pb push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }
const int INF = 1000000000;
const ll MOD = 1000000007LL;
const double EPS = 1E-12;
template<typename T> T add(T x, T y){ if(abs(x+y) < EPS*(abs(x)+abs(y))) return 0; return x + y; }
template<typename T> inline bool semieq(T x, T y){ return abs(x - y) < EPS; }
template<typename T> inline bool semige(T x, T y){ return y - x < -EPS; }
template<typename T> inline bool semile(T x, T y){ return x - y < -EPS; }
struct Point : public complex<double>
{
public:
Point() { this->real(0); this->imag(0); }
Point(const double& x, const double& y) { this->real(x); this->imag(y); }
Point(const complex<double> w) { this->real(w.real()); this->imag(w.imag()); }
inline double dot(Point p){ return (conj(*this) * p).real(); } // ??????
inline double det(Point p){ return (conj(*this) * p).imag(); } // ??????
};
namespace std
{
bool operator < (const Point& a, const Point& b)
{
return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
}
}
typedef vector<Point> Polygon;
int ccw(Point a, Point b, Point c)
{
b -= a;
c -= a;
if(b.det(c) > 0.0) return 1; // counter clockwise
if(b.det(c) < 0.0) return -1; // clockwise
if(b.dot(c) < 0.0) return 2; // c--a--b on line
if(norm(b) < norm(c)) return -2; // a--b--c on line return 0;
return 0.0;
}
struct Line : public vector<Point>
{
public:
Line(const Point& p, const Point& q){ this->pb(p); this->pb(q); }
Line rtn(){ return *this; }
Point pt(){ return this->at(0); }
Point projection(Point& p){return this->at(0)+((Point(p-this->at(0))).dot(this->at(0)-this->at(1))/norm(this->at(0)-this->at(1)))*(this->at(0)-this->at(1));}
Point reflection(Point& p){return p+2.0*(this->projection(p)-p);}
inline bool intersectionDeterminationOfLL(Line& l){return abs(Point(this->at(1)-this->at(0)).det(l[1]-l[0]))>EPS||abs(Point(this->at(1)-this->at(0)).det(l[0]-this->at(0)))<EPS;}
inline bool intersectionDeterminationOfLS(Line& s){return (Point(this->at(1)-this->at(0)).det(s[0]-this->at(0)))*(Point(this->at(1)-this->at(0)).det(s[1]-this->at(0)))<EPS;}
inline bool intersectionDeterminationOfLP(Point& p){return abs(Point(this->at(1)-p).det(this->at(0)-p))<EPS;}
inline bool intersectionDeterminationOfSS(Line& s){return ccw(this->at(0),this->at(1),s[0])*ccw(this->at(0),this->at(1),s[1])<=0&&ccw(s[0],s[1],this->at(0))*ccw(s[0],s[1],this->at(1))<=0;}
inline bool intersectionDeterminationOfSP(Point& p){return abs(this->at(0)-p)+abs(this->at(1)-p)-abs(this->at(1)-this->at(0))<EPS;}
inline double distanceLP(Point& p){return abs(p-this->projection(p));}
inline double distanceLL(Line& l){return this->intersectionDeterminationOfLL(l)?0.0:this->distanceLP(l[0]);}
inline double distanceLS(Line& s){return this->intersectionDeterminationOfLS(s)?0.0:min(this->distanceLP(s[0]),this->distanceLP(s[1]));}
inline double distanceSP(Point& p){Point r=this->projection(p);return this->intersectionDeterminationOfSP(r)?abs(r-p):min(abs(this->at(0)-p),abs(this->at(1)-p));}
inline double distanceSS(Line& s){return this->intersectionDeterminationOfSS(s)?0.0:min(min(this->distanceSP(s[0]),this->distanceSP(s[1])),min(s.distanceSP(this->at(0)),s.distanceSP(this->at(1))));}
Point intersection(Line& l){
double A = Point(this->at(1)-this->at(0)).det(l[1]-l[0]);
double B = Point(this->at(1)-this->at(0)).det(this->at(1)-l[0]);
if(abs(A)<EPS && abs(B)<EPS) return l[0];
if(abs(A)<EPS) assert(false);
return l[0] + B/A * (l[1]-l[0]);
}
};
#define currPoint(P, i) P[i]
#define nextPoint(P, i) P[(i+1)%P.size()]
/*
enum { OUT, ON, IN };
int contains(const Polygon& P, const Point& p)
{
bool in = false;
for (int i = 0; i < P.size(); ++i) {
Point a = currPoint(P,i) - p, b = nextPoint(P,i) - p;
if (semige(imag(a), imag(b))) swap(a, b);
if (!semige(imag(a), 0.0) && semile(0.0, imag(b)))
if (semile(a.det(b), 0.0)) in = !in;
if (semieq(a.det(b), 0.0) && !semige(a.dot(b), 0.0)) return ON;
}
return in ? IN : OUT;
}
*/
enum { OUT, ON, IN };
int contains(const Polygon &P, const Point &p)
{
const int n = P.size();
Point g = (P[0] + P[n/3] + P[2*n/3]) / 3.0; // inner-Point
int a = 0, b = n;
while (a+1 < b) { // invariant: c is in fan g-P[a]-P[b]
int c = (a + b) / 2;
if (semige(Point(P[a]-g).det(P[c]-g), 0.0)) { // angle < 180 deg
if (semige(Point(P[a]-g).det(p-g), 0.0) && semile(Point(P[c]-g).det(p-g), 0.0)) b = c;
else a = c;
} else {
if (semile(Point(P[a]-g).det(p-g), 0.0) && semige(Point(P[c]-g).det(p-g), 0.0)) a = c;
else b = c;
}
}
b %= n;
if (semile(Point(P[a] - p).det(P[b] - p), 0.0)) return 0;
if (semige(Point(P[a] - p).det(P[b] - p), 0.0)) return 2;
return 1;
}
double x[4];
double y[4];
int main()
{
while(cin >> x[0] >> y[0] >> x[2] >> y[2]){
x[1] = x[2]; y[1] = y[0];
x[3] = x[0]; y[3] = y[2];
Polygon a;
vector<Line> A;
rep(i, 4) a.pb(Point(x[i], y[i]));
rep(i, 4) A.pb(Line(currPoint(a, i), nextPoint(a, i)));
cin >> x[0] >> y[0] >> x[2] >> y[2];
x[1] = x[2]; y[1] = y[0];
x[3] = x[0]; y[3] = y[2];
Polygon b;
vector<Line> B;
rep(i, 4) b.pb(Point(x[i], y[i]));
rep(i, 4) B.pb(Line(currPoint(b, i), nextPoint(b, i)));
bool ok = false;
//vrep(v, A) vrep(w, B) ok |= v->intersectionDeterminationOfSS(*w);
rep(i, 4) ok |= (contains(a, b[i]) != OUT);
rep(i, 4) ok |= (contains(b, a[i]) != OUT);
puts(ok ? "YES" : "NO");
}
return 0;
}
|
a.cc:1:10: error: stray '@' in program
1 | [13t4047y@hcs]~/prokon/aoj/volume0% cat 59k.cc
| ^
a.cc:1:1: error: expected unqualified-id before '[' token
1 | [13t4047y@hcs]~/prokon/aoj/volume0% cat 59k.cc
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
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'; did you mean 'nullptr_t'?
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/cstddef:50,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
443 | typedef decltype(nullptr) 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:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
443 | typedef decltype(nullptr) 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:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/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'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/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'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/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'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/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:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59,
from /usr/include/c++/14/bits/stl_algo.h:69,
from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes
|
s671602369
|
p00059
|
C++
|
#include "bits/stdc++.h"
using namespace std;
typedef vector<double> vi;
typedef pair<double,double> pii;
typedef long long ll;
#define dump(x) cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb push_back
bool in(double xa1,double ya1,double xa2,double ya2,double xa3,double ya3,double xa4,double ya4, double x,double y ){
if( xa1<=x && x<=xa2 && ya1<=y && y<=ya2 )return true;
else return false;
}
bool solve(double xa1,double ya1,double xa2,double ya2,double xb1,double yb1,double xb2,double yb2){
double xb3=xb1,yb3=yb2,yb4=yb2,yb4=yb1;
double xa3=xa1,ya3=ya2,xa4=xa2,ya4=ya1;
if( in(xa1,ya1,xa2,ya2,xa3,ya3,xa4,ya4 , xb1,yb1 ) )return true;
if( in(xa1,ya1,xa2,ya2,xa3,ya3,xa4,ya4 , xb2,yb2 ) )return true;
if( in(xa1,ya1,xa2,ya2,xa3,ya3,xa4,ya4 , xb3,yb3 ) )return true;
if( in(xa1,ya1,xa2,ya2,xa3,ya3,xa4,ya4 , xb4,yb4 ) )return true;
return false;
}
int main(){
double xa1,ya1,xa2,ya2;
double xb1,yb1,xb2,yb2;
while(cin>>xa1>>ya1>>xa2>>ya2>>xb1>>yb1>>xb2>>yb2){
if( solve(xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2) )cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}
|
a.cc: In function 'bool solve(double, double, double, double, double, double, double, double)':
a.cc:21:40: error: redeclaration of 'double yb4'
21 | double xb3=xb1,yb3=yb2,yb4=yb2,yb4=yb1;
| ^~~
a.cc:21:32: note: 'double yb4' previously declared here
21 | double xb3=xb1,yb3=yb2,yb4=yb2,yb4=yb1;
| ^~~
a.cc:27:50: error: 'xb4' was not declared in this scope; did you mean 'xa4'?
27 | if( in(xa1,ya1,xa2,ya2,xa3,ya3,xa4,ya4 , xb4,yb4 ) )return true;
| ^~~
| xa4
|
s161104958
|
p00059
|
C++
|
import java.awt.Point;
import java.awt.geom.*;
import java.awt.geom.Point2D.Double;
import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
new Main();
}
public Main() {
new aoj0059().doIt();
}
class aoj0059{
void doIt(){
while(sc.hasNext()){
boolean in = false;
Point2D p[] = new Point2D[4];
Point2D p2[] = new Point2D[4];
for(int i = 0;i < 2;i++){
p[i*2] = new Point2D.Double(sc.nextDouble(),sc.nextDouble());
}
p[1] = new Point2D.Double(p[0].getX(),p[2].getY());
p[3] = new Point2D.Double(p[2].getX(),p[0].getY());
for(int i = 0;i < 2;i++){
p2[i*2] = new Point2D.Double(sc.nextDouble(),sc.nextDouble());
}
p2[1] = new Point2D.Double(p2[0].getX(),p2[2].getY());
p2[3] = new Point2D.Double(p2[2].getX(),p2[0].getY());
for(int i = 0;i < 4;i++){
if(contains(p,p2[i]) > 0)in = true;
}
if(in)System.out.println("YES");
else System.out.println("NO");
}
}
int contains(Point2D[] plist,Point2D p) {
boolean isin = false;
int n = plist.length;
for(int i=0;i<n;i++){
Point2D a = sub(plist[i], p);
Point2D b = sub(plist[(i+1) % n], p);
if(a.getY() > b.getY()){
Point2D temp = (Point2D) a.clone();
a = b;
b = temp;
}
if(a.getY() <= 0 && 0 < b.getY()){
if(cross(a,b) < 0) isin = ! isin;
}
if(cross(a,b) == 0 && dot(a, b) <= 0) return 0;
}
return isin ? 1 : -1;
}
Point2D sub(Point2D p2, Point2D p1) {
double x = p2.getX() - p1.getX();
double y = p2.getY() - p1.getY();
return new Point2D.Double(x, y);
}
double cross(Point2D p1, Point2D p2){
double res = p1.getX() * p2.getY() - p1.getY() * p2.getX();
return res;
}
double dot(Point2D p1,Point2D p2){
return p1.getX() * p2.getX() + p1.getY() * p2.getY();
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.awt.Point;
| ^~~~~~
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.awt.geom.*;
| ^~~~~~
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.awt.geom.Point2D.Double;
| ^~~~~~
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.*;
| ^~~~~~
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 {
| ^~~~~~
|
s602698560
|
p00059
|
C++
|
#include<iostream>
using namespace std;
int main() {
double x[4], x_r[4];
double y[4], y_r[4];
while(cin >> x[0] >> y[0]){
x_r[0] = x[0];
y_r[0] = y[0];
for(int i = 1; i < 4; i++) {
cin >> x[i] >> y[i];
x_r[i] = x[i];
y_r[i] = y[i];
}
sort(x, x + 4);
sort(y, y + 4);
int s_x = x[1];
int s_y = y[1];
int r_x, r_y;
if(x[1] == x_r[2]){
r_x = x[1];
}else {
r_x = x_r[1];
}
if(y[1] == y_r[2]) {
r_y = y[1];
}else {
r_y = y_r[1];
}
if(r_x == s_x && r_y == s_y) {
cout << "YES" << endl;
}else {
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'short'?
18 | sort(x, x + 4);
| ^~~~
| short
|
s113488739
|
p00059
|
C++
|
#include<iostream>
using namespace std;
int main() {
double x[4], x_r[4];
double y[4], y_r[4];
while(cin >> x[0] >> y[0]){
x_r[0] = x[0];
y_r[0] = y[0];
for(int i = 1; i < 4; i++) {
cin >> x[i] >> y[i];
x_r[i] = x[i];
y_r[i] = y[i];
}
sort(x, x + 4);
sort(y, y + 4);
double s_x = x[1];
double s_y = y[1];
double r_x, r_y;
if(x[1] == x_r[2]){
r_x = x[1];
}else {
r_x = x_r[1];
}
if(y[1] == y_r[2]) {
r_y = y[1];
}else {
r_y = y_r[1];
}
if(r_x == s_x && r_y == s_y) {
cout << "YES" << endl;
}else {
cout << "NO" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'short'?
18 | sort(x, x + 4);
| ^~~~
| short
|
s619796279
|
p00059
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
struct rect {
double leftX, leftY;
double rightX, rightY;
};
int main() {
rect a, b;
while(cin >> a.leftX >> a.leftY >> a.rightX >> a.rightY >> b.leftX >> b.leftY >> b.rightX >> b.rightY) {
if(b.rightX < a.leftX || a.rightX < b.leftX || b.rightY < a.leftY || a.rightY < b.leftY) {
cout << "NO" << endl;
}else {
cout < "YES" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:20: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<'
18 | cout < "YES" << endl;
| ~~~~~~^~~~~~~
|
s528832934
|
p00059
|
C++
|
using System;
public class _0059 {
public _0059() {
}
public void Run() {
string str;
float[] vals;
while((str = Console.ReadLine()) != null) {
vals = Array.ConvertAll(str.Split(), s => float.Parse(s));
Console.WriteLine((vals[0] <= vals[6] && vals[4] <= vals[2] && vals[1] <= vals[7] && vals[5] <= vals[3]) ? "YES" : "NO");
}
}
public static void Main() {
var program = new _0059();
program.Run();
}
}
|
a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class _0059 {
| ^~~~~~
|
s116667544
|
p00059
|
C++
|
using Systeml
using System.Linq;
public static void Main() {
string str;
double[] vals;
while((str = Console.ReadLine()) != null) {
vals = str.Split().Take(8).Select(s => double.Parse(s)).ToArray();
Console.WriteLine((vals[0] <= vals[6] && vals[4] <= vals[2] && vals[1] <= vals[7] && vals[5] <= vals[3]) ? "YES" : "NO");
}
}
|
a.cc:1:7: error: expected nested-name-specifier before 'Systeml'
1 | using Systeml
| ^~~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public static void Main() {
| ^~~~~~
|
s989802574
|
p00059
|
C++
|
#include<iostream>
m(double a,double b){return a>b?a:b}
main(){for(double a,b,c,d,e,f,g,h;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;){if((m(e,g)+m(-a,-c))*(m(a,c)+m(-e,-g))>=0&&(m(f,g)+m(-b,-d))*(m(b,d)-min(f,g))>=0)std::cout<<"YES\n";else std::cout<<"NO\n";}}
|
a.cc:2:1: error: ISO C++ forbids declaration of 'm' with no type [-fpermissive]
2 | m(double a,double b){return a>b?a:b}
| ^
a.cc: In function 'int m(double, double)':
a.cc:2:36: error: expected ';' before '}' token
2 | m(double a,double b){return a>b?a:b}
| ^
| ;
a.cc: At global scope:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){for(double a,b,c,d,e,f,g,h;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;){if((m(e,g)+m(-a,-c))*(m(a,c)+m(-e,-g))>=0&&(m(f,g)+m(-b,-d))*(m(b,d)-min(f,g))>=0)std::cout<<"YES\n";else std::cout<<"NO\n";}}
| ^~~~
a.cc: In function 'int main()':
a.cc:3:139: error: 'min' was not declared in this scope; did you mean 'std::min'?
3 | main(){for(double a,b,c,d,e,f,g,h;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;){if((m(e,g)+m(-a,-c))*(m(a,c)+m(-e,-g))>=0&&(m(f,g)+m(-b,-d))*(m(b,d)-min(f,g))>=0)std::cout<<"YES\n";else std::cout<<"NO\n";}}
| ^~~
| std::min
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
|
s125210431
|
p00059
|
C++
|
#include<iostream>
double m(double a,double b){return a>b?a:b;}
main(){for(double a,b,c,d,e,f,g,h;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;){if(((m(e,g)+m(-a,-c))*(m(a,c)+m(-e,-g))>=0)&&((m(f,h)+m(-b,-d))*(m(b,d)+m(-f,-))>=0))std::cout<<"YES\n";else std::cout<<"NO\n";}}
|
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){for(double a,b,c,d,e,f,g,h;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;){if(((m(e,g)+m(-a,-c))*(m(a,c)+m(-e,-g))>=0)&&((m(f,h)+m(-b,-d))*(m(b,d)+m(-f,-))>=0))std::cout<<"YES\n";else std::cout<<"NO\n";}}
| ^~~~
a.cc: In function 'int main()':
a.cc:3:148: error: expected primary-expression before ')' token
3 | main(){for(double a,b,c,d,e,f,g,h;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;){if(((m(e,g)+m(-a,-c))*(m(a,c)+m(-e,-g))>=0)&&((m(f,h)+m(-b,-d))*(m(b,d)+m(-f,-))>=0))std::cout<<"YES\n";else std::cout<<"NO\n";}}
| ^
|
s855474250
|
p00059
|
C++
|
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <set>
#include <bitset>
#include <map>
using namespace std;
int main()
{
double x, y;
complex<double> coor[4], _coor[4];
while (scanf("%lf %lf ", &x, &y) == 2) {
coor[0] = complex<double>(x, y);
scanf("%lf %lf ", &x, &y);
coor[2] = complex<double>(x, y);
scanf("%lf %lf ", &x, &y);
_coor[0] = complex<double>(x, y);
scanf("%lf %lf ", &x, &y);
_coor[2] = complex<double>(x, y);
coor[1] = complex<double>(coor[0].real(), coor[2].imag());
coor[3] = complex<double>(coor[2].real(), coor.[0].imag());
_coor[1] = complex<double>(_coor[0].real(), _coor[2].imag());
_coor[3] = complex<double>(_coor[2].real(), _coor.[0].imag());
complex<double> g(0, 0);
for (int i = 0; i < 4; i++) {
g += _coor[i];
}
g /= 4;
bool flag = false;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (_coor[j].real() == _coor[(j + 1) % 4].real()) {
if ((coor[i].real() - _coor[j].real()) * (g.real() - _coor[j].real()) < 0) {
goto next;
}
} else {
if ((coor[i].imag() - _coor[j].imag()) * (g.imag() - _coor[j].imag()) < 0) {
goto next;
}
}
}
cout << "YES" << endl;
goto end;
next:;
}
cout << "NO" << endl;
end:;
}
}
|
a.cc: In function 'int main()':
a.cc:26:30: error: expected primary-expression before '(' token
26 | coor[3] = complex<double>(coor[2].real(), coor.[0].imag());
| ^
a.cc:26:52: error: expected unqualified-id before '[' token
26 | coor[3] = complex<double>(coor[2].real(), coor.[0].imag());
| ^
a.cc:28:31: error: expected primary-expression before '(' token
28 | _coor[3] = complex<double>(_coor[2].real(), _coor.[0].imag());
| ^
a.cc:28:55: error: expected unqualified-id before '[' token
28 | _coor[3] = complex<double>(_coor[2].real(), _coor.[0].imag());
| ^
|
s563151651
|
p00059
|
C++
|
#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;
double x1,y1,x2,y2,x3,y3,x4,y4;
int main(){
while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
if((x1<=x3&&x2>=x3||x1>=x3&&x1<=x4)&&(y1<=y3&&y2>=y3||y1>=y3&&y1<=y4))cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}
|
a.cc:12:11: error: 'double y1' redeclared as different kind of entity
12 | double x1,y1,x2,y2,x3,y3,x4,y4;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/bits/requires_hosted.h:31,
from /usr/include/c++/14/iostream:38,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:15:22: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ~~~~~~~^~~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(short int)y1' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(short unsigned int)y1' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(int)y1' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(unsigned int)y1' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(long int)y1' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(long unsigned int)y1' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(long long int)y1' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(long long unsigned int)y1' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:15:24: error: cannot bind rvalue '(void*)y1' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:24: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
15 | while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
| ^~
| |
| double (*)(double) noexcept
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
|
s642655982
|
p00059
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
using namespace std;
#define EPS (1e-8)
#define EQ(a,b) (abs((a)-(b))<EPS)
typedef complex<double> P;
struct Rect{
double minx;
double miny;
double maxx;
double maxy;
};
int main(){
Rect r[2];
while(cin>>r[0].minx>>r[0].miny>>r[0].maxx>>r[0].maxy>>r[1].minx>>r[1].miny>>r[1].maxx>>r[1].maxy){
P a[4];
P b[4];
a[0]=P(r[0].minx,r[0].miny);
a[1]=P(r[0].minx,r[0].maxy);
a[2]=P(r[0].maxx,r[0].miny);
a[3]=P(r[0].maxx,r[0].maxy);
b[0]=P(r[1].minx,r[1].miny);
b[1]=P(r[1].minx,r[1].maxy);
b[2]=P(r[1].maxx,r[1].miny);
b[3]=P(r[1].maxx,r[1].maxy);
bool f=false;
for(int i = 0; i < 4; i++){
if(
(EQ(a[i].real(),r[1].minx)||a[i].real()>r[1].minx)
&&(EQ(a[i].real(),r[1].maxx)||a[i].real()<r[1].maxx)
&&(EQ(a[i].imag(),r[1].miny)||a[i].imag()>r[1].miny)
&&(EQ(a[i].imag(),r[1].maxy)||a[i].imag()<r[1].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f){
for(int i = 0; i < 4; i++){
if(
(EQ(b[i].real(),r[0].minx)||b[i].real()>r[0].minx)
&&(EQ(b[i].real(),r[0].maxx)||b[i].real()<r[0].maxx)
&&(EQ(b[i].imag(),r[0].miny)||b[i].imag()>r[0].miny)
&&(EQ(b[i].imag(),r[0].maxy)||b[i].imag()<r[0].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f)
cout<<"NO"<<endl;
}
}
return 0;
}
using namespace std;
#define EPS (1e-8)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<double> P;
struct Rect{
double minx;
double miny;
double maxx;
double maxy;
};
int main(){
Rect r[2];
while(cin>>r[0].minx>>r[0].miny>>r[0].maxx>>r[0].maxy>>r[1].minx>>r[1].miny>>r[1].maxx>>r[1].maxy){
P a[4];
P b[4];
a[0]=P(r[0].minx,r[0].miny);
a[1]=P(r[0].minx,r[0].maxy);
a[2]=P(r[0].maxx,r[0].miny);
a[3]=P(r[0].maxx,r[0].maxy);
b[0]=P(r[1].minx,r[1].miny);
b[1]=P(r[1].minx,r[1].maxy);
b[2]=P(r[1].maxx,r[1].miny);
b[3]=P(r[1].maxx,r[1].maxy);
bool f=false;
for(int i = 0; i < 4; i++){
if(
(EQ(a[i].real(),r[1].minx)||a[i].real()>r[1].minx)
&&(EQ(a[i].real(),r[1].maxx)||a[i].real()<r[1].maxx)
&&(EQ(a[i].imag(),r[1].miny)||a[i].imag()>r[1].miny)
&&(EQ(a[i].imag(),r[1].maxy)||a[i].imag()<r[1].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f){
for(int i = 0; i < 4; i++){
if(
(EQ(b[i].real(),r[0].minx)||b[i].real()>r[0].minx)
&&(EQ(b[i].real(),r[0].maxx)||b[i].real()<r[0].maxx)
&&(EQ(b[i].imag(),r[0].miny)||b[i].imag()>r[0].miny)
&&(EQ(b[i].imag(),r[0].maxy)||b[i].imag()<r[0].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f)
cout<<"NO"<<endl;
}
}
return 0;
}
|
a.cc:74:9: warning: "EQ" redefined
74 | #define EQ(a,b) (abs(a-b)<EPS)
| ^~
a.cc:13:9: note: this is the location of the previous definition
13 | #define EQ(a,b) (abs((a)-(b))<EPS)
| ^~
a.cc:78:8: error: redefinition of 'struct Rect'
78 | struct Rect{
| ^~~~
a.cc:17:8: note: previous definition of 'struct Rect'
17 | struct Rect{
| ^~~~
a.cc:85:5: error: redefinition of 'int main()'
85 | int main(){
| ^~~~
a.cc:24:5: note: 'int main()' previously defined here
24 | int main(){
| ^~~~
|
s165610882
|
p00059
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
#include <cmath>
using namespace std;
#define EPS (1e-8)
#define EQ(a,b) (abs((a)-(b))<EPS)
typedef complex<double> P;
struct Rect{
double minx;
double miny;
double maxx;
double maxy;
};
int main(){
Rect r[2];
while(cin>>r[0].minx>>r[0].miny>>r[0].maxx>>r[0].maxy>>r[1].minx>>r[1].miny>>r[1].maxx>>r[1].maxy){
P a[4];
P b[4];
a[0]=P(r[0].minx,r[0].miny);
a[1]=P(r[0].minx,r[0].maxy);
a[2]=P(r[0].maxx,r[0].miny);
a[3]=P(r[0].maxx,r[0].maxy);
b[0]=P(r[1].minx,r[1].miny);
b[1]=P(r[1].minx,r[1].maxy);
b[2]=P(r[1].maxx,r[1].miny);
b[3]=P(r[1].maxx,r[1].maxy);
bool f=false;
for(int i = 0; i < 4; i++){
if(
(EQ(a[i].real(),r[1].minx)||a[i].real()>r[1].minx)
&&(EQ(a[i].real(),r[1].maxx)||a[i].real()<r[1].maxx)
&&(EQ(a[i].imag(),r[1].miny)||a[i].imag()>r[1].miny)
&&(EQ(a[i].imag(),r[1].maxy)||a[i].imag()<r[1].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f){
for(int i = 0; i < 4; i++){
if(
(EQ(b[i].real(),r[0].minx)||b[i].real()>r[0].minx)
&&(EQ(b[i].real(),r[0].maxx)||b[i].real()<r[0].maxx)
&&(EQ(b[i].imag(),r[0].miny)||b[i].imag()>r[0].miny)
&&(EQ(b[i].imag(),r[0].maxy)||b[i].imag()<r[0].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f)
cout<<"NO"<<endl;
}
}
return 0;
}
using namespace std;
#define EPS (1e-8)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<double> P;
struct Rect{
double minx;
double miny;
double maxx;
double maxy;
};
int main(){
Rect r[2];
while(cin>>r[0].minx>>r[0].miny>>r[0].maxx>>r[0].maxy>>r[1].minx>>r[1].miny>>r[1].maxx>>r[1].maxy){
P a[4];
P b[4];
a[0]=P(r[0].minx,r[0].miny);
a[1]=P(r[0].minx,r[0].maxy);
a[2]=P(r[0].maxx,r[0].miny);
a[3]=P(r[0].maxx,r[0].maxy);
b[0]=P(r[1].minx,r[1].miny);
b[1]=P(r[1].minx,r[1].maxy);
b[2]=P(r[1].maxx,r[1].miny);
b[3]=P(r[1].maxx,r[1].maxy);
bool f=false;
for(int i = 0; i < 4; i++){
if(
(EQ(a[i].real(),r[1].minx)||a[i].real()>r[1].minx)
&&(EQ(a[i].real(),r[1].maxx)||a[i].real()<r[1].maxx)
&&(EQ(a[i].imag(),r[1].miny)||a[i].imag()>r[1].miny)
&&(EQ(a[i].imag(),r[1].maxy)||a[i].imag()<r[1].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f){
for(int i = 0; i < 4; i++){
if(
(EQ(b[i].real(),r[0].minx)||b[i].real()>r[0].minx)
&&(EQ(b[i].real(),r[0].maxx)||b[i].real()<r[0].maxx)
&&(EQ(b[i].imag(),r[0].miny)||b[i].imag()>r[0].miny)
&&(EQ(b[i].imag(),r[0].maxy)||b[i].imag()<r[0].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f)
cout<<"NO"<<endl;
}
}
return 0;
}
|
a.cc:75:9: warning: "EQ" redefined
75 | #define EQ(a,b) (abs(a-b)<EPS)
| ^~
a.cc:14:9: note: this is the location of the previous definition
14 | #define EQ(a,b) (abs((a)-(b))<EPS)
| ^~
a.cc:79:8: error: redefinition of 'struct Rect'
79 | struct Rect{
| ^~~~
a.cc:18:8: note: previous definition of 'struct Rect'
18 | struct Rect{
| ^~~~
a.cc:86:5: error: redefinition of 'int main()'
86 | int main(){
| ^~~~
a.cc:25:5: note: 'int main()' previously defined here
25 | int main(){
| ^~~~
|
s036209281
|
p00059
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
#include <cmath>
using namespace std;
#define EPS (1e-8)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<double> P;
struct Rect{
double minx;
double miny;
double maxx;
double maxy;
};
int main(){
Rect r[2];
while(cin>>r[0].minx>>r[0].miny>>r[0].maxx>>r[0].maxy>>r[1].minx>>r[1].miny>>r[1].maxx>>r[1].maxy){
P a[4];
P b[4];
a[0]=P(r[0].minx,r[0].miny);
a[1]=P(r[0].minx,r[0].maxy);
a[2]=P(r[0].maxx,r[0].miny);
a[3]=P(r[0].maxx,r[0].maxy);
b[0]=P(r[1].minx,r[1].miny);
b[1]=P(r[1].minx,r[1].maxy);
b[2]=P(r[1].maxx,r[1].miny);
b[3]=P(r[1].maxx,r[1].maxy);
bool f=false;
for(int i = 0; i < 4; i++){
if(
(EQ(a[i].real(),r[1].minx)||a[i].real()>r[1].minx)
&&(EQ(a[i].real(),r[1].maxx)||a[i].real()<r[1].maxx)
&&(EQ(a[i].imag(),r[1].miny)||a[i].imag()>r[1].miny)
&&(EQ(a[i].imag(),r[1].maxy)||a[i].imag()<r[1].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f){
for(int i = 0; i < 4; i++){
if(
(EQ(b[i].real(),r[0].minx)||b[i].real()>r[0].minx)
&&(EQ(b[i].real(),r[0].maxx)||b[i].real()<r[0].maxx)
&&(EQ(b[i].imag(),r[0].miny)||b[i].imag()>r[0].miny)
&&(EQ(b[i].imag(),r[0].maxy)||b[i].imag()<r[0].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f)
cout<<"NO"<<endl;
}
}
return 0;
}
using namespace std;
#define EPS (1e-8)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<double> P;
struct Rect{
double minx;
double miny;
double maxx;
double maxy;
};
int main(){
Rect r[2];
while(cin>>r[0].minx>>r[0].miny>>r[0].maxx>>r[0].maxy>>r[1].minx>>r[1].miny>>r[1].maxx>>r[1].maxy){
P a[4];
P b[4];
a[0]=P(r[0].minx,r[0].miny);
a[1]=P(r[0].minx,r[0].maxy);
a[2]=P(r[0].maxx,r[0].miny);
a[3]=P(r[0].maxx,r[0].maxy);
b[0]=P(r[1].minx,r[1].miny);
b[1]=P(r[1].minx,r[1].maxy);
b[2]=P(r[1].maxx,r[1].miny);
b[3]=P(r[1].maxx,r[1].maxy);
bool f=false;
for(int i = 0; i < 4; i++){
if(
(EQ(a[i].real(),r[1].minx)||a[i].real()>r[1].minx)
&&(EQ(a[i].real(),r[1].maxx)||a[i].real()<r[1].maxx)
&&(EQ(a[i].imag(),r[1].miny)||a[i].imag()>r[1].miny)
&&(EQ(a[i].imag(),r[1].maxy)||a[i].imag()<r[1].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f){
for(int i = 0; i < 4; i++){
if(
(EQ(b[i].real(),r[0].minx)||b[i].real()>r[0].minx)
&&(EQ(b[i].real(),r[0].maxx)||b[i].real()<r[0].maxx)
&&(EQ(b[i].imag(),r[0].miny)||b[i].imag()>r[0].miny)
&&(EQ(b[i].imag(),r[0].maxy)||b[i].imag()<r[0].maxy)
){
cout<<"YES"<<endl;
f=true;
break;
}
}
if(!f)
cout<<"NO"<<endl;
}
}
return 0;
}
|
a.cc:79:8: error: redefinition of 'struct Rect'
79 | struct Rect{
| ^~~~
a.cc:18:8: note: previous definition of 'struct Rect'
18 | struct Rect{
| ^~~~
a.cc:86:5: error: redefinition of 'int main()'
86 | int main(){
| ^~~~
a.cc:25:5: note: 'int main()' previously defined here
25 | int main(){
| ^~~~
|
s841062152
|
p00059
|
C++
|
include<iostream>
using namespace std;
int main(void){
double xa[3],ya[3],xb[3],yb[3];
while(true){
for(int i=1;i<3;i++)
if(scanf("%lf %lf",&xa[i],&ya[i])==EOF)return 0;
for(int i=1;i<3;i++)
scanf("%lf %lf",&xb[i],&yb[i]);
if((((xb[1]<=xa[1]&&xa[1]<=xb[2])||(xb[1]<=xa[2]&&xa[2]<=xb[2]))&&
((yb[1]<=ya[1]&&ya[1]<=yb[2])||(yb[1]<=ya[2]&&ya[2]<=yb[2])))||
(((xa[1]<=xb[1]&&xb[1]<=xa[2])||(xa[1]<=xb[2]&&xb[2]<=xa[2]))&&
((ya[1]<=yb[1]&&yb[1]<=ya[2])||(ya[1]<=yb[2]&&yb[2]<=ya[2]))))
cout << "YES" << endl;
else cout << "NO" << endl;
}
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:10:10: error: 'scanf' was not declared in this scope
10 | if(scanf("%lf %lf",&xa[i],&ya[i])==EOF)return 0;
| ^~~~~
a.cc:10:42: error: 'EOF' was not declared in this scope
10 | if(scanf("%lf %lf",&xa[i],&ya[i])==EOF)return 0;
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include<iostream>
a.cc:13:7: error: 'scanf' was not declared in this scope
13 | scanf("%lf %lf",&xb[i],&yb[i]);
| ^~~~~
a.cc:19:7: error: 'cout' was not declared in this scope
19 | cout << "YES" << endl;
| ^~~~
a.cc:19:24: error: 'endl' was not declared in this scope
19 | cout << "YES" << endl;
| ^~~~
a.cc:20:10: error: 'cout' was not declared in this scope
20 | else cout << "NO" << endl;
| ^~~~
a.cc:20:26: error: 'endl' was not declared in this scope
20 | else cout << "NO" << endl;
| ^~~~
|
s807475125
|
p00059
|
C++
|
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#ifdef _DEBUG
#define typeof(X) std::identity<decltype(X)>::type //C++0x (for vs2010)
#else
#define typeof(X) __typeof__(X) // for gcc
#endif
using namespace std;
static const double EPS = 1e-6;
typedef long long ll;
const int MODULO = 1000000007;
const int INF = 100000000; //1e8
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef complex<double> Cd;
double _x1,_x2,_x3,_x4,__y1,__y2,__y3,__y4;
bool solve()
{
if(_x2 < _x3 || _x4 < _x1){
return false;
} else if(__y2 < __y3 || __y4 < __y1){
return false;
}
return true;
}
int main(){
while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
cout << (solve() ? "YES" : "NO") << endl;
}
return 0;
}
|
a.cc:44:24: error: 'double __y1' redeclared as different kind of entity
44 | double _x1,_x2,_x3,_x4,__y1,__y2,__y3,__y4;
| ^~~~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cstdio:41,
from a.cc:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double __y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'bool solve()':
a.cc:50:39: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator<'
50 | } else if(__y2 < __y3 || __y4 < __y1){
| ~~~~ ^ ~~~~
| | |
| double double(double) noexcept
a.cc: In function 'int main()':
a.cc:58:23: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ~~~~~~~~^~~~~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:13:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(short int)__y1' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(short unsigned int)__y1' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(int)__y1' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(unsigned int)__y1' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(long int)__y1' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(long unsigned int)__y1' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(long long int)__y1' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(long long unsigned int)__y1' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
58 | while(cin>>_x1>>__y1>>_x2>>__y2>>_x3>>__y3>>_x4>>__y4){
| ^~~~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(void*)__y1' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
58 |
|
s880871609
|
p00059
|
C++
|
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#ifdef _DEBUG
#define typeof(X) std::identity<decltype(X)>::type //C++0x (for vs2010)
#else
#define typeof(X) __typeof__(X) // for gcc
#endif
using namespace std;
static const double EPS = 1e-6;
typedef long long ll;
const int MODULO = 1000000007;
const int INF = 100000000; //1e8
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef complex<double> Cd;
double _x1,_x2,_x3,_x4,y1,y2,y3,y4;
bool solve()
{
if(_x2 < _x3 || _x4 < _x1){
return false;
} else if(y2 < y3 || y4 < y1){
return false;
}
return true;
}
int main(){
while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
cout << (solve() ? "YES" : "NO") << endl;
}
return 0;
}
|
a.cc:44:24: error: 'double y1' redeclared as different kind of entity
44 | double _x1,_x2,_x3,_x4,y1,y2,y3,y4;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cstdio:41,
from a.cc:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'bool solve()':
a.cc:50:33: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator<'
50 | } else if(y2 < y3 || y4 < y1){
| ~~ ^ ~~
| | |
| | double(double) noexcept
| double
a.cc: In function 'int main()':
a.cc:58:23: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ~~~~~~~~^~~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:13:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(short int)y1' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(short unsigned int)y1' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(int)y1' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(unsigned int)y1' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(long int)y1' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(long unsigned int)y1' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(long long int)y1' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(long long unsigned int)y1' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
| double (*)(double) noexcept
a.cc:58:25: error: cannot bind rvalue '(void*)y1' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:58:25: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
58 | while(cin>>_x1>>y1>>_x2>>y2>>_x3>>y3>>_x4>>y4){
| ^~
| |
|
|
s130494469
|
p00059
|
C++
|
void toRectangle(P p1, P p2, Rectangle &r){
r.ps[0] = {p1.x, p2.y};
r.ps[1] = p2;
r.ps[2] = p1;
r.ps[3] = {p2.x, p1.y};
}
const double EPS = 1e-8;
double abs(double d){
return (d>0)?d:-d;
}
// r1の各4点がr2の中にいくつあるか
int intersectionOfPoints(Rectangle r1, Rectangle r2){
double ub_x = r2.ps[1].x, lb_x = r2.ps[0].x,
ub_y = r2.ps[0].y, lb_y = r2.ps[2].y;
int res = 0;
for(int i=0;i<4;i++){
P p = r1.ps[i];
if((abs(p.x-lb_x) < EPS || (lb_x < p.x && p.x < ub_x) || abs(p.x-ub_x) < EPS) &&
(abs(p.y-lb_y) < EPS || (lb_y < p.y && p.y < ub_y) || abs(p.y-ub_x) < EPS)){
res++;
}
}
return res;
}
bool intersectionOfRectangles(Rectangle r1, Rectangle r2){
int ior1 = intersectionOfPoints(r1, r2),
ior2 = intersectionOfPoints(r2, r1);
if(ior1 > 0 || ior2 > 0){
return true;
}
return false;
}
int main(){
P ps[4];
Rectangle r[2];
while(std::cin >> ps[0].x >> ps[0].y >> ps[1].x >> ps[1].y >> ps[2].x >> ps[2].y >> ps[3].x >> ps[3].y, !std::cin.eof()){
toRectangle(ps[0], ps[1], r[0]);
toRectangle(ps[2], ps[3], r[1]);
if(intersectionOfRectangles(r[0], r[1])){
std::cout << "YES" << std::endl;
}else{
std::cout << "NO" << std::endl;
}
}
}
|
a.cc:1:6: error: variable or field 'toRectangle' declared void
1 | void toRectangle(P p1, P p2, Rectangle &r){
| ^~~~~~~~~~~
a.cc:1:18: error: 'P' was not declared in this scope
1 | void toRectangle(P p1, P p2, Rectangle &r){
| ^
a.cc:1:24: error: 'P' was not declared in this scope
1 | void toRectangle(P p1, P p2, Rectangle &r){
| ^
a.cc:1:30: error: 'Rectangle' was not declared in this scope
1 | void toRectangle(P p1, P p2, Rectangle &r){
| ^~~~~~~~~
a.cc:1:41: error: 'r' was not declared in this scope
1 | void toRectangle(P p1, P p2, Rectangle &r){
| ^
a.cc:15:26: error: 'Rectangle' was not declared in this scope
15 | int intersectionOfPoints(Rectangle r1, Rectangle r2){
| ^~~~~~~~~
a.cc:15:40: error: 'Rectangle' was not declared in this scope
15 | int intersectionOfPoints(Rectangle r1, Rectangle r2){
| ^~~~~~~~~
a.cc:15:52: error: expression list treated as compound expression in initializer [-fpermissive]
15 | int intersectionOfPoints(Rectangle r1, Rectangle r2){
| ^
a.cc:31:31: error: 'Rectangle' was not declared in this scope
31 | bool intersectionOfRectangles(Rectangle r1, Rectangle r2){
| ^~~~~~~~~
a.cc:31:45: error: 'Rectangle' was not declared in this scope
31 | bool intersectionOfRectangles(Rectangle r1, Rectangle r2){
| ^~~~~~~~~
a.cc:31:57: error: expression list treated as compound expression in initializer [-fpermissive]
31 | bool intersectionOfRectangles(Rectangle r1, Rectangle r2){
| ^
a.cc: In function 'int main()':
a.cc:41:9: error: 'P' was not declared in this scope
41 | P ps[4];
| ^
a.cc:42:9: error: 'Rectangle' was not declared in this scope
42 | Rectangle r[2];
| ^~~~~~~~~
a.cc:43:20: error: 'cin' is not a member of 'std'
43 | while(std::cin >> ps[0].x >> ps[0].y >> ps[1].x >> ps[1].y >> ps[2].x >> ps[2].y >> ps[3].x >> ps[3].y, !std::cin.eof()){
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | void toRectangle(P p1, P p2, Rectangle &r){
a.cc:43:27: error: 'ps' was not declared in this scope
43 | while(std::cin >> ps[0].x >> ps[0].y >> ps[1].x >> ps[1].y >> ps[2].x >> ps[2].y >> ps[3].x >> ps[3].y, !std::cin.eof()){
| ^~
a.cc:43:119: error: 'cin' is not a member of 'std'
43 | while(std::cin >> ps[0].x >> ps[0].y >> ps[1].x >> ps[1].y >> ps[2].x >> ps[2].y >> ps[3].x >> ps[3].y, !std::cin.eof()){
| ^~~
a.cc:43:119: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:43: error: 'r' was not declared in this scope
44 | toRectangle(ps[0], ps[1], r[0]);
| ^
a.cc:44:17: error: 'toRectangle' was not declared in this scope
44 | toRectangle(ps[0], ps[1], r[0]);
| ^~~~~~~~~~~
a.cc:47:55: error: 'intersectionOfRectangles' cannot be used as a function
47 | if(intersectionOfRectangles(r[0], r[1])){
| ^
a.cc:48:30: error: 'cout' is not a member of 'std'
48 | std::cout << "YES" << std::endl;
| ^~~~
a.cc:48:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:48:52: error: 'endl' is not a member of 'std'
48 | std::cout << "YES" << std::endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | void toRectangle(P p1, P p2, Rectangle &r){
a.cc:50:30: error: 'cout' is not a member of 'std'
50 | std::cout << "NO" << std::endl;
| ^~~~
a.cc:50:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:50:51: error: 'endl' is not a member of 'std'
50 | std::cout << "NO" << std::endl;
| ^~~~
a.cc:50:51: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s875139222
|
p00059
|
C++
|
#include <iostream>
using namespace std;
int main(){
double xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
while( cin >>xa1>>ya1>>xa2>>ya2>>xb1>>yb1>>xb2>>yb2d ){
if(!(xb2 < xa1 || xa2 < xb1 || ya1 > yb2 || ya2 < yb1 ))cout << "YES"<<endl;
else cout << "NO" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:51: error: 'yb2d' was not declared in this scope; did you mean 'yb2'?
5 | while( cin >>xa1>>ya1>>xa2>>ya2>>xb1>>yb1>>xb2>>yb2d ){
| ^~~~
| yb2
|
s897660095
|
p00059
|
C++
|
#include <cstdio>
#include <vector>
#include <utility>
#include <complex>
using namespace std;
typedef std::pair<float, float> P;
float f[10];
namespace layer0 {
struct Bound {
float mnX, mnY, mxX, mxY;
};
Bound createLhsBound() {
const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
return (Bound){mnX, mnY, mxX, mxY};
}
Bound createRhsBound() {
const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
struct Bound {
float mnX, mnY, mxX, mxY;
};
Bound createLhsBound() {
const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
return (Bound){mnX, mnY, mxX, mxY};
}
Bound createRhsBound() {
const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
return (Bound){mnX, mnY, mxX, mxY};
}
const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
return (Bound){mnX, mnY, mxX, mxY};
}
Bound createRhsBound() {
const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
return (Bound){mnX, mnY, mxX, mxY};
}
vector<P> create(float mnX, float mnY, float mxX, float mxY) {
vector<P> v;
const float lx[2] = {mnX, mxX};
const float ly[2] = {mnY, mxY};
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
v.push_back(P(lx[i], ly[j]));
return v;
}
vector<P> createLhs() {
const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
return create(mnX, mnY, mxX, mxY);
}
vector<P> createRhs() {
const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
return create(mnX, mnY, mxX, mxY);
}
bool isLess(float l, float r) {
if ((l - (1e-11)) < r)
return true;
return false;
}
int check() {
Bound lhsBound = createLhsBound(), rhsBound = createRhsBound();
vector<P> lhs = createLhs(), rhs = createRhs();
for (int i = 0; i < 4; ++i) {
P cur = lhs[i];
if (isLess(rhsBound.mnX, cur.first) &&
isLess(cur.first, rhsBound.mxX) &&
isLess(rhsBound.mnY, cur.second) &&
isLess(cur.second, rhsBound.mxY))
return 1;
}
for (int i = 0; i < 4; ++i) {
P cur = rhs[i];
if (isLess(lhsBound.mnX, cur.first) &&
isLess(cur.first, lhsBound.mxX) &&
isLess(lhsBound.mnY, cur.second) &&
isLess(cur.second, lhsBound.mxY))
return 1;
}
return 0;
}
}; // namespace layer0
typedef complex<float> C;
typedef pair<C,C> PC;
namespace layer1 {
vector<PC> make(float mnX, float mnY, float mxX, float mxY) {
vector<PC> v;
const C LeftUp(mnX, mxY);
const C RightUp(mxX, mxY);
const C LeftDown(mnX, mnY);
const C RightDown(mxX, mnY);
// up
v.push_back(PC(LeftUp, RightUp));
// right
v.push_back(PC(RightUp, RightDown));
// down
v.push_back(PC(LeftDown, RightDown));
// left
v.push_back(PC(LeftUp, LeftDown));
return v;
}
vector<PC> makeLhs() {
const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
return make(mnX, mnY, mxX, mxY);
}
vector<PC> makeRhs() {
const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
return make(mnX, mnY, mxX, mxY);
}
float cross(C l, C r) {
return l.real() * r.imag() - l.imag() * r.real();
}
int isIntersection(PC l, PC r) {
C lb = l.first, le = l.second;
C rb = r.first, re = r.second;
return
(cross(le - lb, rb - lb) * cross(le - lb, re - lb) < 1e-10) &&
(cross(re - rb, lb - rb) * cross(re - rb, le - rb) < 1e-10);
}
int check() {
vector<PC> lhs = makeLhs(), rhs = makeRhs();
for (size_t i = 0; i < lhs.size(); ++i)
for (size_t j = 0; j < rhs.size(); ++j)
if (isIntersection(lhs[i], rhs[j]))
return 1;
return 0;
}
}; // namespace layer1
int solve() {
return layer0::check() | layer1::check();
}
int main() {
// printf("%d\n", layer1::isIntersection(PC(C(0, 0), C(3, 0)), PC(C(1, 1), C(1, 2))));
// return 0;
float check;
while (scanf("%f", &check) != -1) {
f[0] = check;
for (int i = 1; i < 8; ++i)
scanf("%f", f + i);
printf("%s\n", solve() ? "YES" : "NO");
}
return 0;
}
|
a.cc: In function 'layer0::Bound layer0::createRhsBound()':
a.cc:29:21: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
29 | Bound createLhsBound() {
| ^~
a.cc:29:21: note: remove parentheses to default-initialize a variable
29 | Bound createLhsBound() {
| ^~
| --
a.cc:29:21: note: or replace parentheses with braces to aggregate-initialize a variable
a.cc:29:24: error: a function-definition is not allowed here before '{' token
29 | Bound createLhsBound() {
| ^
a.cc:34:21: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
34 | Bound createRhsBound() {
| ^~
a.cc:34:21: note: remove parentheses to default-initialize a variable
34 | Bound createRhsBound() {
| ^~
| --
a.cc:34:21: note: or replace parentheses with braces to aggregate-initialize a variable
a.cc:34:24: error: a function-definition is not allowed here before '{' token
34 | Bound createRhsBound() {
| ^
a.cc:39:15: error: redeclaration of 'const float mnX'
39 | const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
| ^~~
a.cc:23:15: note: 'const float mnX' previously declared here
23 | const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
| ^~~
a.cc:39:27: error: redeclaration of 'const float mnY'
39 | const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
| ^~~
a.cc:23:27: note: 'const float mnY' previously declared here
23 | const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
| ^~~
a.cc:39:39: error: redeclaration of 'const float mxX'
39 | const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
| ^~~
a.cc:23:39: note: 'const float mxX' previously declared here
23 | const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
| ^~~
a.cc:39:51: error: redeclaration of 'const float mxY'
39 | const float mnX = f[0], mnY = f[1], mxX = f[2], mxY = f[3];
| ^~~
a.cc:23:51: note: 'const float mxY' previously declared here
23 | const float mnX = f[4], mnY = f[5], mxX = f[6], mxY = f[7];
| ^~~
a.cc:40:17: error: could not convert 'layer0::createRhsBound()::Bound{((float)mnX), ((float)mnY), ((float)mxX), ((float)mxY)}' from 'layer0::createRhsBound()::Bound' to 'layer0::Bound'
40 | return (Bound){mnX, mnY, mxX, mxY};
| ^~~~~~~~~~~~~~~~~~~~
| |
| layer0::createRhsBound()::Bound
a.cc: At global scope:
a.cc:43:7: error: redefinition of 'layer0::Bound layer0::createRhsBound()'
43 | Bound createRhsBound() {
| ^~~~~~~~~~~~~~
a.cc:22:7: note: 'layer0::Bound layer0::createRhsBound()' previously defined here
22 | Bound createRhsBound() {
| ^~~~~~~~~~~~~~
|
s343215710
|
p00060
|
Java
|
import java.io.*;
public class V0060{
public static void main (String[] args) throws java.lang.Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(true){
String s=br.readLine();
String[] str = s.split(" ");
int c1=Integer.parseInt(str[0]);
int c2=Integer.parseInt(str[1]);
int c3=Integer.parseInt(str[2]);
if((55-c1-c2-c3)/7+c1+c2>20){
System.out.println("NO");
}
else
System.out.println("YES");
}
}
}
|
Main.java:4: error: class V0060 is public, should be declared in a file named V0060.java
public class V0060{
^
1 error
|
s222395365
|
p00060
|
Java
|
import java.util.Arrays;
import java.util.Scanner;
public class Main{
Scanner sc;
void solve(){
sc = new Scanner(System.in);
while(sc.hasNext()){
boolean list = new boolean[11];
Arrays.fill(list, true);
int sum = 0;
for(int i=0; i<3; ++i){
int v = ni();
if(i+1 < 3){
sum += v;
}
list[v] = false;
}
int n=0;
for(int i=1; i<=10; ++i){
if(list[i] && sum+i<=20){
++n;
}
}
System.out.println(3<n ? "YES" : "NO");
}
sc.close();
}
int ni(){
return sc.nextInt();
}
public static void main(String[] args){
new Main().solve();
}
void debug(Object... os){
System.err.println(Arrays.deepToString(os));
}
}
|
Main.java:12: error: incompatible types: boolean[] cannot be converted to boolean
boolean list = new boolean[11];
^
Main.java:13: error: no suitable method found for fill(boolean,boolean)
Arrays.fill(list, true);
^
method Arrays.fill(long[],long) is not applicable
(argument mismatch; boolean cannot be converted to long[])
method Arrays.fill(int[],int) is not applicable
(argument mismatch; boolean cannot be converted to int[])
method Arrays.fill(short[],short) is not applicable
(argument mismatch; boolean cannot be converted to short[])
method Arrays.fill(char[],char) is not applicable
(argument mismatch; boolean cannot be converted to char[])
method Arrays.fill(byte[],byte) is not applicable
(argument mismatch; boolean cannot be converted to byte[])
method Arrays.fill(boolean[],boolean) is not applicable
(argument mismatch; boolean cannot be converted to boolean[])
method Arrays.fill(double[],double) is not applicable
(argument mismatch; boolean cannot be converted to double[])
method Arrays.fill(float[],float) is not applicable
(argument mismatch; boolean cannot be converted to float[])
method Arrays.fill(Object[],Object) is not applicable
(argument mismatch; boolean cannot be converted to Object[])
Main.java:21: error: array required, but boolean found
list[v] = false;
^
Main.java:26: error: array required, but boolean found
if(list[i] && sum+i<=20){
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
|
s903899439
|
p00060
|
C
|
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
int a,b,c;
while(scanf("%d %d %d",&a,&b,&c)!=EOF){
int sum=a+b,cnt=0;
for(int i=1;i<=10;i++){
if(sum + i<=20 && i!=a && i!=b && i!=c) cnt++;
}
printf("%s\n",cnt>=4?"YES":"NO");
}
}
|
main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s693922429
|
p00060
|
C++
|
import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.NoSuchElementException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
FastScanner sc = new FastScanner();
PrintWriter out = new PrintWriter(System.out);
while(sc.hasNext()) {
boolean[] list = new boolean[10];
int c1 = (int)sc.nextLong();
int c2 = (int)sc.nextLong();
int c3 = (int)sc.nextLong();
list[c1-1] = true;
list[c2-1] = true;
list[c3-1] = true;
int sum = 0;
int g = 0;
for(int i = 0; i < 10; i++) {
if(!list[i]) {
if(c1 + c2 + i+1 <= 20) {
g++;
}
sum++;
}
}
if((double)g/sum >= 0.5) {
out.println("YES");
}
else {
out.println("NO");
}
}
out.flush();
}
}
//------------------------------//
//-----------//
class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
}else{
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
public boolean hasNext() { skipUnprintable(); return hasNextByte();}
public String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while(isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while(true){
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
}else if(b == -1 || !isPrintableChar(b)){
return minus ? -n : n;
}else{
throw new NumberFormatException();
}
b = readByte();
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.ArrayDeque;
| ^~~~~~
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.util.ArrayList;
| ^~~~~~
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.Arrays;
| ^~~~~~
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.Collections;
| ^~~~~~
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.NoSuchElementException;
| ^~~~~~
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.Scanner;
| ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: expected unqualified-id before 'public'
9 | public class Main {
| ^~~~~~
a.cc:48:12: error: expected ':' before 'final'
48 | private final InputStream in = System.in;
| ^~~~~~
| :
a.cc:48:13: error: 'final' does not name a type
48 | private final InputStream in = System.in;
| ^~~~~
a.cc:49:12: error: expected ':' before 'final'
49 | private final byte[] buffer = new byte[1024];
| ^~~~~~
| :
a.cc:49:13: error: 'final' does not name a type
49 | private final byte[] buffer = new byte[1024];
| ^~~~~
a.cc:50:12: error: expected ':' before 'int'
50 | private int ptr = 0;
| ^~~~
| :
a.cc:51:12: error: expected ':' before 'int'
51 | private int buflen = 0;
| ^~~~
| :
a.cc:52:12: error: expected ':' before 'boolean'
52 | private boolean hasNextByte() {
| ^~~~~~~~
| :
a.cc:52:13: error: 'boolean' does not name a type; did you mean 'bool'?
52 | private boolean hasNextByte() {
| ^~~~~~~
| bool
a.cc:68:12: error: expected ':' before 'int'
68 | private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
| ^~~~
| :
a.cc:69:12: error: expected ':' before 'static'
69 | private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
| ^~~~~~~
| :
a.cc:69:20: error: 'boolean' does not name a type; did you mean 'bool'?
69 | private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
| ^~~~~~~
| bool
a.cc:70:12: error: expected ':' before 'void'
70 | private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
| ^~~~~
| :
a.cc:71:11: error: expected ':' before 'boolean'
71 | public boolean hasNext() { skipUnprintable(); return hasNextByte();}
| ^~~~~~~~
| :
a.cc:71:12: error: 'boolean' does not name a type; did you mean 'bool'?
71 | public boolean hasNext() { skipUnprintable(); return hasNextByte();}
| ^~~~~~~
| bool
a.cc:72:11: error: expected ':' before 'String'
72 | public String next() {
| ^~~~~~~
| :
a.cc:72:12: error: 'String' does not name a type
72 | public String next() {
| ^~~~~~
a.cc:82:11: error: expected ':' before 'long'
82 | public long nextLong() {
| ^~~~~
| :
a.cc:106:2: error: expected ';' after class definition
106 | }
| ^
| ;
a.cc: In member function 'int FastScanner::readByte()':
a.cc:68:34: error: 'hasNextByte' was not declared in this scope
68 | private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
| ^~~~~~~~~~~
a.cc:68:56: error: 'buffer' was not declared in this scope; did you mean 'buflen'?
68 | private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
| ^~~~~~
| buflen
a.cc: In member function 'void FastScanner::skipUnprintable()':
a.cc:70:44: error: 'hasNextByte' was not declared in this scope
70 | private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
| ^~~~~~~~~~~
a.cc:70:78: error: 'buffer' was not declared in this scope; did you mean 'buflen'?
70 | private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
| ^~~~~~
| buflen
a.cc:70:62: error: 'isPrintableChar' was not declared in this scope
70 | private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
| ^~~~~~~~~~~~~~~
a.cc: In member function 'long int FastScanner::nextLong()':
a.cc:83:14: error: 'hasNext' was not declared in this scope
83 | if (!hasNext()) throw new NoSuchElementException();
| ^~~~~~~
a.cc:83:35: error: expected type-specifier before 'NoSuchElementException'
83 | if (!hasNext()) throw new NoSuchElementException();
| ^~~~~~~~~~~~~~~~~~~~~~
a.cc:85:9: error: 'boolean' was not declared in this scope; did you mean 'bool'?
85 | boolean minus = false;
| ^~~~~~~
| bool
a.cc:88:13: error: 'minus' was not declared in this scope
88 | minus = true;
| ^~~~~
a.cc:92:23: error: expected type-specifier before 'NumberFormatException'
92 | throw new NumberFormatException();
| ^~~~~~~~~~~~~~~~~~~~~
a.cc:98:34: error: 'isPrintableChar' was not declared in this scope
98 | }else if(b == -1 || !isPrintableChar(b)){
| ^~~~~~~~~~~~~~~
a.cc:99:24: error: 'minus' was not declared in this scope
99 | return minus ? -n : n;
| ^~~~~
a.cc:101:27: error: expected type-specifier before 'NumberFormatException'
101 | throw new NumberFormatException();
| ^~~~~~~~~~~~~~~~~~~~~
|
s876365930
|
p00060
|
C++
|
#include<stdio.h>
int main(){
int x,y,z;
int S=0,W=0;
while(scanf("%d %d %d",&x,%y,&z)!=0)){
for(int i=1;i<11;i++)
{
if(i!=z&&x+y+i>20)W++;
else if(i!=z&&x+y+i<=20)S++;
}
if(S>=4)printf("Yes\n");
else if(S<4)printf("No\n");
S=0,W=0;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:27: error: expected primary-expression before '%' token
7 | while(scanf("%d %d %d",&x,%y,&z)!=0)){
| ^
a.cc:7:37: error: expected primary-expression before ')' token
7 | while(scanf("%d %d %d",&x,%y,&z)!=0)){
| ^
|
s984673096
|
p00060
|
C++
|
#include<stdio.h>
int main(){
int x,y,z;
int c=0;
bool f[12];
while(scanf("%d %d %d",&x,&y,&z)!=EOF){
for(int i=0;i<11;i++)
f[i]=true;
f[x]=false;f[y]=false;f[z]=false;
for(int i=i;i<11;i++)
{if(f[i]==true){if(x+y+i<=20)c++}}
if(c>=4)printf("YES\n");
printf("NO\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:33: error: expected ';' before '}' token
16 | {if(f[i]==true){if(x+y+i<=20)c++}}
| ^
| ;
|
s830806568
|
p00060
|
C++
|
#include<stdio.h>
int main(){
int x,y,z;
int c=0;
bool f[12];
while(scanf("%d %d %d",&x,&y,&z)!=EOF){
for(int i=0;i<11;i++)
f[i]=true;
f[x]=false;f[y]=false;f[z]=false;
for(int i=i;i<11;i++)
{if(f[i]==true){if(x+y+i<=20)c++}}
if(c>=4)printf("YES\n");
c=0;
printf("NO\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:33: error: expected ';' before '}' token
16 | {if(f[i]==true){if(x+y+i<=20)c++}}
| ^
| ;
|
s568437159
|
p00060
|
C++
|
#include<iostream>
using namespace std;
int main(){
int c[3];
while(cin>>c[0]){
for(int i=1;i<3;i++)
cin>>c[i];
int s=0;
double p=0;
for(int i=0;i<=10;i++){
if(i!=c[0]||i!=c[1]||i!=c[2]){
if(i+c[1]+c[2]<=20)
s++;
}
if(f!=0)
p=s*100/7;
else
p=100;
cout<<p<<endl;
if(p>=50)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:17:20: error: 'f' was not declared in this scope
17 | if(f!=0)
| ^
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s143193624
|
p00060
|
C++
|
#include<iostream>
using namespace std;
int main(){
int c[3];
while(cin>>c[0]){
for(int i=1;i<3;i++)
cin>>c[i];
int s=0;
double p=0;
for(int i=0;i<=10;i++){
if(i!=c[0]||i!=c[1]||i!=c[2]){
if(i+c[1]+c[2]<=20)
s++;
}
p=s*100/7;
if(p>=50)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s147980062
|
p00060
|
C++
|
using System;
class aoj
{
static void Main()
{
while (true)
{
string a = Console.ReadLine();
if (String.IsNullOrEmpty(a)) break;
string[] b = a.Split(' ');
int c = int.Parse(b[0]), d = int.Parse(b[1]), e = int.Parse(b[2]),f=c+d,g=20-f;
int plus = 0, mainasu = 0; ;
for(int i = 1; i <= 10; i++)
{
if (i != c && i != d && i != e)
{
for(int j = 1; j <= 10; j++)
{
if(j != c && j != d && j != e && i != j)
{
if (f + j <= 20)
plus++;
else
mainasu++;
}
}
}
}
if (plus >= mainasu)
Console.WriteLine("YES");
else
Console.WriteLine("NO");
}
}
}
|
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System;
| ^~~~~~
a.cc:36:2: error: expected ';' after class definition
36 | }
| ^
| ;
a.cc: In static member function 'static void aoj::Main()':
a.cc:9:13: error: 'string' was not declared in this scope
9 | string a = Console.ReadLine();
| ^~~~~~
a.cc:10:17: error: 'String' was not declared in this scope
10 | if (String.IsNullOrEmpty(a)) break;
| ^~~~~~
a.cc:10:38: error: 'a' was not declared in this scope
10 | if (String.IsNullOrEmpty(a)) break;
| ^
a.cc:11:20: error: expected primary-expression before ']' token
11 | string[] b = a.Split(' ');
| ^
a.cc:12:21: error: expected primary-expression before 'int'
12 | int c = int.Parse(b[0]), d = int.Parse(b[1]), e = int.Parse(b[2]),f=c+d,g=20-f;
| ^~~
a.cc:16:36: error: 'd' was not declared in this scope
16 | if (i != c && i != d && i != e)
| ^
a.cc:16:46: error: 'e' was not declared in this scope
16 | if (i != c && i != d && i != e)
| ^
a.cc:22:33: error: 'f' was not declared in this scope
22 | if (f + j <= 20)
| ^
a.cc:31:17: error: 'Console' was not declared in this scope
31 | Console.WriteLine("YES");
| ^~~~~~~
a.cc:33:17: error: 'Console' was not declared in this scope
33 | Console.WriteLine("NO");
| ^~~~~~~
|
s797747724
|
p00060
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a,b,c;
while(cin>>a>>b>>c){
int k=0;
for(int i=1;i<11;i++){
if(i+a+b>=c&&i+<21)k++;
}
if(k>=5&&a>=c)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:8:22: error: expected primary-expression before '<' token
8 | if(i+a+b>=c&&i+<21)k++;
| ^
|
s046931424
|
p00060
|
C++
|
#include<cstdio>
#include<math>
using namespace std;
int main(void){
int C[3];
while(scanf("%d %d %d" ,&C[0], &C[1], &C[2]) != EOF){
int card[16]={0};
int my;
int out = 0;
for(int i = 0; i < 3; i++)card[C[i]] = 1;
my = C[0] + C[1];
for(int i = 1; i < 11; i++){
if(card[i] == 0 && my + i > 20){
out++;
}
}
// printf("%dÂ:%lf\n", out, 1-out/7.0);
if(my <= 10){
puts("YES");
}else if(out == 0){
puts("YES");
}else{
printf("%s\n", 1-out/7.0>=0.5?"YES":"NO");
}
}
return 0;
}
|
a.cc:2:9: fatal error: math: No such file or directory
2 | #include<math>
| ^~~~~~
compilation terminated.
|
s201954622
|
p00060
|
C++
|
g#include <iostream>
#include <vector>
#include <set>
using namespace std;
int main() {
int p, q, r;
while (cin >> p >> q >> r) {
set<int> possible;
for (int i = 1; i <= 10; i++) possible.insert(i);
possible.erase(p);
possible.erase(q);
possible.erase(r);
int under = 20 - p - q;
int count = 0;
for (set<int>::iterator i = possible.begin(); i != possible.end(); i++) {
if (*i <= under) count++;
}
if (count / 7.0 > 0.50) {
cout << "YES\n";
} else {
cout << "NO\n";
}
}
return 0;
}
|
a.cc:1:2: error: stray '#' in program
1 | g#include <iostream>
| ^
a.cc:1:1: error: 'g' does not name a type
1 | g#include <iostream>
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
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 |
|
s930727012
|
p00060
|
C++
|
#include<iostream>
using namespace std;
int main(){
int C[3],ans,a,b;
while(cin>>c[0]>>c[1]>>c[2]){
b=c[0]+c[1];
ans=0;
for(int i=1;i<11;i++){
if(i!=c[0]&&i!=c[1]&&i!=c[2]){
c=b;
c+=i;
if(c<=20)ans++;}}
if(ans>=4)cout<<"YES"<<endl;
else cout<<"NO"<<endl;}}
|
a.cc: In function 'int main()':
a.cc:6:12: error: 'c' was not declared in this scope
6 | while(cin>>c[0]>>c[1]>>c[2]){
| ^
|
s327972420
|
p00060
|
C++
|
#include <iostream>
#include <queue>
using namespace std;
int main(){
int c[3];
queue <int> ans;
while(cin>>c[0]){
if(c[0]==0){
break;
}
for(int i=1;i<3;i++){
cin>>c[i];
}
int data[10+1];
int sum;
for(int i=1;i<=10;i++){
data[i]=1;
}
for(int i=0;i<3;i++){
data[c[i]]=0;
}
sum=(c[0]+c[1]);
int p=0;
for(int i=1;i<=10;i++){
if(c[0]!=i && c[1] != i &&c[2] != i){
if(sum+data[i]<=20){
p++;
}
}
}
if(p>3){
cout<<"YES"<<endl:
}
else{
cout<<"NO"<<endl;
}
}
return 0;
}
/*
Sample Input
1 2 3
5 6 9
8 9 10
Output for the Sample Input
YES
YES
NO
*/
|
a.cc: In function 'int main()':
a.cc:36:42: error: expected ';' before ':' token
36 | cout<<"YES"<<endl:
| ^
| ;
|
s658056576
|
p00060
|
C++
|
#include <iostream>
#include <queue>
using namespace std;
int main(){
int c[3];
queue <int> ans;
while(cin>>c[0]){
if(c[0]==0){
break;
}
for(int i=1;i<3;i++){
cin>>c[i];
}
int data[10+1];
int sum;
for(int i=1;i<=10;i++){
data[i]=1;
}
for(int i=0;i<3;i++){
data[c[i]]=0;
}
sum=(c[0]+c[1]);
int p=0;
for(int i=1;i<=10;i++){
if(c[0]!=i && c[1] != i &&c[2] != i){
if(sum+data[i]<=20){
p++;
}
}
}
if(p>3){
cout<<"YES"<<endl:
}
else{
cout<<"NO"<<endl;
}
}
return 0;
}
/*
Sample Input
1 2 3
5 6 9
8 9 10
Output for the Sample Input
YES
YES
NO
*/
|
a.cc: In function 'int main()':
a.cc:36:42: error: expected ';' before ':' token
36 | cout<<"YES"<<endl:
| ^
| ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.