submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s099468321
|
p00010
|
C
|
#include<complex.h>
#include<stdio.h>
#define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
|
main.c: In function 'main':
main.c:4:120: error: 'std' undeclared (first use in this function)
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^~~
main.c:4:120: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:123: error: expected ';' before '::' token
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^~
| ;
main.c:4:161: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
2 | #include<stdio.h>
+++ |+#include <stdlib.h>
3 | #define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
main.c:4:165: error: 'b' undeclared (first use in this function)
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^
main.c:4:167: error: 'c' undeclared (first use in this function)
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^
main.c:4:178: error: 'a' undeclared (first use in this function)
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^
main.c:3:18: error: implicit declaration of function 'acos' [-Wimplicit-function-declaration]
3 | #define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
| ^~~~
main.c:4:194: note: in expansion of macro 'F'
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^
main.c:3:1: note: include '<math.h>' or provide a declaration of 'acos'
2 | #include<stdio.h>
+++ |+#include <math.h>
3 | #define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
main.c:3:18: warning: incompatible implicit declaration of built-in function 'acos' [-Wbuiltin-declaration-mismatch]
3 | #define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
| ^~~~
main.c:4:194: note: in expansion of macro 'F'
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^
main.c:3:18: note: include '<math.h>' or provide a declaration of 'acos'
3 | #define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
| ^~~~
main.c:4:194: note: in expansion of macro 'F'
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^
main.c:4:205: error: implicit declaration of function 'sin' [-Wimplicit-function-declaration]
4 | int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);}}
| ^~~
main.c:4:205: note: include '<math.h>' or provide a declaration of 'sin'
main.c:4:205: warning: incompatible implicit declaration of built-in function 'sin' [-Wbuiltin-declaration-mismatch]
main.c:4:205: note: include '<math.h>' or provide a declaration of 'sin'
|
s656839758
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int setcount;
float x1, y1, x2, y2, x3, y3;
float nx1, ny1, nx2, ny2;
float nr1, nr2;
float xp, yp, r;
int tx, ty, tr, rem;
int i;
scanf("%d", &setcount);
for(i=0; i<setcount; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
nx1=x2-x1; ny1=y2-y1;
nx2=x3-x1; ny2=y3-y1;
nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
nr1*=0.5f; nr2*=0.5f;
//normalize
ny1/=nx1; nr1/=nx1; nx1=1.0f;
//subtraction
ny2-=ny1*nx2; nr2-=nr1*nx2; nx2=0.0f;
//normalize
nr2/=ny2; ny2=1.0f;
//subtraction
nr1-=nr2*ny1; ny1=0.0f;
xp=nr1+x1; yp=nr2+y1;
r=(float)sqrt((double)(nr1^2+nr2^2));
tx=xp*10000; ty=yp*10000; tr=r*10000;
if((rem=tx%10)<5) tx-=rem;
else tx+=10-rem;
if((rem=ty%10)<5) ty-=rem;
else ty+=10-rem;
if((rem=tr%10)<5) tr-=rem;
else tr+=10-rem;
xp=(float)tx*0.0001f; yp=(float)ty*0.0001f; r=(float)tr*0.0001f;
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:19:29: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:32:31: error: invalid operands to binary ^ (have 'float' and 'float')
32 | r=(float)sqrt((double)(nr1^2+nr2^2));
| ^~~~~~
| |
| float
|
s743254380
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int setcount;
float x1, y1, x2, y2, x3, y3;
float nx1, ny1, nx2, ny2;
float nr1, nr2;
float xp, yp, r;
int tx, ty, tr, rem;
int i;
scanf("%d", &setcount);
for(i=0; i<setcount; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
nx1=x2-x1; ny1=y2-y1;
nx2=x3-x1; ny2=y3-y1;
nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
nr1*=0.5f; nr2*=0.5f;
//normalize
ny1/=nx1; nr1/=nx1; nx1=1.0f;
//subtraction
ny2-=ny1*nx2; nr2-=nr1*nx2; nx2=0.0f;
//normalize
nr2/=ny2; ny2=1.0f;
//subtraction
nr1-=nr2*ny1; ny1=0.0f;
xp=nr1+x1; yp=nr2+y1;
r=(float)sqrt((double)(nr1^2+nr2^2));
tx=xp*10000; ty=yp*10000; tr=r*10000;
if((rem=tx%10)<5) tx-=rem;
else tx+=10-rem;
if((rem=ty%10)<5) ty-=rem;
else ty+=10-rem;
if((rem=tr%10)<5) tr-=rem;
else tr+=10-rem;
xp=(float)tx*0.0001f; yp=(float)ty*0.0001f; r=(float)tr*0.0001f;
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:19:29: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:32:31: error: invalid operands to binary ^ (have 'float' and 'float')
32 | r=(float)sqrt((double)(nr1^2+nr2^2));
| ^~~~~~
| |
| float
|
s330786803
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int setcount;
float x1, y1, x2, y2, x3, y3;
float nx1, ny1, nx2, ny2;
float nr1, nr2;
float xp, yp, r;
int tx, ty, tr, rem;
int i;
scanf("%d", &setcount);
for(i=0; i<setcount; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
nx1=x2-x1; ny1=y2-y1;
nx2=x3-x1; ny2=y3-y1;
nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
nr1*=0.5f; nr2*=0.5f;
//normalize
ny1/=nx1; nr1/=nx1; nx1=1.0f;
//subtraction
ny2-=ny1*nx2; nr2-=nr1*nx2; nx2=0.0f;
//normalize
nr2/=ny2; ny2=1.0f;
//subtraction
nr1-=nr2*ny1; ny1=0.0f;
xp=nr1+x1; yp=nr2+y1;
//r=(float)sqrt((double)(nr1^2+nr2^2));
tx=xp*10000; ty=yp*10000; tr=r*10000;
if((rem=tx%10)<5) tx-=rem;
else tx+=10-rem;
if((rem=ty%10)<5) ty-=rem;
else ty+=10-rem;
if((rem=tr%10)<5) tr-=rem;
else tr+=10-rem;
xp=(float)tx*0.0001f; yp=(float)ty*0.0001f; r=(float)tr*0.0001f;
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:19:29: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
|
s921532878
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int setcount;
float x1, y1, x2, y2, x3, y3;
float nx1, ny1, nx2, ny2;
float nr1, nr2;
float xp, yp, r;
int tx, ty, tr, rem;
int i;
scanf("%d", &setcount);
for(i=0; i<setcount; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
nx1=x2-x1; ny1=y2-y1;
nx2=x3-x1; ny2=y3-y1;
nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
nr1*=0.5f; nr2*=0.5f;
//normalize
ny1/=nx1; nr1/=nx1; nx1=1.0f;
//subtraction
ny2-=ny1*nx2; nr2-=nr1*nx2; nx2=0.0f;
//normalize
nr2/=ny2; ny2=1.0f;
//subtraction
nr1-=nr2*ny1; ny1=0.0f;
xp=nr1+x1; yp=nr2+y1;
r=(float)sqrt((double)(nr1^2+nr2^2));
/*tx=xp*10000; ty=yp*10000; tr=r*10000;
if((rem=tx%10)<5) tx-=rem;
else tx+=10-rem;
if((rem=ty%10)<5) ty-=rem;
else ty+=10-rem;
if((rem=tr%10)<5) tr-=rem;
else tr+=10-rem;
xp=(float)tx*0.0001f; yp=(float)ty*0.0001f; r=(float)tr*0.0001f;*/
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:19:29: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:32:31: error: invalid operands to binary ^ (have 'float' and 'float')
32 | r=(float)sqrt((double)(nr1^2+nr2^2));
| ^~~~~~
| |
| float
|
s982675172
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int setcount;
float x1, y1, x2, y2, x3, y3;
float nx1, ny1, nx2, ny2;
float nr1, nr2;
float xp, yp, r;
int tx, ty, tr, rem;
int i;
scanf("%d", &setcount);
for(i=0; i<setcount; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
nx1=x2-x1; ny1=y2-y1;
nx2=x3-x1; ny2=y3-y1;
nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
nr1*=0.5f; nr2*=0.5f;
//normalize
ny1/=nx1; nr1/=nx1; nx1=1.0f;
//subtraction
ny2-=ny1*nx2; nr2-=nr1*nx2; nx2=0.0f;
//normalize
nr2/=ny2; ny2=1.0f;
//subtraction
nr1-=nr2*ny1; ny1=0.0f;
xp=nr1+x1; yp=nr2+y1;
r=(float)sqrt((double)(nr1^2+nr2^2));
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:19:29: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:32:31: error: invalid operands to binary ^ (have 'float' and 'float')
32 | r=(float)sqrt((double)(nr1^2+nr2^2));
| ^~~~~~
| |
| float
|
s230145208
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int setcount;
float x1, y1, x2, y2, x3, y3;
float nx1, ny1, nx2, ny2;
float nr1, nr2;
float xp, yp, r;
int tx, ty, tr, rem;
int i;
scanf("%d", &setcount);
for(i=0; i<setcount; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
nx1=x2-x1; ny1=y2-y1;
nx2=x3-x1; ny2=y3-y1;
nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
nr1*=0.5f; nr2*=0.5f;
if(nx1==0){
nr1/=ny1; ny1=1.0f;
nr2-=nr1*ny2; ny2=0.0f;
nr2/=nx2; nx2=1.0f;
}
else {
//normalize
ny1/=nx1; nr1/=nx1; nx1=1.0f;
//subtraction
ny2-=ny1*nx2; nr2-=nr1*nx2; nx2=0.0f;
//normalize
nr2/=ny2; ny2=1.0f;
//subtraction
nr1-=nr2*ny1; ny1=0.0f;
}
xp=nr1+x1; yp=nr2+y1;
r=(float)sqrt((double)(nr1^2+nr2^2));
tx=xp*10000; ty=yp*10000; tr=r*10000;
if((rem=tx%10)<5) tx-=rem;
else tx+=10-rem;
if((rem=ty%10)<5) ty-=rem;
else ty+=10-rem;
if((rem=tr%10)<5) tr-=rem;
else tr+=10-rem;
xp=(float)tx*0.0001f; yp=(float)ty*0.0001f; r=(float)tr*0.0001f;
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:19:29: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:39:31: error: invalid operands to binary ^ (have 'float' and 'float')
39 | r=(float)sqrt((double)(nr1^2+nr2^2));
| ^~~~~~
| |
| float
|
s947834138
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int setcount;
float x1, y1, x2, y2, x3, y3;
float nx1, ny1, nx2, ny2;
float nr1, nr2;
float xp, yp, r;
int tx, ty, tr, rem;
int i;
scanf("%d", &setcount);
for(i=0; i<setcount; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
nx1=x2-x1; ny1=y2-y1;
nx2=x3-x1; ny2=y3-y1;
nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
nr1*=0.5f; nr2*=0.5f;
if(nx1==0){
nr1/=ny1; ny1=1.0f;
nr2-=nr1*ny2; ny2=0.0f;
nr2/=nx2; nx2=1.0f;
}
else {
//normalize
ny1/=nx1; nr1/=nx1; nx1=1.0f;
//subtraction
ny2-=ny1*nx2; nr2-=nr1*nx2; nx2=0.0f;
//normalize
nr2/=ny2; ny2=1.0f;
//subtraction
nr1-=nr2*ny1; ny1=0.0f;
}
xp=nr1+x1; yp=nr2+y1;
r=(float)sqrt((double)(nr1^2+nr2^2));
tx=xp*10000; ty=yp*10000; tr=r*10000;
if((rem=tx%10)<5) tx-=rem;
else tx+=10-rem;
if((rem=ty%10)<5) ty-=rem;
else ty+=10-rem;
if((rem=tr%10)<5) tr-=rem;
else tr+=10-rem;
xp=(float)tx*0.0001f; yp=(float)ty*0.0001f; r=(float)tr*0.0001f;
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:19:29: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:39:31: error: invalid operands to binary ^ (have 'float' and 'float')
39 | r=(float)sqrt((double)(nr1^2+nr2^2));
| ^~~~~~
| |
| float
|
s815343612
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int setcount;
float x1, y1, x2, y2, x3, y3;
float nx1, ny1, nx2, ny2;
float nr1, nr2;
float xp, yp, r;
int tx, ty, tr, rem;
int i;
scanf("%d", &setcount);
for(i=0; i<setcount; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
nx1=x2-x1; ny1=y2-y1;
nx2=x3-x1; ny2=y3-y1;
nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
nr1*=0.5f; nr2*=0.5f;
xp=nr1+x1; yp=nr2+y1;
r=(float)sqrt((double)(nr1^2+nr2^2));
tx=xp*10000; ty=yp*10000; tr=r*10000;
if((rem=tx%10)<5) tx-=rem;
else tx+=10-rem;
if((rem=ty%10)<5) ty-=rem;
else ty+=10-rem;
if((rem=tr%10)<5) tr-=rem;
else tr+=10-rem;
xp=(float)tx*0.0001f; yp=(float)ty*0.0001f; r=(float)tr*0.0001f;
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:12: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:19:29: error: invalid operands to binary ^ (have 'float' and 'float')
19 | nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
| ^~~~~~
| |
| float
main.c:24:31: error: invalid operands to binary ^ (have 'float' and 'float')
24 | r=(float)sqrt((double)(nr1^2+nr2^2));
| ^~~~~~
| |
| float
|
s024889626
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{
double x1, x2, x3;
double y1, y2, y3;
double a, b, c, a1, b1, c1, a2, b2, c2;
int n, i;
double x, y;
double hankei;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
// ±Á©çSÀWÌvZ
a1 = 2 * (x2 - x1);
b1 = 2 * (y2 - y1);
c1 = (x1 * x1) - (x2 * x2) + (y1 * y1) - (y2 * y2);
a2 = 2 * (x3 - x1);
b2 = 2 * (x3 - y1);
c2 = (x1 * x1) - (x3 * x3) + (y1 * y1) - (y3 * y3);
x = ( (b1 * c2) - (b2 * c1) ) / ( (a1 * b2) - (a2 * b1) );
y = ( (c1 * a2) - (c2 * a1) ) / ( (a1 * b2) - (a2 * b1) );
// ±±ÜÅ
// ¼a
a = sqrt(( (y1 - y) * (y1 - y) ) + ( (x1 - x) * (x1 - x) ));
b = sqrt(( (y2 - y) * (y2 - y) ) + ( (x2 - x) * (x2 - x) ));
c = sqrt(( (y3 - y) * (y3 - y) ) + ( (x3 - x) * (x3 - x) ));
hankei = (a * b * c) / sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c))
printf("%.3lf %.3lf %.3lf\n", x, y, );
}
return (0);
}
|
main.c: In function 'main':
main.c:35:100: error: expected ';' before 'printf'
35 | hankei = (a * b * c) / sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c))
| ^
| ;
36 |
37 | printf("%.3lf %.3lf %.3lf\n", x, y, );
| ~~~~~~
|
s122801253
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{
double x1, x2, x3;
double y1, y2, y3;
double a, b, c, a1, b1, c1, a2, b2, c2;
int n, i;
double x, y;
double hankei;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
// ±Á©çSÀWÌvZ
a1 = 2 * (x2 - x1);
b1 = 2 * (y2 - y1);
c1 = (x1 * x1) - (x2 * x2) + (y1 * y1) - (y2 * y2);
a2 = 2 * (x3 - x1);
b2 = 2 * (x3 - y1);
c2 = (x1 * x1) - (x3 * x3) + (y1 * y1) - (y3 * y3);
x = ( (b1 * c2) - (b2 * c1) ) / ( (a1 * b2) - (a2 * b1) );
y = ( (c1 * a2) - (c2 * a1) ) / ( (a1 * b2) - (a2 * b1) );
// ±±ÜÅ
// ¼a
a = sqrt(( (y1 - y) * (y1 - y) ) + ( (x1 - x) * (x1 - x) ));
b = sqrt(( (y2 - y) * (y2 - y) ) + ( (x2 - x) * (x2 - x) ));
c = sqrt(( (y3 - y) * (y3 - y) ) + ( (x3 - x) * (x3 - x) ));
hankei = (a * b * c) / sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c))
printf("%.3lf %.3lf %.3lf\n", x, y, hankei);
}
return (0);
}
|
main.c: In function 'main':
main.c:35:100: error: expected ';' before 'printf'
35 | hankei = (a * b * c) / sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c))
| ^
| ;
36 |
37 | printf("%.3lf %.3lf %.3lf\n", x, y, hankei);
| ~~~~~~
|
s998905410
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(int argc,char* argv[]){
double x1,y1,x2,y2,x3,y3;
double x,y,r;
double r12,r23,r31,angle1,angle2,angle3;
int num,count;
scanf("%d",&num);
for(count = 0; num > count;count++){
scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
r12 = sqrt((x1 -x2)*(x1 -x2) + (y1 -y2)*(y1 -y2));
r23 = sqrt((x2 -x3)*(x2 -x3) + (y2 -y3)*(y2 -y3));
r31 = sqrt((x3 -x1)*(x3 -x1) + (y3 -y1)*(y3 -y1));
angle3 = acos( (r23*r23+r31*r31-r12*r12) / (2.0*r23*r31) );
angle1 = acos( (r31*r31+r12*r12-r23*r23) / (2.0*r31*r12) );
angle2 = acos( (r12*r12+r23*r23-r31*r31) / (2.0*r12*r23) );
x = (sin(2.0*angle1)*x1 + sin(2.0*angle2)*x2 + sin(2.0*angle3)*x3)/(sin(2.0*angle1) + sin(2.0*angle2) + sin(2.0*angle3));
y = (sin(2.0*angle1)*y1 + sin(2.0*angle2)*y2 + sin(2.0*angle3)*y3)/(sin(2.0*angle1) + sin(2.0*angle2) + sin(2.0*angle3));
r = r32/ sin(angle1) / 2.0;
printf("%.3lf %.3lf %.3lf\n",x,y,r);
}
return 0;
}
|
main.c: In function 'main':
main.c:26:9: error: 'r32' undeclared (first use in this function); did you mean 'r31'?
26 | r = r32/ sin(angle1) / 2.0;
| ^~~
| r31
main.c:26:9: note: each undeclared identifier is reported only once for each function it appears in
|
s248677988
|
p00010
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
int n;
double x[3]={0},y[3]={0},r,a,b,c,d[2]={0},e[2]={0},f[2]={0},l,m;
scanf("%d",&n);
for(int i=0;i<n;i++){
a=b=c=r=l=m=0;
for(int i=0;i<2;i++){
d[i]=e[i]=f[i]=0;
}
for(int i=0;i<3;i++){
x[i]=y[i]=0;
}
scanf("%lf %lf %lf %lf %lf %lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
a=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1])); //ツ各ツ陛督づ個陳キツつウ
b=sqrt((x[2]-x[1])*(x[2]-x[1])+(y[2]-y[1])*(y[2]-y[1]));
c=sqrt((x[0]-x[2])*(x[0]-x[2])+(y[0]-y[2])*(y[0]-y[2]));
r=a*b*c/sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c)); //ツ外ツ静堋円ツづ個板シツ径
d[0]=2*(x[1]-x[0]);
e[0]=2*(y[1]-y[0]);
f[0]=x[0]*x[0]-x[1]*x[1]+y[0]*y[0]-y[1]*y[1];
d[1]=2*(x[2]-x[0]);
e[1]=2*(y[2]-y[0]);
f[1]=x[0]*x[0]-x[2]*x[2]+y[0]*y[0]-y[2]*y[2];
l=(e[0]*f[1]-e[1]*f[0])/(d[0]*e[1]-d[1]*e[0]);
m=(f[0]*d[1]-f[1]*d[0])/(d[0]*e[1]-d[1]*e[0]);
l=round(l*1000)/1000;
m=round(m*1000)/1000;
r=round(r*1000)/1000;
printf("%.03lf %.03lf %.03lf\n",l,m,r);
}
return 0;
}
|
/usr/bin/ld: /tmp/cc9mCeA8.o: in function `main':
main.c:(.text+0x203): undefined reference to `sqrt'
/usr/bin/ld: main.c:(.text+0x267): undefined reference to `sqrt'
/usr/bin/ld: main.c:(.text+0x2cb): undefined reference to `sqrt'
/usr/bin/ld: main.c:(.text+0x346): undefined reference to `sqrt'
/usr/bin/ld: main.c:(.text+0x545): undefined reference to `round'
/usr/bin/ld: main.c:(.text+0x580): undefined reference to `round'
/usr/bin/ld: main.c:(.text+0x5bb): undefined reference to `round'
collect2: error: ld returned 1 exit status
|
s883520795
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,n;
double x[3],y[3],r;
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
if ((int)(x[0]*10000)%10>=5) x[0]+=0.001;
if ((int)(y[0]*10000)%10>=5) y[0]+=0.001;
if ((int)(r*10000)%10>=5) r+=0.001;
printf("%.3f %.3f %.3f\n",x[0],y[0],r);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:197: error: stray '#' in program
9 | x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
main.c:9:196: error: lvalue required as unary '&' operand
9 | x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
|
s963521801
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,n;
double x[3],y[3],r;
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
if ((int)(x[0]*10000)%10>=5) x[0]+=0.001;
if ((int)(y[0]*10000)%10>=5) y[0]+=0.001;
if ((int)(r*10000)%10>=5) r+=0.001;
printf("%.3f %.3f %.3f\n",x[0],y[0],r);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:197: error: stray '#' in program
9 | x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
main.c:9:196: error: lvalue required as unary '&' operand
9 | x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
|
s591947048
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,n;
double x[3],y[3],r;
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
if ((int)(x[0]*10000)%10>=5) x[0]+=0.001;
if ((int)(y[0]*10000)%10>=5) y[0]+=0.001;
if ((int)(r*10000)%10>=5) r+=0.001;
printf("%.3f %.3f %.3f\n",x[0],y[0],r);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:197: error: stray '#' in program
9 | x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
main.c:9:196: error: lvalue required as unary '&' operand
9 | x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
|
s779971007
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,n;
double x[3],y[3],r;
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
if ((int)(x[0]*10000)%10>=5) x[0]+=0.001;
if ((int)(y[0]*10000)%10>=5) y[0]+=0.001;
if ((int)(r*10000)%10>=5) r+=0.001;
printf("%.3f %.3f %.3f\n",x[0],y[0],r);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:197: error: stray '#' in program
9 | x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
main.c:9:196: error: lvalue required as unary '&' operand
9 | x[0]=((-(x[0]*x[0]-x[1]*x[1])-(y[0]*y[0]-y[1]*y[1]))*(y[2]-y[1])-(-(x[1]*x[1]-x[2]*x[2])-(y[1]*y[1]-y[2]*y[2]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
|
s924883653
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,n;
double x[3],y[3],r;
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
x[0]=(((x[1]*x[1]-x[0]*x[0])+(y[1]*y[1]-y[0]*y[0]))*(y[2]-y[1])-((x[2]*x[2]-x[1]*x[1])+(y[2]*y[2]-y[1]*y[1]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=(((y[1]*y[1]-y[0]*y[0])+(x[1]*x[1]-x[0]*x[0]))*(x[2]-x[1])-((y[2]*y[2]-y[1]*y[1])+(x[2]*x[2]-x[1]*x[1]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
if ((int)(x[0]*10000)%10>=5) x[0]+=0.001;
if ((int)(y[0]*10000)%10>=5) y[0]+=0.001;
if ((int)(r*10000)%10>=5) r+=0.001;
printf("%.3f %.3f %.3f\n",x[0],y[0],r);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:195: error: stray '#' in program
9 | x[0]=(((x[1]*x[1]-x[0]*x[0])+(y[1]*y[1]-y[0]*y[0]))*(y[2]-y[1])-((x[2]*x[2]-x[1]*x[1])+(y[2]*y[2]-y[1]*y[1]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=(((y[1]*y[1]-y[0]*y[0])+(x[1]*x[1]-x[0]*x[0]))*(x[2]-x[1])-((y[2]*y[2]-y[1]*y[1])+(x[2]*x[2]-x[1]*x[1]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
main.c:9:194: error: lvalue required as unary '&' operand
9 | x[0]=(((x[1]*x[1]-x[0]*x[0])+(y[1]*y[1]-y[0]*y[0]))*(y[2]-y[1])-((x[2]*x[2]-x[1]*x[1])+(y[2]*y[2]-y[1]*y[1]))*(y[1]-y[0]))/(2*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));
 y[0]=(((y[1]*y[1]-y[0]*y[0])+(x[1]*x[1]-x[0]*x[0]))*(x[2]-x[1])-((y[2]*y[2]-y[1]*y[1])+(x[2]*x[2]-x[1]*x[1]))*(x[1]-x[0]))/(2*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
| ^
|
s432546413
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,n;
double x[3],y[3],r;
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%lf %lf %lf %lf %lf %lf ", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2]);
x[0] = ( ( - ( x[0] * x[0] - x[1] * x[1] ) - ( y [0] * y[0] - y[1] * y[1] ) ) * ( y[2] - y[1] ) - ( - ( x[1] *x[1] - x[2] * x[2] ) - ( y[1] * y[1] - y[2] * y[2] ) ) * ( y[1] - y[0] ) ) / ( 2.0 * ( ( x[1] - x[0] ) * ( y[2] - y[1] ) - ( x[2] - x[1] ) * ( y[1] - y [0] ) ) );

y[0]=((-(y[0]*y[0]-y[1]*y[1])-(x[0]*x[0]-x[1]*x[1]))*(x[2]-x[1])-(-(y[1]*y[1]-y[2]*y[2])-(x[1]*x[1]-x[2]*x[2]))*(x[1]-x[0]))/(2.0*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
if ((int)(x[0]*10000)%10>=5) x[0]+=0.001;
if ((int)(y[0]*10000)%10>=5) y[0]+=0.001;
if ((int)(r*10000)%10>=5) r+=0.001;
printf("%.3f %.3f %.3f\n",x[0],y[0],r);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:290: error: stray '#' in program
9 | x[0] = ( ( - ( x[0] * x[0] - x[1] * x[1] ) - ( y [0] * y[0] - y[1] * y[1] ) ) * ( y[2] - y[1] ) - ( - ( x[1] *x[1] - x[2] * x[2] ) - ( y[1] * y[1] - y[2] * y[2] ) ) * ( y[1] - y[0] ) ) / ( 2.0 * ( ( x[1] - x[0] ) * ( y[2] - y[1] ) - ( x[2] - x[1] ) * ( y[1] - y [0] ) ) );

| ^
main.c:9:289: error: lvalue required as unary '&' operand
9 | x[0] = ( ( - ( x[0] * x[0] - x[1] * x[1] ) - ( y [0] * y[0] - y[1] * y[1] ) ) * ( y[2] - y[1] ) - ( - ( x[1] *x[1] - x[2] * x[2] ) - ( y[1] * y[1] - y[2] * y[2] ) ) * ( y[1] - y[0] ) ) / ( 2.0 * ( ( x[1] - x[0] ) * ( y[2] - y[1] ) - ( x[2] - x[1] ) * ( y[1] - y [0] ) ) );

| ^
|
s577617183
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,n;
double x[3],y[3],r;
scanf("%d",&n);
for (i=0;i<n;i++) {
scanf("%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
x[0]=(((x[1]*x[1]-x[0]*x[0])+(y[1]*y[1]-y[0]*y[0]))*(y[2]-y[1])-((x[2]*x[2]-x[1]*x[1])+(y[2]*y[2]-y[1]*y[1]))*(y[1]-y[0]))/(2.0*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));

y[0]=(((y[1]*y[1]-y[0]*y[0])+(x[1]*x[1]-x[0]*x[0]))*(x[2]-x[1])-((y[2]*y[2]-y[1]*y[1])+(x[2]*x[2]-x[1]*x[1]))*(x[1]-x[0]))/(2.0*((y[1]-y[0])*(x[2]-x[1])-(y[2]-y[1])*(x[1]-x[0])));
r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
if ((int)(x[0]*10000)%10>=5) x[0]+=0.001;
if ((int)(y[0]*10000)%10>=5) y[0]+=0.001;
if ((int)(r*10000)%10>=5) r+=0.001;
printf("%.3f %.3f %.3f\n",x[0],y[0],r);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:181: error: stray '#' in program
9 | x[0]=(((x[1]*x[1]-x[0]*x[0])+(y[1]*y[1]-y[0]*y[0]))*(y[2]-y[1])-((x[2]*x[2]-x[1]*x[1])+(y[2]*y[2]-y[1]*y[1]))*(y[1]-y[0]))/(2.0*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));

| ^
main.c:9:180: error: lvalue required as unary '&' operand
9 | x[0]=(((x[1]*x[1]-x[0]*x[0])+(y[1]*y[1]-y[0]*y[0]))*(y[2]-y[1])-((x[2]*x[2]-x[1]*x[1])+(y[2]*y[2]-y[1]*y[1]))*(y[1]-y[0]))/(2.0*((x[1]-x[0])*(y[2]-y[1])-(x[2]-x[1])*(y[1]-y[0])));

| ^
|
s911974802
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,n;
double x1,,x2,x3,y1,y2,y3,r;
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
x1=(((x2*x2-x1*x1)+(y2*y2-y1*y1))*(y3-y2)-((x3*x3-x2*x2)+(y3*y3-y2*y2))*(y2-y1))/(2.0*((x2-x1)*(y3-y2)-(x3-x2)*(y2-y1)));
y1=(((y2*y2-y1*y1)+(x2*x2-x1*x1))*(x3-x2)-((y3*y3-y2*y2)+(x3*y3-x2*y2))*(x2-x1))/(2.0*((y2-y1)*(x3-x2)-(y3-y2)*(x2-x1)));
r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
if ((int)(x[0]*10000)%10>=5) x[0]+=0.001;
if ((int)(y[0]*10000)%10>=5) y[0]+=0.001;
if ((int)(r*10000)%10>=5) r+=0.001;
printf("%.3f %.3f %.3f\n",x[0],y[0],r);
}
return 0;
}
|
main.c: In function 'main':
main.c:5:19: error: expected identifier or '(' before ',' token
5 | double x1,,x2,x3,y1,y2,y3,r;
| ^
main.c:8:53: error: 'x2' undeclared (first use in this function); did you mean 'x1'?
8 | scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
| ^~
| x1
main.c:8:53: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:57: error: 'y2' undeclared (first use in this function); did you mean 'yn'?
8 | scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
| ^~
| yn
main.c:8:61: error: 'x3' undeclared (first use in this function); did you mean 'x1'?
8 | scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
| ^~
| x1
main.c:8:65: error: 'y3' undeclared (first use in this function); did you mean 'yn'?
8 | scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
| ^~
| yn
main.c:9:45: error: invalid operands to binary * (have 'double (*)(double)' and 'double (*)(double)')
9 | x1=(((x2*x2-x1*x1)+(y2*y2-y1*y1))*(y3-y2)-((x3*x3-x2*x2)+(y3*y3-y2*y2))*(y2-y1))/(2.0*((x2-x1)*(y3-y2)-(x3-x2)*(y2-y1)));
| ~ ^
| | |
| | double (*)(double)
| double (*)(double)
main.c:10:31: error: invalid operands to binary * (have 'double (*)(double)' and 'double (*)(double)')
10 | y1=(((y2*y2-y1*y1)+(x2*x2-x1*x1))*(x3-x2)-((y3*y3-y2*y2)+(x3*y3-x2*y2))*(x2-x1))/(2.0*((y2-y1)*(x3-x2)-(y3-y2)*(x2-x1)));
| ~ ^
| | |
| | double (*)(double)
| double (*)(double)
main.c:11:17: error: 'r' undeclared (first use in this function)
11 | r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
| ^
main.c:11:25: error: 'x' undeclared (first use in this function); did you mean 'x1'?
11 | r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
| ^
| x1
main.c:11:49: error: 'y' undeclared (first use in this function)
11 | r=sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
| ^
|
s728927720
|
p00010
|
C
|
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
struct point {
double x, y;
}A, B, C;
struct circle {
double r;
point cen;
}cir;
void solve(point A, point B, point C) {
double tmp1 = A.x * A.x - B.x * B.x + A.y * A.y - B.y * B.y;
double tmp2 = A.x * A.x - C.x * C.x + A.y * A.y - C.y * C.y;
cir.cen.x = (tmp1 * (A.y - C.y) - tmp2 * (A.y - B.y)) / (2 * (A.y - C.y) * (A.x - B.x) - 2 * (A.y - B.y) * (A.x - C.x));
cir.cen.y = (tmp1 * (A.x - C.x) - tmp2 * (A.x - B.x)) / (2 * (A.y - B.y) * (A.x - C.x) - 2 * (A.y - C.y) * (A.x - B.x));
double la = sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
double lb = sqrt((B.x - C.x) * (B.x - C.x) + (B.y - C.y) * (B.y - C.y));
double lc = sqrt((C.x - A.x) * (C.x - A.x) + (C.y - A.y) * (C.y - A.y));
double p = (la + lb + lc) / 2.0;
double s = sqrt(p * (p - la) * (p - lb) * (p - lc));
cir.r = la * lb * lc / (4 * s);
}
int main() {
int t;
scanf ("%d", &t);
while (t--) {
scanf ("%lf%lf%lf%lf%lf%lf", &A.x, &A.y, &B.x, &B.y, &C.x, &C.y);
solve(A, B, C);
printf ("%.3lf %.3lf %.3lf\n",cir.cen.x, cir.cen.y, cir.r);
}
return 0;
}
|
main.c:1:10: fatal error: cmath: No such file or directory
1 | #include <cmath>
| ^~~~~~~
compilation terminated.
|
s631325446
|
p00010
|
C
|
#include<stdio.h>#include<math.h> int main(void){ double x, y, r; double x1, x2, x3, y1, y2, y3; double ecm[3][2]; double a, b, A; //enlarged coefficient matrix:拡大係数行列 int i; int n; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3); ecm[0][0] = x1 - x2; ecm[0][1] = y1 - y2; ecm[0][2] = (x2 * x2 + y2 * y2) - (x1 * x1 + y1 * y1); ecm[1][0] = x1 - x3; ecm[1][1] = y1 - y3; ecm[1][2] = (x3 * x3 + y3 * y3) - (x1 * x1 + y1 * y1); A = (ecm[0][0] * ecm[1][1]) - (ecm[0][1] * ecm[1][0]); a = ((ecm[0][2] * ecm[1][1]) - (ecm[0][1] * ecm[1][2])) / A + 0; b = ((ecm[0][0] * ecm[1][2]) - (ecm[0][2] * ecm[1][0])) / A + 0; x = (a / -2.0); y = (b / -2.0); r = sqrt(pow(x1 - x, 2)+pow(y1 - y, 2)); printf("%.3f %.3f %.3f\n", x, y, r); //四捨五入は自動的にされる } return 0;}
|
main.c:1:18: warning: extra tokens at end of #include directive
1 | #include<stdio.h>#include<math.h> int main(void){ double x, y, r; double x1, x2, x3, y1, y2, y3; double ecm[3][2]; double a, b, A; //enlarged coefficient matrix:拡大係数行列 int i; int n; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3); ecm[0][0] = x1 - x2; ecm[0][1] = y1 - y2; ecm[0][2] = (x2 * x2 + y2 * y2) - (x1 * x1 + y1 * y1); ecm[1][0] = x1 - x3; ecm[1][1] = y1 - y3; ecm[1][2] = (x3 * x3 + y3 * y3) - (x1 * x1 + y1 * y1); A = (ecm[0][0] * ecm[1][1]) - (ecm[0][1] * ecm[1][0]); a = ((ecm[0][2] * ecm[1][1]) - (ecm[0][1] * ecm[1][2])) / A + 0; b = ((ecm[0][0] * ecm[1][2]) - (ecm[0][2] * ecm[1][0])) / A + 0; x = (a / -2.0); y = (b / -2.0); r = sqrt(pow(x1 - x, 2)+pow(y1 - y, 2)); printf("%.3f %.3f %.3f\n", x, y, r); //四捨五入は自動的にされる } return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s312673359
|
p00010
|
C
|
#include<stdio.h>
#include<math.h>
int main(void)
{
double x,y,r;
double x1,x2,x3,y1,y2,y3;
double ecm[3][2];
double a,b,A; //enlarged coefficient matrix:拡大係数行列
int i;
int n;
scanf("%d",&n);
for(i = 0; i < n; i++)
{
scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
ecm[0][0] = x1 - x2;
ecm[0][1] = y1 - y2;
ecm[0][2] = (x2*x2 + y2*y2) - (x1*x1 + y1*y1);
ecm[1][0] = x1 - x3;
ecm[1][1] = y1 - y3;
ecm[1][2] = (x3*x3 + y3*y3) - (x1*x1 + y1*y1);
A = (ecm[0][0]*ecm[1][1])-(ecm[0][1]*ecm[1][0]);
a = ((ecm[0][2]*ecm[1][1])-(ecm[0][1]*ecm[1][2]))/A+0;
b = ((ecm[0][0]*ecm[1][2])-(ecm[0][2]*ecm[1][0]))/A+0;
x = (a/-2.0);
y = (b/-2.0);
r = sqrt(pow(x1-x,2)+pow(y1-y,2));
printf("%.3f %.3f %.3f\n",x,y,r); //四捨五入は自動的にされる
}
return 0;
}
|
main.c: In function 'main':
main.c:9:15: error: stray '\343' in program
9 | double a,b,A;<U+3000>//enlarged coefficient matrix:<U+62E1><U+5927><U+4FC2><U+6570><U+884C><U+5217>
| ^~~~~~~~
|
s777225509
|
p00010
|
C
|
#include<stdio.h>#include<math.h> int main(void){ double x,y,r; double x1,x2,x3,y1,y2,y3; double ecm[3][2]; double a,b,A; int i; int n; scanf("%d",&n); for(i = 0; i < n; i++) { scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3); ecm[0][0] = x1 - x2; ecm[0][1] = y1 - y2; ecm[0][2] = (x2*x2 + y2*y2) - (x1*x1 + y1*y1); ecm[1][0] = x1 - x3; ecm[1][1] = y1 - y3; ecm[1][2] = (x3*x3 + y3*y3) - (x1*x1 + y1*y1); A = (ecm[0][0]*ecm[1][1])-(ecm[0][1]*ecm[1][0]); a = ((ecm[0][2]*ecm[1][1])-(ecm[0][1]*ecm[1][2]))/A+0; b = ((ecm[0][0]*ecm[1][2])-(ecm[0][2]*ecm[1][0]))/A+0; x = (a/-2.0); y = (b/-2.0); r = sqrt(pow(x1-x,2)+pow(y1-y,2)); printf("%.3f %.3f %.3f\n",x,y,r); } return 0;}
|
main.c:1:18: warning: extra tokens at end of #include directive
1 | #include<stdio.h>#include<math.h> int main(void){ double x,y,r; double x1,x2,x3,y1,y2,y3; double ecm[3][2]; double a,b,A; int i; int n; scanf("%d",&n); for(i = 0; i < n; i++) { scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3); ecm[0][0] = x1 - x2; ecm[0][1] = y1 - y2; ecm[0][2] = (x2*x2 + y2*y2) - (x1*x1 + y1*y1); ecm[1][0] = x1 - x3; ecm[1][1] = y1 - y3; ecm[1][2] = (x3*x3 + y3*y3) - (x1*x1 + y1*y1); A = (ecm[0][0]*ecm[1][1])-(ecm[0][1]*ecm[1][0]); a = ((ecm[0][2]*ecm[1][1])-(ecm[0][1]*ecm[1][2]))/A+0; b = ((ecm[0][0]*ecm[1][2])-(ecm[0][2]*ecm[1][0]))/A+0; x = (a/-2.0); y = (b/-2.0); r = sqrt(pow(x1-x,2)+pow(y1-y,2)); printf("%.3f %.3f %.3f\n",x,y,r); } return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s000443981
|
p00010
|
C
|
#include<stdio.h>#include<math.h> int main(void){ double x,y,r; double x1,x2,x3,y1,y2,y3; double ecm[3][2]; double a,b,A; int i; int n; scanf("%d",&n); for(i = 0; i < n; i++) { scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3); ecm[0][0] = x1 - x2; ecm[0][1] = y1 - y2; ecm[0][2] = (x2*x2 + y2*y2) - (x1*x1 + y1*y1); ecm[1][0] = x1 - x3; ecm[1][1] = y1 - y3; ecm[1][2] = (x3*x3 + y3*y3) - (x1*x1 + y1*y1); A = (ecm[0][0]*ecm[1][1])-(ecm[0][1]*ecm[1][0]); a = ((ecm[0][2]*ecm[1][1])-(ecm[0][1]*ecm[1][2]))/A+0; b = ((ecm[0][0]*ecm[1][2])-(ecm[0][2]*ecm[1][0]))/A+0; x = (a/-2.0); y = (b/-2.0); r = sqrt(pow(x1-x,2)+pow(y1-y,2)); printf("%.3f %.3f %.3f\n",x,y,r); } return 0;}
|
main.c:1:18: warning: extra tokens at end of #include directive
1 | #include<stdio.h>#include<math.h> int main(void){ double x,y,r; double x1,x2,x3,y1,y2,y3; double ecm[3][2]; double a,b,A; int i; int n; scanf("%d",&n); for(i = 0; i < n; i++) { scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3); ecm[0][0] = x1 - x2; ecm[0][1] = y1 - y2; ecm[0][2] = (x2*x2 + y2*y2) - (x1*x1 + y1*y1); ecm[1][0] = x1 - x3; ecm[1][1] = y1 - y3; ecm[1][2] = (x3*x3 + y3*y3) - (x1*x1 + y1*y1); A = (ecm[0][0]*ecm[1][1])-(ecm[0][1]*ecm[1][0]); a = ((ecm[0][2]*ecm[1][1])-(ecm[0][1]*ecm[1][2]))/A+0; b = ((ecm[0][0]*ecm[1][2])-(ecm[0][2]*ecm[1][0]))/A+0; x = (a/-2.0); y = (b/-2.0); r = sqrt(pow(x1-x,2)+pow(y1-y,2)); printf("%.3f %.3f %.3f\n",x,y,r); } return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s771838656
|
p00010
|
C
|
include<stdio.h>
#include<math.h>
int main(){
int n,i,j;
double x[4],y[4],r,a1,a2,b1,b2,c1,c2;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<3;j++)scanf("%lf%lf",&x[j],&y[j]);
a1=2*(x[1]-x[0]);b1=2*(y[1]-y[0]);c1=x[0]*x[0]-x[1]*x[1]+y[0]*y[0]-y[1]*y[1];
a2=2*(x[2]-x[0]);b2=2*(y[2]-y[0]);c2=x[0]*x[0]-x[2]*x[2]+y[0]*y[0]-y[2]*y[2];
x[3]=(b1*c2-b2*c1)/(a1*b2-a2*b1);
y[3]=(c1*a2-c2*a1)/(a1*b2-a2*b1);
r=sqrt((x[3]-x[0])*(x[3]-x[0])+(y[3]-y[0])*(y[3]-y[0]));
printf("%.3f %.3f %.3f\n",x[3],y[3],r);
}
return 0;
}
|
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
8 | scanf("%d",&n);
| ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
2 | #include<math.h>
+++ |+#include <stdio.h>
3 |
main.c:8:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
8 | scanf("%d",&n);
| ^~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:19:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
19 | printf("%.3f %.3f %.3f\n",x[3],y[3],r);
| ^~~~~~
main.c:19:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:19:5: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s518919607
|
p00010
|
C
|
#include <stdio.h>
int main(void){
int Num, i;
double X1, Y1, X2, Y2, X3, Y3;
doubel Xp, Yp, R;
scanf("%d",&Num);
for(i = 0; i < Num; i++){
scanf("%lf %lf %lf %lf %lf %lf", &X1, &Y1, &X2, &Y2, &X3, &Y3);
R = 2*(X1*(Y2-Y3) + X2*(Y3-Y1) + X3*(Y1-Y2));
Xp = ((X1*X1 + Y1*Y1)*(Y2-Y3) + (X2*X2 + Y2*Y2)*(Y3-Y1) + (X3*X3 + Y3*Y3)*(Y1-Y2))/R;
Yp = ((X1*X1 + Y1*Y1)*(X3-X2) + (X2*X2 + Y2*Y2)*(X1-X3) + (X3*X3 + Y3*Y3)*(X2-X1))/R;
printf("%.03lf %.03lf %.03lf\n", Xp, Yp, R);
}
return 0;
}
|
main.c: In function 'main':
main.c:7:9: error: unknown type name 'doubel'; did you mean 'double'?
7 | doubel Xp, Yp, R;
| ^~~~~~
| double
|
s181845308
|
p00010
|
C
|
double x[3],y[3],a,b,c,A,B,C,X,Y,r;
main(n,i,j,k){
i=0,j=1,k=2;
for(scanf("%d",&n);n--;printf("%.3f %.3f %.3f\n",x,y,r)){
scanf("%lf%lf%lf%lf%lf%lf",x,y,x+1,y+1,x+2,y+2);
a=2*x[j]-2*x[i],b=2*y[j]-2*y[i],c=x[i]*x[i]-x[j]*x[j]+y[i]*y[i]-y[j]*y[j];
A=2*x[k]-2*x[i],B=2*y[k]-2*y[i],C=x[i]*x[i]-x[k]*x[k]+y[i]*y[i]-y[k]*y[k];
x=(b*C-B*c)/(a*B-A*b),y=(c*A-C*a)/(a*B-A*b);
r=hypot(x[i]-x,y[i]-y);
}
exit(0);}
|
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(n,i,j,k){
| ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'k' defaults to 'int' [-Wimplicit-int]
main.c:4:13: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | for(scanf("%d",&n);n--;printf("%.3f %.3f %.3f\n",x,y,r)){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | double x[3],y[3],a,b,c,A,B,C,X,Y,r;
main.c:4:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | for(scanf("%d",&n);n--;printf("%.3f %.3f %.3f\n",x,y,r)){
| ^~~~~
main.c:4:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:32: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
4 | for(scanf("%d",&n);n--;printf("%.3f %.3f %.3f\n",x,y,r)){
| ^~~~~~
main.c:4:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:32: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:4:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:18: error: assignment to expression with array type
8 | x=(b*C-B*c)/(a*B-A*b),y=(c*A-C*a)/(a*B-A*b);
| ^
main.c:8:40: error: assignment to expression with array type
8 | x=(b*C-B*c)/(a*B-A*b),y=(c*A-C*a)/(a*B-A*b);
| ^
main.c:9:19: error: implicit declaration of function 'hypot' [-Wimplicit-function-declaration]
9 | r=hypot(x[i]-x,y[i]-y);
| ^~~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'hypot'
+++ |+#include <math.h>
1 | double x[3],y[3],a,b,c,A,B,C,X,Y,r;
main.c:9:19: warning: incompatible implicit declaration of built-in function 'hypot' [-Wbuiltin-declaration-mismatch]
9 | r=hypot(x[i]-x,y[i]-y);
| ^~~~~
main.c:9:19: note: include '<math.h>' or provide a declaration of 'hypot'
main.c:9:29: error: invalid operands to binary - (have 'double' and 'double *')
9 | r=hypot(x[i]-x,y[i]-y);
| ~~~~^
| | |
| | double *
| double
main.c:9:36: error: invalid operands to binary - (have 'double' and 'double *')
9 | r=hypot(x[i]-x,y[i]-y);
| ~~~~^
| | |
| | double *
| double
main.c:11:1: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
11 | exit(0);}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | double x[3],y[3],a,b,c,A,B,C,X,Y,r;
main.c:11:1: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
11 | exit(0);}
| ^~~~
main.c:11:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
|
s016825919
|
p00010
|
C
|
#include<stdio.h>
#include<math.h>
main(){
int n;
scanf("%d",&n);
double x[10000000000000000000],y[1000000000000000000000];
int i;
for(i=0;i<n;i++){
scanf("%lf%lf%lf%lf%lf%lf",&x[i],&y[i],&x[i+1],&y[i+1],&x[i+2],&y[i+2]);
double xp,yp;
double a,b,c,d;
a=x[i]-x[i+1],b=y[i+1]-y[i];c=x[i]-x[i+2],d=y[i+2]-y[i];
xp=(a*d*(x[i]+x[i+1])-b*c*(x[i+2]+x[i])+b*d*(y[i+2]-y[i+1]))/(2*(a*d-b*c));
if(b==0){
yp=(c/d)*xp-(c*(x[i+2]+x[i]))/(2*d)+(y[i]+y[i+2])/2;
}else{
yp=(a/b)*xp-(a*(x[i+2]+x[i]))/(2*b)+(y[i]+y[i+2])/2;
}
double r=hypot(xp-x[i],yp-y[i]);
printf("%.3lf %.3lf %.3lf\n",xp,yp,r);
}
return 0;
}
|
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:18: warning: integer constant is so large that it is unsigned
6 | double x[10000000000000000000],y[1000000000000000000000];
| ^~~~~~~~~~~~~~~~~~~~
main.c:6:16: error: size of array 'x' is too large
6 | double x[10000000000000000000],y[1000000000000000000000];
| ^
main.c:6:42: warning: integer constant is too large for its type
6 | double x[10000000000000000000],y[1000000000000000000000];
| ^~~~~~~~~~~~~~~~~~~~~~
main.c:6:40: error: size of array 'y' exceeds maximum object size '9223372036854775807'
6 | double x[10000000000000000000],y[1000000000000000000000];
| ^
|
s489931534
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{
int n;
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
double x1, y1, x2, y2, x3, y3;
double z1, z2, z3;
double xp, yp, r;
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
z1 = x1 * x1 + y1 * y1;
z2 = x2 * x2 + y2 * y2;
z3 = x3 * x3 + y3 * y3;
xp = (z1 * (y2 - y3) + z2 * (y3 - y1) + z3 * (y1 - y2)) /
(2 * (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)));
yp = (z1 * (x2 - x3) + z2 * (x3 - x1) + z3 * (x1 - x2)) /
(2 * (y1 * (x2 - x3) + y2 * (x3 - x1) + y3 * (x1 - x2)));
r = sqrt((x1 - xp) * (x1 - xp) + (y1 - yp) * (y1 - yp));
printf("%.3f %.3f %.3f\n", xp, yp, r);
}
return 0;
}
// refered to #513632 by ytetsuwo
|
/usr/bin/ld: /tmp/ccS267EM.o: in function `main':
main.c:(.text+0x289): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
|
s471569811
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{ int n;
double x1,x2,x3,y1,y2,y3,xa,ya,r;
double a12,a13,b12,b13;
scanf("%d",&n);
while(n)
{
scanf("%ld %ld %ld %ld %ld %ld",&x1,&y1,&x2,
&y2,&x3,&y3);
a12 = (x1-x2)/(y2-y1));
a13 = (x1-x3)/(y3-y1));
b12 = (y1+y2-a12*(x1+x2))/2;
b13 = (y1+y3-a13*(x1+x3))/2;
xa = (b12-b13)/(a13-a12);
ya = a12*xa+b12;
r = sqrt((x1-xa)*(x1-xa)+(y1-ya)*(y1-ya))
printf("%.3ld %.3ld %.3ld\n",xa,ya,r);
n--;
}
return 0;
}
|
main.c: In function 'main':
main.c:13:27: error: expected ';' before ')' token
13 | a12 = (x1-x2)/(y2-y1));
| ^
| ;
main.c:13:27: error: expected statement before ')' token
main.c:14:27: error: expected ';' before ')' token
14 | a13 = (x1-x3)/(y3-y1));
| ^
| ;
main.c:14:27: error: expected statement before ')' token
main.c:19:47: error: expected ';' before 'printf'
19 | r = sqrt((x1-xa)*(x1-xa)+(y1-ya)*(y1-ya))
| ^
| ;
20 | printf("%.3ld %.3ld %.3ld\n",xa,ya,r);
| ~~~~~~
|
s052028809
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{ int n;
double x1,x2,x3,y1,y2,y3,xa,ya,r;
double a12,a13,b12,b13;
scanf("%d",&n);
while(n)
{
scanf("%ld %ld %ld %ld %ld %ld",&x1,&y1,&x2,
&y2,&x3,&y3);
a12 = (x1-x2)/(y2-y1));
a13 = (x1-x3)/(y3-y1));
b12 = (y1+y2-a12*(x1+x2))/2;
b13 = (y1+y3-a13*(x1+x3))/2;
xa = (b12-b13)/(a13-a12);
ya = a12*xa+b12;
r = sqrt((x1-xa)*(x1-xa)+(y1-ya)*(y1-ya));
printf("%.3ld %.3ld %.3ld\n",xa,ya,r);
n--;
}
return 0;
}
|
main.c: In function 'main':
main.c:13:27: error: expected ';' before ')' token
13 | a12 = (x1-x2)/(y2-y1));
| ^
| ;
main.c:13:27: error: expected statement before ')' token
main.c:14:27: error: expected ';' before ')' token
14 | a13 = (x1-x3)/(y3-y1));
| ^
| ;
main.c:14:27: error: expected statement before ')' token
|
s095042943
|
p00010
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
double n,i,x[3],y[3],a[2],b[2],px,py,r;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%lf%lf%lf%lf%lf%lf",%x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
a[0]=(x[0]-x[1])/(y[1]-y[0]);
b[0]=((y[0]+y[1])-(a[0]*(x[0]+x[1])))/2;
a[1]=(x[0]-x[2])/(y[2]-y[0]);
b[1]=((y[0]+y[2])-(a[1]*(x[0]+x[2])))/2;
px=(b[1]-b[0])/(a[0]-a[1]);
py=(a[0]*px)+b[0];
r=((x[0]-px)*(x[0]-px))+((y[0]-py)*(y[0]-py))
r=sqrt(r);
printf("%.3f %.3f %.3f\n",px+(1e-10),py+(1e-10),r+(1e-10));
}
return 0;
}
|
main.c: In function 'main':
main.c:7:36: error: expected expression before '%' token
7 | scanf("%lf%lf%lf%lf%lf%lf",%x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
| ^
main.c:14:54: error: expected ';' before 'r'
14 | r=((x[0]-px)*(x[0]-px))+((y[0]-py)*(y[0]-py))
| ^
| ;
15 | r=sqrt(r);
| ~
|
s608787538
|
p00010
|
C
|
#include <stdio.h>
#include <math.h>
int main(void){
double x1,x2,x3,y1,y2,y3;
double a1,b1,c1,a2,b2,b3;
double a_x,a_y,r,waru;
int kaisu,i;
scanf("%d",&kaisu);
for(i=0;i < kaisu;i++){
scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
a1 = (2*(x2-x1));
b1 = (2*(y2-y1));
c1 = (x1*x1 - x2*x2 + y1*y1 - y2*y2);
a2 = (2*(x3-x1));
b2 = (2*(y3-y1));
c2 = (x1*x1 - x3*x3 + y1*y1 - y3*y3);
waru = (a1*b2-a2*b1);
if(waru <= 0.000001 && waru >= -0.000001) waru += 0.000001;
a_x = (b1*c2-b2*c1)/(waru*1.0);
a_y = (c1*a2-c2*a1)/(waru*1.0);
r = sqrt( (x1-a_x)*(x1-a_x) + (y1-a_y)*(y1-a_y) );
if(((int)(a_x*10000)) % 10 > 4) a_x += 0.001;
if(((int)(a_y*10000)) % 10 > 4) a_y += 0.001;
if(((int)(r*10000)) % 10 > 4) r += 0.001;
if(a_x < 0.0001 && a_x > -0.0001) a_x = 0.00001;
if(a_y < 0.0001 && a_y > -0.0001) a_y = 0.00001;
if( r < 0.0001 && r > -0.0001) r = 0.00001;
printf("%.3f %.3f %.3f\n",a_x,a_y,r);
}
return 0;
}
|
main.c: In function 'main':
main.c:20:17: error: 'c2' undeclared (first use in this function); did you mean 'b2'?
20 | c2 = (x1*x1 - x3*x3 + y1*y1 - y3*y3);
| ^~
| b2
main.c:20:17: note: each undeclared identifier is reported only once for each function it appears in
|
s824337724
|
p00010
|
C
|
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
bool get_snb( double , double , double , double , double& , double& );
double get_distance( double , double , double , double );
int main(void)
{
double x1, x2, x3;
double y1, y2, y3;
double a[3] , b[3];
double px, py;
double r;
int n;
cin >> n;
for( int k = 0 ; k < n ; k++ )
{
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
int i = 0;
while(1)
{
if( get_snb( x1 , x2 , y1 , y2 , a[i] , b[i] ) == true ) i++;
if( get_snb( x1 , x3 , y1 , y3 , a[i] , b[i] ) == true )
{
i++;
if( i == 2 ) break;
}
if( get_snb( x2 , x3 , y2 , y3 , a[i] , b[i] ) == true )
{
i++;
if( i == 2 ) break;
}
}
px = -( b[0] - b[1] )/( a[0] - a[1] );
py = a[0] * px + b[0];
r = get_distance( x1 , px , y1 , py );
cout.setf( ios::fixed , ios::floatfield );
cout<< setprecision(3) << px << " " << py << " " << r << endl;
}
return 0;
}
bool get_snb( double x1 , double x2 , double y1 , double y2 , double& a , double& b )
{
double cx, cy;
a = -( x1 - x2 )/( y1 - y2 );
if( y1 - y2 <= 0.0001 && y1 - y2 >= -0.0001 ) return false;
if( x1 - x2 <= 0.0001 && x1 - x2 >= -0.0001 ) a = 0;
cx = ( x1 + x2 ) / 2;
cy = ( y1 + y2 ) / 2;
b = cy - a * cx;
return true;
}
double get_distance( double x1 , double x2 , double y1 , double y2 )
{
return sqrt( (x1-x2) * (x1-x2) + (y1-y2) * (y1-y2) );
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s211319642
|
p00010
|
C
|
include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PI 3.14159265358979323
int calc1(float a,float b,float c,float d,float e,float f,float *x,float *y);
//void quick(int *,long long,long long);
//int comp(char *a,char *b);
int main(){
float x1,y1,x2,y2,x3,y3,r1,r2;
scanf("%f",&x1);
while(scanf("%f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){
calc1(2*(x1-x2),2*(y1-y2),x1*x1-x2*x2+y1*y1-y2*y2,2*(x1-x3),2*(y1-y3),x1*x1-x3*x3+y1*y1-y3*y3,&r1,&r2);
printf("%.3f %.3f %.3f\n",r1,r2,sqrt( (x1-r1)*(x1-r1)+(y1-r2)*(y1-r2) ));
}
//for(i=0;i<=1000000000;i++);
return 0;
}
|
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
In file included from main.c:2:
/usr/include/stdlib.h:98:8: error: unknown type name 'size_t'
98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
| ^~~~~~
/usr/include/stdlib.h:57:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
56 | #include <bits/floatn.h>
+++ |+#include <stddef.h>
57 |
/usr/include/stdlib.h:531:25: error: unknown type name 'size_t'
531 | size_t __statelen) __THROW __nonnull ((2));
| ^~~~~~
/usr/include/stdlib.h:531:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:561:25: error: unknown type name 'size_t'
561 | size_t __statelen,
| ^~~~~~
/usr/include/stdlib.h:561:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:661:42: error: unknown type name 'size_t'
661 | extern void arc4random_buf (void *__buf, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:661:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:672:22: error: unknown type name 'size_t'
672 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
| ^~~~~~
/usr/include/stdlib.h:672:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:675:22: error: unknown type name 'size_t'
675 | extern void *calloc (size_t __nmemb, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:675:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:675:38: error: unknown type name 'size_t'
675 | extern void *calloc (size_t __nmemb, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:675:38: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:683:36: error: unknown type name 'size_t'
683 | extern void *realloc (void *__ptr, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:683:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:695:41: error: unknown type name 'size_t'
695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:695:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:695:57: error: unknown type name 'size_t'
695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:695:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:701:41: error: unknown type name 'size_t'
701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:701:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:701:57: error: unknown type name 'size_t'
701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:701:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from /usr/include/stdlib.h:706:
/usr/include/alloca.h:32:22: error: unknown type name 'size_t'
32 | extern void *alloca (size_t __size) __THROW;
| ^~~~~~
/usr/include/alloca.h:25:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
24 | #include <stddef.h>
+++ |+#include <stddef.h>
25 |
/usr/include/stdlib.h:712:22: error: unknown type name 'size_t'
712 | extern void *valloc (size_t __size) __THROW __attribute_malloc__
| ^~~~~~
/usr/include/stdlib.h:712:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:718:45: error: unknown type name 'size_t'
718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:718:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:718:65: error: unknown type name 'size_t'
718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:718:65: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:724:29: error: unknown type name 'size_t'
724 | extern void *aligned_alloc (size_t __alignment, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:724:29: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:724:49: error: unknown type name 'size_t'
724 | extern void *aligned_alloc (size_t __alignment, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:724:49: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:961:23: error: unknown type name 'size_t'
961 | size_t __nmemb, size_t __size, __compar_fn_t __compar)
| ^~~~~~
/usr/include/stdlib.h:961:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:961:39: error: unknown type name 'size_t'
961 | size_t __nmemb, size_t __size, __compar_fn_t __compar)
| ^~~~~~
/usr/include/stdlib.h:961:39: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:970:34: error: unknown type name 'size_t'
970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
| ^~~~~~
/usr/include/stdlib.h:970:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:970:50: error: unknown type name 'size_t'
970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
| ^~~~~~
/usr/include/stdlib.h:970:50: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1044:20: error: unknown type name 'size_t'
1044 | size_t __len) __THROW __nonnull ((3, 4, 5));
| ^~~~~~
/usr/include/stdlib.h:1044:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1047:20: error: unknown type name 'size_t'
1047 | size_t __len) __THROW __nonnull ((3, 4, 5));
| ^~~~~~
/usr/include/stdlib.h:1047:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1051:45: error: unknown type name 'size_t'
1051 | char *__restrict __buf, size_t __len)
| ^~~~~~
/usr/include/stdlib.h:1051:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1055:45: error: unknown type name 'size_t'
1055 | char *__restrict __buf, size_t __len)
| ^~~~~~
/usr/include/stdlib.h:1055:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1062:36: error: unknown type name 'size_t'
1062 | extern int mblen (const char *__s, size_t __n) __THROW;
| ^~~~~~
/usr/include/stdlib.h:1062:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1066:48: error: unknown type name 'size_t'
1066 | const char *__restrict __s, size_t __n) __THROW;
| ^~~~~~
/usr/include/stdlib.h:1066:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1073:8: error: unknown type name 'size_t'
1073 | extern size_t mbstowcs (wchar_t *__restrict __pwcs,
| ^~~~~~
/usr/include/stdlib.h:1073:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1074:53: error: unknown type name 'size_t'
1074 | const char *__restrict __s, size_t __n) __THROW
| ^~~~~~
/usr/include/stdlib.h:1074:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1077:8: error: unknown type name 'size_t'
1077 | extern size_t wcstombs (char *__restrict __s,
| ^~~~~~
/usr/include/stdlib.h:1077:8: note: 'size_t' is defined in header '<stddef.h>'; this is probab
|
s066927315
|
p00010
|
C
|
#define PI 3.14159265358979323
int calc1(float a,float b,float c,float d,float e,float f,float *x,float *y);
//void quick(int *,long long,long long);
//int comp(char *a,char *b);
int main(){
float x1,y1,x2,y2,x3,y3,r1,r2;
scanf("%f",&x1);
while(scanf("%f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){
calc1(2*(x1-x2),2*(y1-y2),x1*x1-x2*x2+y1*y1-y2*y2,2*(x1-x3),2*(y1-y3),x1*x1-x3*x3+y1*y1-y3*y3,&r1,&r2);
printf("%.3f %.3f %.3f\n",r1,r2,sqrt( (x1-r1)*(x1-r1)+(y1-r2)*(y1-r2) ));
}
//for(i=0;i<=1000000000;i++);
return 0;
}
int calc1(float a,float b,float c,float d,float e,float f,float *x,float *y){
if(a*e-b*d==0)
return 0;
*x=(c*e-b*f)/(a*e-b*d);
*y=(a*f-d*c)/(a*e-b*d);
return 1;
}
|
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
11 | scanf("%f",&x1);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #define PI 3.14159265358979323
main.c:11:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
11 | scanf("%f",&x1);
| ^~~~~
main.c:11:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:67: error: 'EOF' undeclared (first use in this function)
12 | while(scanf("%f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){
| ^~~
main.c:12:67: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:12:67: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
14 | printf("%.3f %.3f %.3f\n",r1,r2,sqrt( (x1-r1)*(x1-r1)+(y1-r2)*(y1-r2) ));
| ^~~~~~
main.c:14:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:49: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
14 | printf("%.3f %.3f %.3f\n",r1,r2,sqrt( (x1-r1)*(x1-r1)+(y1-r2)*(y1-r2) ));
| ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
+++ |+#include <math.h>
1 | #define PI 3.14159265358979323
main.c:14:49: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
14 | printf("%.3f %.3f %.3f\n",r1,r2,sqrt( (x1-r1)*(x1-r1)+(y1-r2)*(y1-r2) ));
| ^~~~
main.c:14:49: note: include '<math.h>' or provide a declaration of 'sqrt'
|
s034080019
|
p00010
|
C
|
//ヘッダファイル
#include<stdio.h>
#include<math.h>
//マクロ定義
#define DIM2 2
#define X 0
#define Y 1
//プロトタイプ宣言
double func_calAB(double num1, double num2);
double func_calC(double num1, double num2, double num3, double num4);
double func_calX(double a1, double a2, double b1, double b2, double c1, double c2);
double func_calY(double a1, double a2, double b1, double b2, double c1, double c2);
double func_calR(double p1[], double result[]);
main()
{
int n = 0, i = 0; //繰り返し回数制御変数
double p1[DIM2] = {0, 0}, p2[DIM2] = {0, 0}, p3[DIM2] = {0, 0}; //変数の宣言と初期化
double a1 = 0, a2 = 0, b1 = 0, b2 = 0, c1 = 0, c2 = 0;
double r = 0, result[DIM2] = {0, 0};
scanf("%d", &n); //繰り返し回数の入力
for(i = 0; i < n; i++)
{
//座標の入力を取得
scanf("%lf %lf %lf %lf %lf %lf", &p1[X], &p1[Y], &p2[X], &p2[Y], &p3[X], &p3[Y]);
a1 = func_calAB(p2[X], p1[X]);
b1 = func_calAB(p2[Y], p1[Y]);
c1 = func_calC(p1[X], p2[X], p1[Y], p2[Y]);
a2 = func_calAB(p3[X], p1[X]);
b2 = func_calAB(p3[Y], p1[Y]);
c2 = func_calC(p1[X], p3[X], p1[Y], p3[Y]);
result[X] = func_calX(a1, a2, b1, b2, c1, c2);
result[Y] = func_calY(a1, a2, b1, b2, c1, c2);
r = func_calR(result, p1);
printf("%.3lf %.3lf %.3lf\n", result[X], result[Y], r);
p1[DIM2] = {0, 0}, p2[DIM2] = {0, 0}, p3[DIM2] = {0, 0};
a1 = 0, a2 = 0, b1 = 0, b2 = 0, c1 = 0, c2 = 0;
r = 0, result[DIM2] = {0, 0};
}
return 0;
}
double func_calAB(double num1, double num2)
{
double result = 0;
result = 2 * (num1 - num2);
return result;
}
double func_calC(double num1, double num2, double num3, double num4)
{
double result = 0;
result = pow(num1, 2) - pow(num2, 2) + pow(num3, 2) - pow(num4, 2);
return result;
}
double func_calX(double a1, double a2, double b1, double b2, double c1, double c2)
{
double result = 0;
result = ((b1 * c2) - (b2 * c1)) / ((a1 * b2) - (a2 * b1));
return result;
}
double func_calY(double a1, double a2, double b1, double b2, double c1, double c2)
{
double result = 0;
result = ((c1 * a2) - (c2 * a1)) / ((a1 * b2) - (a2 * b1));
return result;
}
double func_calR(double p1[], double result[])
{
double r = 0;
r = sqrt(pow(p1[X] + result[X], 2) + pow(p1[Y] + result[Y], 2));
return r;
}
|
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int]
15 | main()
| ^~~~
main.c: In function 'main':
main.c:42:28: error: expected expression before '{' token
42 | p1[DIM2] = {0, 0}, p2[DIM2] = {0, 0}, p3[DIM2] = {0, 0};
| ^
main.c:44:40: error: expected expression before '{' token
44 | r = 0, result[DIM2] = {0, 0};
| ^
|
s932406771
|
p00010
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
double x[3],y[3],z[3],l,m,n,a,b,c,d,e,f;
int i,n;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
z[0]=-(x[0]*x[0]+y[0]*y[0]);
z[1]=-(x[1]*x[1]+y[1]*y[1]);
z[2]=-(x[2]*x[2]+y[2]*y[2]);
a=x[0]-x[1];
b=y[0]-y[1];
c=z[0]-z[1];
d=x[1]-x[2];
e=y[1]-y[2];
f=z[1]-z[2];
l=(c*d-a*f)/(b*d-a*e);
m=(c*e-b*f)/(a*e-b*d);
n=z[0]-(l*x[0]+m*y[0]);
a=l/(-2);
b=m/(-2);
c=a*a+b*b-l;
sqrt(c);
a*=1000;
b*=1000;
c*=1000;
a+=0.5;
b+=0.5;
c+=0.5;
d=(int)a;
e=(int)b;
f=(int)c;
a=(bouble)d/1000;
b=(bouble)e/1000;
c=(bouble)f/1000;
printf("%f %f %f\n",a,b,c);
}
return 0;
}
|
main.c: In function 'main':
main.c:5:15: error: conflicting types for 'n'; have 'int'
5 | int i,n;
| ^
main.c:4:35: note: previous declaration of 'n' with type 'double'
4 | double x[3],y[3],z[3],l,m,n,a,b,c,d,e,f;
| ^
main.c:34:12: error: 'bouble' undeclared (first use in this function); did you mean 'double'?
34 | a=(bouble)d/1000;
| ^~~~~~
| double
main.c:34:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:19: error: expected ';' before 'd'
34 | a=(bouble)d/1000;
| ^
| ;
main.c:35:19: error: expected ';' before 'e'
35 | b=(bouble)e/1000;
| ^
| ;
main.c:36:19: error: expected ';' before 'f'
36 | c=(bouble)f/1000;
| ^
| ;
|
s420589351
|
p00010
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
double x[3],y[3],z[3],l,m,n,a,b,c,d,e,f;
int i,h;
scanf("%d",&h);
for(i=0; i<n; i++){
scanf("%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
z[0]=-(x[0]*x[0]+y[0]*y[0]);
z[1]=-(x[1]*x[1]+y[1]*y[1]);
z[2]=-(x[2]*x[2]+y[2]*y[2]);
a=x[0]-x[1];
b=y[0]-y[1];
c=z[0]-z[1];
d=x[1]-x[2];
e=y[1]-y[2];
f=z[1]-z[2];
l=(c*d-a*f)/(b*d-a*e);
m=(c*e-b*f)/(a*e-b*d);
n=z[0]-(l*x[0]+m*y[0]);
a=l/(-2);
b=m/(-2);
c=a*a+b*b-l;
sqrt(c);
a*=1000;
b*=1000;
c*=1000;
a+=0.5;
b+=0.5;
c+=0.5;
d=(int)a;
e=(int)b;
f=(int)c;
a=(bouble)d/1000;
b=(bouble)e/1000;
c=(bouble)f/1000;
printf("%f %f %f\n",a,b,c);
}
return 0;
}
|
main.c: In function 'main':
main.c:34:12: error: 'bouble' undeclared (first use in this function); did you mean 'double'?
34 | a=(bouble)d/1000;
| ^~~~~~
| double
main.c:34:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:19: error: expected ';' before 'd'
34 | a=(bouble)d/1000;
| ^
| ;
main.c:35:19: error: expected ';' before 'e'
35 | b=(bouble)e/1000;
| ^
| ;
main.c:36:19: error: expected ';' before 'f'
36 | c=(bouble)f/1000;
| ^
| ;
|
s459898106
|
p00010
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
double x[3],y[3],z[3],l,m,n,a,b,c,d,e,f;
int i,h;
scanf("%d",&h);
for(i=0; i<n; i++){
scanf("%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2]);
z[0]=-(x[0]*x[0]+y[0]*y[0]);
z[1]=-(x[1]*x[1]+y[1]*y[1]);
z[2]=-(x[2]*x[2]+y[2]*y[2]);
a=x[0]-x[1];
b=y[0]-y[1];
c=z[0]-z[1];
d=x[1]-x[2];
e=y[1]-y[2];
f=z[1]-z[2];
l=(c*d-a*f)/(b*d-a*e);
m=(c*e-b*f)/(a*e-b*d);
n=z[0]-(l*x[0]+m*y[0]);
a=l/(-2);
b=m/(-2);
c=a*a+b*b-l;
sqrt(c);
a*=1000;
b*=1000;
c*=1000;
a+=0.5;
b+=0.5;
c+=0.5;
d=(int)a;
e=(int)b;
f=(int)c;
a=(double)d/1000;
b=(double)e/1000;
c=(double)f/1000;
printf("%f %f %f\n",a,b,c);
}
return 0;
|
main.c: In function 'main':
main.c:40:9: error: expected declaration or statement at end of input
40 | return 0;
| ^~~~~~
|
s435157148
|
p00010
|
C++
|
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main ()
{
int num;
double x1,y1,x2,y2,x3,y3;
cin >> num;
for( int i = 0; i < num; i++ )
{
double px = 0, py = 0, r = 0;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
px = ((x1*x1-x3*x3+y1*y1-y3*y3)*(y2-y1)-(x1*x1-x2*x2+y1*y1-y2*y2)*(y3-y1)) / (2*(x2-x1)*(y3-y1)-2*(x3-x1)*(y2-y1));
py = ((x1-x3)(x1*x1 -x2*x2 +y1*y1 -y2*y2)-(x1-x2)*(x1*x1-x3*x3+y1*y1-y3*y3)) / (2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));
//py = ((2*(x1-x2)*px+x2*x2-x1*x1+y2*y2-y1*y1)) / (2*(y2-y1));
r = sqrt((px-x1)*(px-x1) + (py-y1)*(py-y1));
cout << fixed;
cout << setprecision(3) << px << " " << py << " " << r << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:22: error: expression cannot be used as a function
19 | py = ((x1-x3)(x1*x1 -x2*x2 +y1*y1 -y2*y2)-(x1-x2)*(x1*x1-x3*x3+y1*y1-y3*y3)) / (2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s973640799
|
p00010
|
C++
|
#include<stdio.h>
#include<math.h>
double x1, y1, x2, y2, x3, y3;
double px, py;
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
double A1 =(x2*x2+y2*y2-x1*x1-y1*y1)*(y3-y1);
double B1 =(x3*x3+y3*y3-x1*x1-y1*y1)*(y2-y1);
double A2 =(x3*x3+y3*y3-x1*x1-y1*y1)*(x2-x1);
double B2 =(x2*x2+y2*y2-x1*x1-y1*y1)*(x3-x1);
double D = (x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
double X=(double)(A1-B1)/D/2;
double Y=(double)(A2-B2)/D/2;
double R = sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1));
printf("%.3f %.3f %.3f\n",X,Y,R);
}
return 0;
}
|
a.cc:3:12: error: 'double y1' redeclared as different kind of entity
3 | double x1, y1, x2, y2, x3, y3;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:28,
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:12:41: error: invalid operands of types 'double(double) noexcept' and 'double(double) noexcept' to binary 'operator*'
12 | double A1 =(x2*x2+y2*y2-x1*x1-y1*y1)*(y3-y1);
| ~~^~~
| | |
| | double(double) noexcept
| double(double) noexcept
a.cc:12:49: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
12 | double A1 =(x2*x2+y2*y2-x1*x1-y1*y1)*(y3-y1);
| ~~^~~
| | |
| | double(double) noexcept
| double
a.cc:13:41: error: invalid operands of types 'double(double) noexcept' and 'double(double) noexcept' to binary 'operator*'
13 | double B1 =(x3*x3+y3*y3-x1*x1-y1*y1)*(y2-y1);
| ~~^~~
| | |
| | double(double) noexcept
| double(double) noexcept
a.cc:13:49: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
13 | double B1 =(x3*x3+y3*y3-x1*x1-y1*y1)*(y2-y1);
| ~~^~~
| | |
| | double(double) noexcept
| double
a.cc:14:41: error: invalid operands of types 'double(double) noexcept' and 'double(double) noexcept' to binary 'operator*'
14 | double A2 =(x3*x3+y3*y3-x1*x1-y1*y1)*(x2-x1);
| ~~^~~
| | |
| | double(double) noexcept
| double(double) noexcept
a.cc:15:41: error: invalid operands of types 'double(double) noexcept' and 'double(double) noexcept' to binary 'operator*'
15 | double B2 =(x2*x2+y2*y2-x1*x1-y1*y1)*(x3-x1);
| ~~^~~
| | |
| | double(double) noexcept
| double(double) noexcept
a.cc:16:31: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
16 | double D = (x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
| ~~^~~
| | |
| | double(double) noexcept
| double
a.cc:16:39: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
16 | double D = (x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
| ~~^~~
| | |
| | double(double) noexcept
| double
a.cc:19:41: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
19 | double R = sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1));
| ~^~~
| | |
| | double(double) noexcept
| double
a.cc:19:48: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
19 | double R = sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1));
| ~^~~
| | |
| | double(double) noexcept
| double
|
s747645947
|
p00010
|
C++
|
#include<stdio.h>
#include<math.h>
double x1, y1, x2, y2, x3, y3;
double px, py;
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
double A1 =(x2*x2+y2*y2-x1*x1-y1*y1)*(y3-y1);
double B1 =(x3*x3+y3*y3-x1*x1-y1*y1)*(y2-y1);
double A2 =(x3*x3+y3*y3-x1*x1-y1*y1)*(x2-x1);
double B2 =(x2*x2+y2*y2-x1*x1-y1*y1)*(x3-x1);
double D = (x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
double X=(A1-B1)/D/2;
double Y=(A2-B2)/D/2;
double R = sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1));
printf("%.3f %.3f %.3f\n",X,Y,R);
}
return 0;
}
|
a.cc:3:12: error: 'double y1' redeclared as different kind of entity
3 | double x1, y1, x2, y2, x3, y3;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:28,
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:12:41: error: invalid operands of types 'double(double) noexcept' and 'double(double) noexcept' to binary 'operator*'
12 | double A1 =(x2*x2+y2*y2-x1*x1-y1*y1)*(y3-y1);
| ~~^~~
| | |
| | double(double) noexcept
| double(double) noexcept
a.cc:12:49: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
12 | double A1 =(x2*x2+y2*y2-x1*x1-y1*y1)*(y3-y1);
| ~~^~~
| | |
| | double(double) noexcept
| double
a.cc:13:41: error: invalid operands of types 'double(double) noexcept' and 'double(double) noexcept' to binary 'operator*'
13 | double B1 =(x3*x3+y3*y3-x1*x1-y1*y1)*(y2-y1);
| ~~^~~
| | |
| | double(double) noexcept
| double(double) noexcept
a.cc:13:49: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
13 | double B1 =(x3*x3+y3*y3-x1*x1-y1*y1)*(y2-y1);
| ~~^~~
| | |
| | double(double) noexcept
| double
a.cc:14:41: error: invalid operands of types 'double(double) noexcept' and 'double(double) noexcept' to binary 'operator*'
14 | double A2 =(x3*x3+y3*y3-x1*x1-y1*y1)*(x2-x1);
| ~~^~~
| | |
| | double(double) noexcept
| double(double) noexcept
a.cc:15:41: error: invalid operands of types 'double(double) noexcept' and 'double(double) noexcept' to binary 'operator*'
15 | double B2 =(x2*x2+y2*y2-x1*x1-y1*y1)*(x3-x1);
| ~~^~~
| | |
| | double(double) noexcept
| double(double) noexcept
a.cc:16:31: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
16 | double D = (x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
| ~~^~~
| | |
| | double(double) noexcept
| double
a.cc:16:39: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
16 | double D = (x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
| ~~^~~
| | |
| | double(double) noexcept
| double
a.cc:19:41: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
19 | double R = sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1));
| ~^~~
| | |
| | double(double) noexcept
| double
a.cc:19:48: error: invalid operands of types 'double' and 'double(double) noexcept' to binary 'operator-'
19 | double R = sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1));
| ~^~~
| | |
| | double(double) noexcept
| double
|
s221964269
|
p00010
|
C++
|
#include<iostream>
#include<cmath>
using namespace std;
int main(void){
int n;
cin >> n;
double x1,x2,x3,y1,y2,y3;
for(int i = 0 ; i < n ; i ++){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
double a = x2 * x2 - x1 * x1 + y2 * y2 - y1 * y1;
double b = x3 * x3 - x1 * x1 + y3 * y3 - y1 * y1);
double x = (2 * (y3 - y1) * a - 2 * (y2 - y1) * b ) / c;
double y = (2 * (x3 - x1) * a - 2 * (x2 - x1) * b ) / c;
double r = sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
printf("%.3f %.3f %.3f\n",x,y,r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:65: error: expected ',' or ';' before ')' token
13 | double b = x3 * x3 - x1 * x1 + y3 * y3 - y1 * y1);
| ^
a.cc:15:71: error: 'c' was not declared in this scope
15 | double x = (2 * (y3 - y1) * a - 2 * (y2 - y1) * b ) / c;
| ^
|
s048781996
|
p00010
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
double heronsMethod(double a, double b, double c){
double s = (a + b + c) / 2;
return sqrt(s * (s - a) * (s - b) * (s - c));
}
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++){
double x1, x2, x3, y1, y2, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
double a = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
double b = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
double c = sqrt((x3 - x1) * (x3 - x1) + (y3 - y1) * (y3 - y1));
double s = heronsMethod(a, b, c);
double x = (a*a * (b*b + c*c - a*a) *x3 + b*b * (c*c + a*a - b*b) *x1 + c*c *(a*a + b*b - c*c) *x2) / (16 * s * s);
double y = (a*a * (b*b + c*c - a*a) *y3 + b*b * (c*c + a*a - b*b) *y1 + c*c *(a*a + b*b - c*c) *y2) / (16 * s * s);
double r = (a * b * c) / sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c));
printf("%.3f %.3f %.3f\n", x, y, r);
}
}
|
a.cc: In function 'double heronsMethod(double, double, double)':
a.cc:7:16: error: 'sqrt' was not declared in this scope
7 | return sqrt(s * (s - a) * (s - b) * (s - c));
| ^~~~
a.cc: In function 'int main()':
a.cc:17:28: error: 'sqrt' was not declared in this scope
17 | double a = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
| ^~~~
|
s120788680
|
p00010
|
C++
|
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
using namespace std;
#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)
#define X real()
#define Y imag()
typedef complex<double> P;
class C:public P{
public:
double r;
C(double x,double y,double r):P(x,y),r(r){}
};
template<class T> sq(T x){return x*x;}
double dot(P a, P b){return a.X*b.X + a.Y*b.Y;}
P solve_eq2(double a,double b,double c,double d,double e,double f){
double A = a*e-b*d;
return P((c*e-b*f)/A, (a*f-c*d)/A);
}
C C_PPP(P a,P b,P c){
P d = b-a;
P e = c-a;
double z1 = -dot(a,a);
double z2 = -dot(b,b);
double z3 = -dot(c,c);
P f = solve_eq2(d.X, d.Y, z2-z1, e.X, e.Y, z3-z1);
double u = z1-dot(a,f);
return C(-f.X/2, -f.Y/2, sqrt(dot(f,f)/4-u));
}
int main(){
int n;
cin>>n;
rep(i,n){
double xa,ya,xb,yb,xc,yc;
cin>>xa>>ya>>xb>>yb>>xc>>yc;
C circle = C_PPP(P(xa,ya),P(xb,yb),P(xc,yc));
printf("%.3lf %.3lf %.3lf\n",circle.X,circle.Y,circle.r);
}
}
|
a.cc:26:19: error: ISO C++ forbids declaration of 'sq' with no type [-fpermissive]
26 | template<class T> sq(T x){return x*x;}
| ^~
|
s333916480
|
p00010
|
C++
|
#include<iostrea>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
double x[3], y[3], mx, my, lx, ly, dm, dl, cx, cy, r;
for(int i=0; i<3; i++){
cin >> x[i] >> y[i];
}
mx = (x1 + x2) / 2;
my = (y1 + y2) / 2;
dm = (y1 - y2) / (x1 - y2);
lx = (x2 + x3) / 2;
ly = (y2 + y3) / 2;
dl = (y2 - y3) / (x2 - x3);
cx = (my + dm * mx) - (ly + dl * lx);
cy = (ly + dl * lx) * dm - (my + dm * mx) * dl;
r = sqrt((x1 - cx) * (x1 - cx) + (y1 - cy) * (y1 - cy));
cx = round(cx * 1000) / 1000;
cy = round(cy * 1000) / 1000;
r = round(r * 1000) / 1000;
printf("%.3d %.3d %.3d\n", cx, cy, r);
return 0;
}
|
a.cc:1:9: fatal error: iostrea: No such file or directory
1 | #include<iostrea>
| ^~~~~~~~~
compilation terminated.
|
s921727009
|
p00010
|
C++
|
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
double x[3], y[3], mx, my, lx, ly, dm, dl, cx, cy, r;
for(int i=0; i<3; i++){
cin >> x[i] >> y[i];
}
mx = (x1 + x2) / 2;
my = (y1 + y2) / 2;
dm = (y1 - y2) / (x1 - y2);
lx = (x2 + x3) / 2;
ly = (y2 + y3) / 2;
dl = (y2 - y3) / (x2 - x3);
cx = (my + dm * mx) - (ly + dl * lx);
cy = (ly + dl * lx) * dm - (my + dm * mx) * dl;
r = sqrt((x1 - cx) * (x1 - cx) + (y1 - cy) * (y1 - cy));
cx = round(cx * 1000) / 1000;
cy = round(cy * 1000) / 1000;
r = round(r * 1000) / 1000;
printf("%.3d %.3d %.3d\n", cx, cy, r);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:9: error: 'x1' was not declared in this scope; did you mean 'x'?
14 | mx = (x1 + x2) / 2;
| ^~
| x
a.cc:14:14: error: 'x2' was not declared in this scope; did you mean 'x'?
14 | mx = (x1 + x2) / 2;
| ^~
| x
a.cc:15:14: error: 'y2' was not declared in this scope; did you mean 'y'?
15 | my = (y1 + y2) / 2;
| ^~
| y
a.cc:17:14: error: 'x3' was not declared in this scope; did you mean 'x'?
17 | lx = (x2 + x3) / 2;
| ^~
| x
a.cc:18:14: error: 'y3' was not declared in this scope; did you mean 'y'?
18 | ly = (y2 + y3) / 2;
| ^~
| y
a.cc:23:40: error: invalid operands of types 'double(double) noexcept' and 'double' to binary 'operator-'
23 | r = sqrt((x1 - cx) * (x1 - cx) + (y1 - cy) * (y1 - cy));
| ~~ ^ ~~
| | |
| | double
| double(double) noexcept
a.cc:23:52: error: invalid operands of types 'double(double) noexcept' and 'double' to binary 'operator-'
23 | r = sqrt((x1 - cx) * (x1 - cx) + (y1 - cy) * (y1 - cy));
| ~~ ^ ~~
| | |
| | double
| double(double) noexcept
|
s682416456
|
p00010
|
C++
|
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
double x[3], y[3], mx, my, lx, ly, dm, dl, cx, cy, r;
for(int i=0; i<3; i++){
cin >> x[i] >> y[i];
}
mx = (x1 + x2) / 2;
my = (y1 + y2) / 2;
dm = (y1 - y2) / (x1 - y2);
lx = (x2 + x3) / 2;
ly = (y2 + y3) / 2;
dl = (y2 - y3) / (x2 - x3);
cx = (my + dm * mx) - (ly + dl * lx);
cy = (ly + dl * lx) * dm - (my + dm * mx) * dl;
r = sqrt((x1 - cx) * (x1 - cx) + (y1 - cy) * (y1 - cy));
cx = round(cx * 1000) / 1000;
cy = round(cy * 1000) / 1000;
r = round(r * 1000) / 1000;
printf("%.3f %.3f %.3f\n", cx, cy, r);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:9: error: 'x1' was not declared in this scope; did you mean 'x'?
14 | mx = (x1 + x2) / 2;
| ^~
| x
a.cc:14:14: error: 'x2' was not declared in this scope; did you mean 'x'?
14 | mx = (x1 + x2) / 2;
| ^~
| x
a.cc:15:14: error: 'y2' was not declared in this scope; did you mean 'y'?
15 | my = (y1 + y2) / 2;
| ^~
| y
a.cc:17:14: error: 'x3' was not declared in this scope; did you mean 'x'?
17 | lx = (x2 + x3) / 2;
| ^~
| x
a.cc:18:14: error: 'y3' was not declared in this scope; did you mean 'y'?
18 | ly = (y2 + y3) / 2;
| ^~
| y
a.cc:23:40: error: invalid operands of types 'double(double) noexcept' and 'double' to binary 'operator-'
23 | r = sqrt((x1 - cx) * (x1 - cx) + (y1 - cy) * (y1 - cy));
| ~~ ^ ~~
| | |
| | double
| double(double) noexcept
a.cc:23:52: error: invalid operands of types 'double(double) noexcept' and 'double' to binary 'operator-'
23 | r = sqrt((x1 - cx) * (x1 - cx) + (y1 - cy) * (y1 - cy));
| ~~ ^ ~~
| | |
| | double
| double(double) noexcept
|
s219187790
|
p00010
|
C++
|
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
int num;
cin>>num;
for(int i=0;i<n;i++){
double a,b,c,d,e,f;
double x1,y1,x2,y2,x3,y3;
cin>>x1>>y1>>x2>>y2>>x3>>y3;
a=x1-x2;
b=y1-y2;
c=x2-x3;
d=y2-y3;
e=(x2*x2+y2*y2)-(x1*x1+y1*y1);
f=(x3*x3+y3*y3)-(x2*x2+y2*y2);
double l=(e*d-f*b)/(a*d-c*b);
double m=(c*e-a*f)/(c*b-a*d);
double n=-1*x1*x1-(y1*y1)-l*x1-m*y1;
double x=-1*l/2.0;
double y=-1*m/2.0;
double r=sqrt(l*l+m*m-4*n)/2.0;
printf("%.3f %.3f %3f\n",x,y,r);
}
}
|
a.cc: In function 'int main()':
a.cc:9:23: error: 'n' was not declared in this scope
9 | for(int i=0;i<n;i++){
| ^
|
s155022260
|
p00010
|
C++
|
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<list>
#include<stack>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;
struct Coor{
double x,y;
};
struct Ans2{
double l,m;
};
struct Ans3{
double l,m,n;
Ans3(Ans2 &a){
l=a.l; m=a.m;
}
};
Ans2 solve2(double l[2],double m[2],double n[2]){
/*for(int i=0;i<2;i++){
printf("(%lfl)+(%lfm)+n = (%lf)\n",l[i],m[i],n[i]);
}*/
Ans2 ans;
double a,b;
a = l[0]*m[1]-l[1]*m[0]; b = n[0]*m[1]-n[1]*m[0];
ans.l = b/a;
//printf("%lfx = %lf\n",a,b);
a = m[0]*l[1]-m[1]*l[0]; b = n[0]*l[1]-n[1]*l[0];
ans.m = b/a;
//printf("%lfy = %lf\n",a,b);
return ans;
}
Ans3 solve3(double l[3],double m[3],double n[3]){
double _l[2],_m[2],_n[2];
_l[0] = l[0]-l[1]; _l[1] = l[0]-l[2];
_m[0] = m[0]-m[1]; _m[1] = m[0]-m[2];
_n[0] = n[0]-n[1]; _n[1] = n[0]-n[2];
Ans3 ans = Ans3(solve2(_l,_m,_n));
ans.n = n[0]-(l[0]*ans.l+m[0]*ans.m);
return ans;
}
int main(){
int N;
cin>>N;
for(int i=0;i<N;i++){
Coor in[3];
double l[3],m[3],n[3];
for(int i=0;i<3;i++){
cin>>in[i].x>>in[i].y;
l[i] = in[i].x;
m[i] = in[i].y;
n[i] = -(in[i].x*in[i].x+in[i].y*in[i].y);
//printf("(%lfl)+(%lfm)+n = (%lf)\n",l[i],m[i],n[i]);
}
Ans3 ans3 = solve3(l,m,n);
//printf("l = %lf, m = %lf, n = %lf\n",ans3.l,ans3.m,ans3.n);
double r = sqrt(-(ans3.n-ans3.l/2*ans3.l/2-ans3.m/2*ans3.m/2));
printf("%.3lf %.3lf %.3lf\n",-ans3.l/2,-ans3.m/2,r);
}
}
|
a.cc: In function 'Ans3 solve3(double*, double*, double*)':
a.cc:51:31: error: cannot bind non-const lvalue reference of type 'Ans2&' to an rvalue of type 'Ans2'
51 | Ans3 ans = Ans3(solve2(_l,_m,_n));
| ~~~~~~^~~~~~~~~~
a.cc:26:20: note: initializing argument 1 of 'Ans3::Ans3(Ans2&)'
26 | Ans3(Ans2 &a){
| ~~~~~~^
|
s486863932
|
p00010
|
C++
|
#include<stdio.h>
#include<math.h>
int main(void)
{
double x1,x2,x3,y1,y2,y3,x,y ,r ,a ;
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&x2,&x3,&y1,&y2,&y3)!=EOF){
a=(x1*x1+x2*x2-x3*x3)/2*x1*x2;
r=x3/(2*sin(double a));
|
a.cc: In function 'int main()':
a.cc:10:13: error: expected primary-expression before 'double'
10 | r=x3/(2*sin(double a));
| ^~~~~~
a.cc:10:24: error: expected '}' at end of input
10 | r=x3/(2*sin(double a));
| ^
a.cc:8:64: note: to match this '{'
8 | while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&x2,&x3,&y1,&y2,&y3)!=EOF){
| ^
a.cc:10:24: error: expected '}' at end of input
10 | r=x3/(2*sin(double a));
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s426710606
|
p00010
|
C++
|
import java.util.Scanner;
import java.math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
for(int i=0;i<n;i++){
double x1,y1,x2,y2,x3,y3;
x1=sc.nextDouble();
y1=sc.nextDouble();
x2=sc.nextDouble();
y2=sc.nextDouble();
x3=sc.nextDouble();
y3=sc.nextDouble();
double a=(x1*x1-x2*x2)*(y2-y3)-(x2*x2-x3*x3)-(y1-y2)*(y2-y3)*(y3-y1);
double b=2*((x1-x2)*(y2-y3)-(x2-x3)*(y1-y2));
double px=a/b;
double py;
if(y2!=y3){
py=(px-(x2+x3)/2)*(x3-x2)/(y2-y3)+(y2+y3)/2;
}
else{
py=(px-(x2+x1)/2)*(x1-x2)/(y2-y1)+(y2+y1)/2;
}
double r=Math.hypot(px-x1,py-y1);
BigDecimal x=new BigDecimal(px);
BigDecimal y=new BigDecimal(py);
BigDecimal z=new BigDecimal(r);
x=x.setScale(3,BigDecimal.ROUND_HALF_UP);
y=y.setScale(3,BigDecimal.ROUND_HALF_UP);
z=z.setScale(3,BigDecimal.ROUND_HALF_UP);
System.out.println(x.doubleValue()+" "+y.doubleValue()+" "+z.doubleValue());
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.math.BigDecimal;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:7: error: expected ':' before 'static'
5 | public static void main(String[] args){
| ^~~~~~~
| :
a.cc:5:25: error: 'String' has not been declared
5 | public static void main(String[] args){
| ^~~~~~
a.cc:5:34: error: expected ',' or '...' before 'args'
5 | public static void main(String[] args){
| ^~~~
a.cc:36:2: error: expected ';' after class definition
36 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:6:1: error: 'Scanner' was not declared in this scope
6 | Scanner sc=new Scanner(System.in);
| ^~~~~~~
a.cc:7:7: error: 'sc' was not declared in this scope
7 | int n=sc.nextInt();
| ^~
a.cc:26:10: error: 'Math' was not declared in this scope
26 | double r=Math.hypot(px-x1,py-y1);
| ^~~~
a.cc:27:1: error: 'BigDecimal' was not declared in this scope
27 | BigDecimal x=new BigDecimal(px);
| ^~~~~~~~~~
a.cc:28:12: error: expected ';' before 'y'
28 | BigDecimal y=new BigDecimal(py);
| ^
a.cc:29:12: error: expected ';' before 'z'
29 | BigDecimal z=new BigDecimal(r);
| ^
a.cc:30:1: error: 'x' was not declared in this scope
30 | x=x.setScale(3,BigDecimal.ROUND_HALF_UP);
| ^
a.cc:31:1: error: 'y' was not declared in this scope
31 | y=y.setScale(3,BigDecimal.ROUND_HALF_UP);
| ^
a.cc:32:1: error: 'z' was not declared in this scope
32 | z=z.setScale(3,BigDecimal.ROUND_HALF_UP);
| ^
a.cc:33:1: error: 'System' was not declared in this scope
33 | System.out.println(x.doubleValue()+" "+y.doubleValue()+" "+z.doubleValue());
| ^~~~~~
|
s879891734
|
p00010
|
C++
|
int main(){
double x1 , y1 , x2 , y2 , x3 , y3;
double a1 , b1 , c1 , a2 , b2 , c2;
double a , b , c;
double px , py , r;
double tmp;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
a1=2*(x2-x1);
b1=2*(y2-y1);
c1=x1*x1-x2*x2+y1*y1-y2*y2;
a2=2*(x3-x1);
b2=2*(y3-y1);
c2=x1*x1-x3*x3-y1*y1-y3*y3;
px=(b1*c2-b2*c1)/(a1*b2-a2*b1);
py=(c1*a2-c2*a1)/(a1*b2-a2*b1);
a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
b=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
c=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
//(a/(2*r))*(a/(2*r))+((b*b-c*c-2a)/2*b*c)*((b*b-c*c-2a)/2*b*c)=1
r=a/(2*sqrt(1-((b*b+c*c-a*a)/(2*b*c))*((b*b+c*c-a*a)/(2*b*c))));
tmp=px*1000+0.5;
px=(int)tmp;
px/=1000;
tmp=px*1000+0.5;
py=(int)tmp;
py/=1000;
tmp=r*1000+0.5;
r=(int)tmp;
r/=1000;
cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~~
a.cc:16:11: error: 'sqrt' was not declared in this scope
16 | a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
| ^~~~
a.cc:30:9: error: 'cout' was not declared in this scope
30 | cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
| ^~~~
a.cc:30:17: error: 'fixed' was not declared in this scope
30 | cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
| ^~~~~
a.cc:30:26: error: 'setprecision' was not declared in this scope
30 | cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
| ^~~~~~~~~~~~
a.cc:30:76: error: 'endl' was not declared in this scope
30 | cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
| ^~~~
|
s672421640
|
p00010
|
C++
|
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
int n;
double x1 , y1 , x2 , y2 , x3 , y3;
double a1 , b1 , c1 , a2 , b2 , c2;
double a , b , c;
double px , py , r;
double tmp;
cin >> n;
while(1){
if(n==0) break;
n--;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
a1=2*(x2-x1);
b1=2*(y2-y1);
c1=(x1*x1-x2*x2+y1*y1-y2*y2);
a2=2*(x3-x1);
b2=2*(y3-y1);
c2=(x1*x1-x3*x3+y1*y1-y3*y3);
px=(b1*c2-b2*c1)/(a1*b2-a2*b1);
py=(c1*a2-c2*a1)/(a1*b2-a2*b1);
a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
b=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
c=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
r=a/(2*sqrt(1-((b*b+c*c-a*a)/(2*b*c))*((b*b+c*c-a*a)/(2*b*c))));
tmp=px*1000+0.5;
px=(int)tmp;
px/=1000;
tmp=px*1000+0.5;
py=(int)tmp;
py/=1000;
tmp=r*1000+0.5;
r=(int)tmp;
r/=1000;
cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
12 | cin >> n;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <cmath>
+++ |+#include <iostream>
3 | using namespace std;
a.cc:38:17: error: 'cout' was not declared in this scope
38 | cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
| ^~~~
a.cc:38:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s829887130
|
p00010
|
C++
|
//#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>
using namespace std;
int main(){
int n;
double ax, ay, bx, by, cx, cy;
double A, B, C,S2;
double x, y,r;
cin >> n;
while (n--){
cin >> ax >> ay >> bx >> by >> cx >> cy;
A = (bx - cx)*(bx - cx) + (by - cy)*(by - cy);
B = (cx - ax)*(cx - ax) + (cy - ay)*(cy - ay);
C = (bx - ax)*(bx - ax) + (by - ay)*(by - ay);
S2 = A*(B + C - A) + B*(C + A - B) + C*(A + B - C);
x = (A*(B + C - A)*ax + B*(C + A - B)*bx + C*(A + B - C)*cx) / S2;
y = (A*(B + C - A)*ay + B*(C + A - B)*by + C*(A + B - C)*cy) / S2;
r = sqrt((x - ax)*(x - ax) + (y - ay)*(y - ay));
printf("%.3f %.3f %.3f\n", x, y, r);
}
}
|
a.cc: In function 'int main()':
a.cc:38:21: error: 'sqrt' was not declared in this scope
38 | r = sqrt((x - ax)*(x - ax) + (y - ay)*(y - ay));
| ^~~~
|
s518129468
|
p00010
|
C++
|
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
long n,i;
double x1,y1,x2,y2,x3,y3,Px,Py,r,a1,b1,c1,a2,b2,c2;
cin>>n;
for(i=0;i<n;i++){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
a1=(x2-x1)*2;
b1=(y2-y1)*2;
c1=x1*x1-x2*x2+y1*y1-y2*y2;
a2=(x3-x1)*2;
b2=(y3-y1)*2;
c2=x1*x1-x3*x3+y1*y1-y3*y3;
Px=(b1*c2-b2*c1)/(a1*b2-a2*b1);
Py=(c1*a2-c2*a1)/(a1*b2-a2*b1);
r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
printf("%.3f %.3f %.3f\n",Px,Py,r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:12: error: 'x' was not declared in this scope
20 | r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
| ^
a.cc:20:26: error: 'y' was not declared in this scope
20 | r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
| ^
|
s423187789
|
p00010
|
C++
|
#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main()
{
long n,i;
double x1,y1,x2,y2,x3,y3,Px,Py,r,a1,b1,c1,a2,b2,c2;
cin>>n;
for(i=0;i<n;i++){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
a1=(x2-x1)*2;
b1=(y2-y1)*2;
c1=x1*x1-x2*x2+y1*y1-y2*y2;
a2=(x3-x1)*2;
b2=(y3-y1)*2;
c2=x1*x1-x3*x3+y1*y1-y3*y3;
Px=(b1*c2-b2*c1)/(a1*b2-a2*b1);
Py=(c1*a2-c2*a1)/(a1*b2-a2*b1);
r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
printf("%.3f %.3f %.3f\n",Px,Py,r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:12: error: 'x' was not declared in this scope
20 | r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
| ^
a.cc:20:26: error: 'y' was not declared in this scope
20 | r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
| ^
|
s304382692
|
p00010
|
C++
|
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main()
{
long n,i;
double x1,y1,x2,y2,x3,y3,Px,Py,r,a1,b1,c1,a2,b2,c2;
cin>>n;
for(i=0;i<n;i++){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
a1=(x2-x1)*2;
b1=(y2-y1)*2;
c1=x1*x1-x2*x2+y1*y1-y2*y2;
a2=(x3-x1)*2;
b2=(y3-y1)*2;
c2=x1*x1-x3*x3+y1*y1-y3*y3;
Px=(b1*c2-b2*c1)/(a1*b2-a2*b1);
Py=(c1*a2-c2*a1)/(a1*b2-a2*b1);
r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
printf("%.3f %.3f %.3f\n",Px,Py,r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:12: error: 'x' was not declared in this scope
20 | r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
| ^
a.cc:20:26: error: 'y' was not declared in this scope
20 | r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
| ^
|
s784763897
|
p00010
|
C++
|
#include <stdio.h>
#include <math.h>
#define SQ(x) ((x) * (x))
int main(void)
{
int s;
int i;
double x1, x2, x3;
double y1, y2, y3;
double a, b, c, d, e, f;
double l, m, n;
scanf("%d", &s);
for (i = 0; i < s; i++){
scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3);
a = (x1 - x2);
b = (y1 - y2);
c = -1 * (SQ(x1) - SQ(x2) + SQ(y1) - SQ(y2));
d = (x1 - x3);
e = (y1 - y3);
f = -1 * (SQ(x1) - SQ(x3) + SQ(y1) - SQ(y3));
l = (c * e - b * f) / (e * a - b * d);
m = (d * c - a * f) / (d * b - e * a);
n = -1 * (SQ(x1) + SQ(y1) + l * x1 + m * y1);
printf("%.3f %.3f %.3f\n", l / -2.0, m / -2.0, sqrt(SQ(l) + SQ(m) - 4 * n) / 2.0);
}
return (0);
|
a.cc: In function 'int main()':
a.cc:34:16: error: expected '}' at end of input
34 | return (0);
| ^
a.cc:7:1: note: to match this '{'
7 | {
| ^
|
s691563647
|
p00010
|
C++
|
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main(){
int cnt;
cin >> cnt;
double x1, y1, x2, y2, x3, y3;
double a1, a2, b1, b2, c1, c2;
double a, b, c;
double A;
double xp, yp, r;
while(cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
// ?????\??????????????§?¨?????±???????
a1 = 2 * (x2 - x1);
b1 = 2 * (y2 - y1);
c1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
a2 = 2 * (x3 - x1);
b2 = 2 * (y3 - y1);
c2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
xp = (double)((b1*c2 - b2*c1)/(a1*b2 - a2*b1)*1000) / 1000.0;
yp = (double)((c1*a2 - c2*a1)/(a1*b2 - a2*b1)*1000) / 1000.0;
r=hypot(xp-x1,yp-y1);
cout << fixed << setprecision(3);
cout << xp << " " << yp << " " << r << endl;
cnt -= 1;
}
return 0
|
a.cc: In function 'int main()':
a.cc:32:13: error: expected ';' at end of input
32 | return 0
| ^
| ;
a.cc:32:13: error: expected '}' at end of input
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s452634915
|
p00010
|
C++
|
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main(){
int cnt;
cin >> cnt;
double x1, y1, x2, y2, x3, y3;
double a1, a2, b1, b2, c1, c2;
double a, b, c;
double A;
double xp, yp, r;
while(cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
// ?????\??????????????§?¨?????±???????
a1 = 2 * (x2 - x1);
b1 = 2 * (y2 - y1);
c1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
a2 = 2 * (x3 - x1);
b2 = 2 * (y3 - y1);
c2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
xp = (double)((b1*c2 - b2*c1)/(a1*b2 - a2*b1)*1000) / 1000.0;
yp = (double)((c1*a2 - c2*a1)/(a1*b2 - a2*b1)*1000) / 1000.0;
// ?????\????????????????±???????
a = sqrt(pow(x2-x3, 2.0) + pow(y2-y3, 2.0));
b = sqrt(pow(x1-x3, 2.0) + pow(y1-y3, 2.0));
c = sqrt(pow(x1-x2, 2.0) + pow(y1-y2, 2.0));
A = acos((b*b+c*c-a*a)/(2.0*b*c));
r = a/(sin(A)*2.0);
cout << fixed << setprecision(3);
cout << xp << " " << yp << " " << r << endl;
cnt -= 1;
}
return 0;
|
a.cc: In function 'int main()':
a.cc:38:14: error: expected '}' at end of input
38 | return 0;
| ^
a.cc:8:11: note: to match this '{'
8 | int main(){
| ^
|
s134272551
|
p00010
|
C++
|
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main(){
int cnt;
cin >> cnt;
double x1, y1, x2, y2, x3, y3;
double a1, a2, b1, b2, c1, c2;
double a, b, c;
double A;
double xp, yp, r;
while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
// ?????\??????????????§?¨?????±???????
a1 = 2 * (x2 - x1);
b1 = 2 * (y2 - y1);
c1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
a2 = 2 * (x3 - x1);
b2 = 2 * (y3 - y1);
c2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
xp = (double)((b1*c2 - b2*c1) / (a1*b2 - a2*b1) * 1000) / 1000.0;
yp = (double)((c1*a2 - c2*a1) / (a1*b2 - a2*b1) * 1000) / 1000.0;
// ?????\????????????????±???????
r = hypot(xp - x1, yp - y1);
cout << fixed << setprecision(3);
cout << xp << " " << yp << " " << r << endl;
cnt -= 1;
}
return 0;
}
|
a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s817742407
|
p00010
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
double marume( double x ){
long long t = x * 1000 + 0.5;
return t/1000.0;
}
int main(){
int n;
double tx, ty, x1, y1, x2, y2;
cin >> n;
while(n--){
cin >> tx >> ty >> x1 >> y1 >> x2 >> y2;
x1 -= tx; y1 -= ty;
x2 -= tx; y2 -= ty;
double dist1 = x1 * x1 + y1 * y1;
double dist2 = x2 * x2 + y2 * y2;
x1 *= 2; y1 *= 2;
y1 *= 2; y2 *= 2;
double detA = x1 * y2 - x2 * y1;
double detX = dist1 * y2 - y1 * dist2;
double detY = x1 * dist2 - dist1 * x1;
double x = detX / detA;
double y = detY / detA;
double r = hypot(x, y);
x = marume(x);
y = marume(y);
r = marume(r);
printf("%.3f %.3f %.3f\n", x, y, r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:30:28: error: 'hypot' was not declared in this scope
30 | double r = hypot(x, y);
| ^~~~~
|
s287422253
|
p00010
|
C++
|
#include<iostream>
#include<string>
#include <iomanip>
using namespace std;
int main() {
int n;
cin >> n;
float x1, y1, x2, y2, x3, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
float px, py, r;
float A1, B1, C1, A2, B2, C2;
A1 = 2 * (x2 - y2);
B1 = 2*(y2 - y1);
C1 = x1*x1 - x2*x2 + y1*y1 - y2*y2;
A2 = 2 * (x3 - x1);
B2 = 2 * (y3 - y1);
C2 = x1*x1 - x3*x3 + y1*y1 - y3*y3;
px = (B1*C2 - B2*C1) / (A1*B2 - A2*B1);
py = (C1*A2 - C2*A1) / (A1*B2 - A2*B1);
r = sqrt((x1-px)*(x1-px)+(y1-py)*(y1-py));
px = round(px * 1000) / 1000;
py = round(py * 1000) / 1000;
r = round(r * 1000) / 1000;
cout <<fixed << setprecision(4) << px << " ";
cout << fixed << setprecision(4) << py << " ";
cout<< fixed << setprecision(4) << r << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:23:13: error: 'sqrt' was not declared in this scope
23 | r = sqrt((x1-px)*(x1-px)+(y1-py)*(y1-py));
| ^~~~
a.cc:25:14: error: 'round' was not declared in this scope
25 | px = round(px * 1000) / 1000;
| ^~~~~
|
s166624034
|
p00010
|
C++
|
int main(){
int cnt;
cin >> cnt;
??? double x1, y1, x2, y2, x3, y3;
???double a1, a2, b1, b2, c1, c2;
???double xp, yp, r;
while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
a1 = 2 * (x2 - x1);
b1 = 2 * (y2 - y1);
c1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
a2 = 2 * (x3 - x1);
b2 = 2 * (y3 - y1);
c2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
xp = (double)(b1*c2 - b2*c1) / (a1*b2 - a2*b1);
yp = (double)(c1*a2 - c2*a1) / (a1*b2 - a2*b1);
r = hypot(xp - x1, yp - y1);
printf("%.3f %.3f %.3f\n", xp,yp,r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> cnt;
| ^~~
a.cc:4:4: error: expected primary-expression before '?' token
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^
a.cc:4:5: error: expected primary-expression before '?' token
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^
a.cc:4:6: error: expected primary-expression before '?' token
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^
a.cc:4:8: error: expected primary-expression before 'double'
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~
a.cc:4:7: error: expected ':' before 'double'
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~~
| :
a.cc:4:8: error: expected primary-expression before 'double'
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~
a.cc:4:7: error: expected ':' before 'double'
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~~
| :
a.cc:4:8: error: expected primary-expression before 'double'
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~
a.cc:4:7: error: expected ':' before 'double'
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~~
| :
a.cc:4:8: error: expected primary-expression before 'double'
4 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~
a.cc:5:5: error: expected primary-expression before '?' token
5 | ???double a1, a2, b1, b2, c1, c2;
| ^
a.cc:5:6: error: expected primary-expression before '?' token
5 | ???double a1, a2, b1, b2, c1, c2;
| ^
a.cc:5:7: error: expected primary-expression before '?' token
5 | ???double a1, a2, b1, b2, c1, c2;
| ^
a.cc:5:8: error: expected primary-expression before 'double'
5 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
a.cc:5:8: error: expected ':' before 'double'
5 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
| :
a.cc:5:8: error: expected primary-expression before 'double'
5 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
a.cc:5:8: error: expected ':' before 'double'
5 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
| :
a.cc:5:8: error: expected primary-expression before 'double'
5 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
a.cc:5:8: error: expected ':' before 'double'
5 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
| :
a.cc:5:8: error: expected primary-expression before 'double'
5 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
a.cc:6:5: error: expected primary-expression before '?' token
6 | ???double xp, yp, r;
| ^
a.cc:6:6: error: expected primary-expression before '?' token
6 | ???double xp, yp, r;
| ^
a.cc:6:7: error: expected primary-expression before '?' token
6 | ???double xp, yp, r;
| ^
a.cc:6:8: error: expected primary-expression before 'double'
6 | ???double xp, yp, r;
| ^~~~~~
a.cc:6:8: error: expected ':' before 'double'
6 | ???double xp, yp, r;
| ^~~~~~
| :
a.cc:6:8: error: expected primary-expression before 'double'
6 | ???double xp, yp, r;
| ^~~~~~
a.cc:6:8: error: expected ':' before 'double'
6 | ???double xp, yp, r;
| ^~~~~~
| :
a.cc:6:8: error: expected primary-expression before 'double'
6 | ???double xp, yp, r;
| ^~~~~~
a.cc:6:8: error: expected ':' before 'double'
6 | ???double xp, yp, r;
| ^~~~~~
| :
a.cc:6:8: error: expected primary-expression before 'double'
6 | ???double xp, yp, r;
| ^~~~~~
a.cc:8:30: error: 'x1' was not declared in this scope
8 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:8:36: error: 'y1' was not declared in this scope
8 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:8:42: error: 'x2' was not declared in this scope
8 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:8:48: error: 'y2' was not declared in this scope
8 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:8:54: error: 'x3' was not declared in this scope
8 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:8:60: error: 'y3' was not declared in this scope
8 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:9:9: error: 'a1' was not declared in this scope
9 | a1 = 2 * (x2 - x1);
| ^~
a.cc:10:9: error: 'b1' was not declared in this scope
10 | b1 = 2 * (y2 - y1);
| ^~
a.cc:11:9: error: 'c1' was not declared in this scope
11 | c1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
| ^~
a.cc:12:9: error: 'a2' was not declared in this scope
12 | a2 = 2 * (x3 - x1);
| ^~
a.cc:13:9: error: 'b2' was not declared in this scope
13 | b2 = 2 * (y3 - y1);
| ^~
a.cc:14:9: error: 'c2' was not declared in this scope
14 | c2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
| ^~
a.cc:15:9: error: 'xp' was not declared in this scope
15 | xp = (double)(b1*c2 - b2*c1) / (a1*b2 - a2*b1);
| ^~
a.cc:16:9: error: 'yp' was not declared in this scope
16 | yp = (double)(c1*a2 - c2*a1) / (a1*b2 - a2*b1);
| ^~
a.cc:18:9: error: 'r' was not declared in this scope
18 | r = hypot(xp - x1, yp - y1);
| ^
a.cc:18:13: error: 'hypot' was not declared in this scope
18 | r = hypot(xp - x1, yp - y1);
| ^~~~~
a.cc:20:9: error: 'printf' was not declared in this scope
20 | printf("%.3f %.3f %.3f\n", xp,yp,r);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main(){
|
s915220625
|
p00010
|
C++
|
using namespace std;
int main(){
int cnt;
cin >> cnt;
??? double x1, y1, x2, y2, x3, y3;
???double a1, a2, b1, b2, c1, c2;
???double xp, yp, r;
while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
a1 = 2 * (x2 - x1);
b1 = 2 * (y2 - y1);
c1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
a2 = 2 * (x3 - x1);
b2 = 2 * (y3 - y1);
c2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
xp = (double)((b1*c2 - b2*c1) / (a1*b2 - a2*b1) * 1000) / 1000.0;
yp = (double)((c1*a2 - c2*a1) / (a1*b2 - a2*b1) * 1000) / 1000.0;
//
r = hypot(xp - x1, yp - y1);
cout<< setprecision(3)<< xp << " " << yp << " " << r << endl;
cnt -= 1;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >> cnt;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:7:4: error: expected primary-expression before '?' token
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^
a.cc:7:5: error: expected primary-expression before '?' token
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^
a.cc:7:6: error: expected primary-expression before '?' token
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^
a.cc:7:8: error: expected primary-expression before 'double'
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~
a.cc:7:7: error: expected ':' before 'double'
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~~
| :
a.cc:7:8: error: expected primary-expression before 'double'
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~
a.cc:7:7: error: expected ':' before 'double'
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~~
| :
a.cc:7:8: error: expected primary-expression before 'double'
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~
a.cc:7:7: error: expected ':' before 'double'
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~~
| :
a.cc:7:8: error: expected primary-expression before 'double'
7 | ??? double x1, y1, x2, y2, x3, y3;
| ^~~~~~
a.cc:8:5: error: expected primary-expression before '?' token
8 | ???double a1, a2, b1, b2, c1, c2;
| ^
a.cc:8:6: error: expected primary-expression before '?' token
8 | ???double a1, a2, b1, b2, c1, c2;
| ^
a.cc:8:7: error: expected primary-expression before '?' token
8 | ???double a1, a2, b1, b2, c1, c2;
| ^
a.cc:8:8: error: expected primary-expression before 'double'
8 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
a.cc:8:8: error: expected ':' before 'double'
8 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
| :
a.cc:8:8: error: expected primary-expression before 'double'
8 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
a.cc:8:8: error: expected ':' before 'double'
8 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
| :
a.cc:8:8: error: expected primary-expression before 'double'
8 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
a.cc:8:8: error: expected ':' before 'double'
8 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
| :
a.cc:8:8: error: expected primary-expression before 'double'
8 | ???double a1, a2, b1, b2, c1, c2;
| ^~~~~~
a.cc:9:5: error: expected primary-expression before '?' token
9 | ???double xp, yp, r;
| ^
a.cc:9:6: error: expected primary-expression before '?' token
9 | ???double xp, yp, r;
| ^
a.cc:9:7: error: expected primary-expression before '?' token
9 | ???double xp, yp, r;
| ^
a.cc:9:8: error: expected primary-expression before 'double'
9 | ???double xp, yp, r;
| ^~~~~~
a.cc:9:8: error: expected ':' before 'double'
9 | ???double xp, yp, r;
| ^~~~~~
| :
a.cc:9:8: error: expected primary-expression before 'double'
9 | ???double xp, yp, r;
| ^~~~~~
a.cc:9:8: error: expected ':' before 'double'
9 | ???double xp, yp, r;
| ^~~~~~
| :
a.cc:9:8: error: expected primary-expression before 'double'
9 | ???double xp, yp, r;
| ^~~~~~
a.cc:9:8: error: expected ':' before 'double'
9 | ???double xp, yp, r;
| ^~~~~~
| :
a.cc:9:8: error: expected primary-expression before 'double'
9 | ???double xp, yp, r;
| ^~~~~~
a.cc:11:30: error: 'x1' was not declared in this scope
11 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:11:36: error: 'y1' was not declared in this scope
11 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:11:42: error: 'x2' was not declared in this scope
11 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:11:48: error: 'y2' was not declared in this scope
11 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:11:54: error: 'x3' was not declared in this scope
11 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:11:60: error: 'y3' was not declared in this scope
11 | while (cnt > 0 && cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3) {
| ^~
a.cc:12:9: error: 'a1' was not declared in this scope
12 | a1 = 2 * (x2 - x1);
| ^~
a.cc:13:9: error: 'b1' was not declared in this scope
13 | b1 = 2 * (y2 - y1);
| ^~
a.cc:14:9: error: 'c1' was not declared in this scope
14 | c1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
| ^~
a.cc:15:9: error: 'a2' was not declared in this scope
15 | a2 = 2 * (x3 - x1);
| ^~
a.cc:16:9: error: 'b2' was not declared in this scope
16 | b2 = 2 * (y3 - y1);
| ^~
a.cc:17:9: error: 'c2' was not declared in this scope
17 | c2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
| ^~
a.cc:18:9: error: 'xp' was not declared in this scope
18 | xp = (double)((b1*c2 - b2*c1) / (a1*b2 - a2*b1) * 1000) / 1000.0;
| ^~
a.cc:19:9: error: 'yp' was not declared in this scope
19 | yp = (double)((c1*a2 - c2*a1) / (a1*b2 - a2*b1) * 1000) / 1000.0;
| ^~
a.cc:22:9: error: 'r' was not declared in this scope
22 | r = hypot(xp - x1, yp - y1);
| ^
a.cc:22:13: error: 'hypot' was not declared in this scope
22 | r = hypot(xp - x1, yp - y1);
| ^~~~~
a.cc:24:9: error: 'cout' was not declared in this scope
24 | cout<< setprecision(3)<< xp << " " << yp << " " << r << endl;
| ^~~~
a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:16: error: 'setprecision' was not declared in this scope
24 | cout<< setprecision(3)<< xp << " " << yp << " " << r << endl;
| ^~~~~~~~~~~~
a.cc:1:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
+++ |+#include <iomanip>
1 | using namespace std;
a.cc:24:65: error: 'endl' was not declared in this scope
24 | cout<< setprecision(3)<< xp << " " << yp << " " << r << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s986400193
|
p00010
|
C++
|
#! -*- coding:utf-8 -*-
import math
n = input()
for x in xrange(n):
x1,y1,x2,y2,x3,y3 = map(float,raw_input().split())
a1 = 2.0*(x2-x1)
b1 = 2.0*(y2-y1)
x12 = x1**2
y12 = y1**2
c1 = x12-x2**2+y12+y2**2
a2 = 2.0*(x3-x1)
b2 = 2.0*(y3-y1)
c2 = x12-x3**2+y12-y3**2
denom=(a1*b2-a2*b1)
x = (b1*c2-b2*c1)/denom
y = (c1*a2-c2*a1)/denom
r = math.sqrt((x-x1)**2+(y-y1)**2)
print "%.3f %.3f %.3f"%(x,y,r)
|
a.cc:1:2: error: invalid preprocessing directive #!
1 | #! -*- coding:utf-8 -*-
| ^
a.cc:2:1: error: 'import' does not name a type
2 | import math
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
|
s073449542
|
p00010
|
C++
|
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int n;
int x1,x2,x3,y1,y2,y3;
cin>>n;
while(n--)
{
double x,y,r,dx,dy;
cin>>x1<<y1<<x2<<y2<,x3<<y3;
dx=(x2+x3-2*x1)/2;
dy=(y2+y3-2*y1)/2;
x=x1+dx;
y=y1+dy;
r=sqrt(dx*dx+dy*dy);
printf("%.3f %.3f %.3f\n",x,y,r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:16: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ~~~~~~~^~~~
| | |
| | int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:13:16: note: candidate: 'operator<<(int, int)' (built-in)
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ~~~~~~~^~~~
a.cc:13:16: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:13:12: note: cannot convert 'std::cin.std::basic_istream<char>::operator>>(x1)' (type 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'}) to type 'std::byte'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ~~~^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:13:18: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | cin>>x1<<y1<<x2<<y2<,x3<<y3;
| ^~
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'temp
|
s135638763
|
p00010
|
C++
|
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int w(int n)
{
return n * n;
}
int main()
{
double x1, y1, x2, y2, x3, y3;
int n;
double a, b, c;
double px, py, r;
cin >> n;
for (int i = 0; i < n; i++){
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
a = sqrt(w(x1 - x2) + w(y1 - y2));
b = sqrt(w(x2 - x3) + w(y2 - y3));
c = sqrt(w(x3 - x1) + w(y3 - y1));
px = ((y1 - y3) * (w(y1) - w(y2) + w(x1) - w(x2)) - (y1 - y2) * (w(y1) - w(y3) + w(x1) - w(x3))) / (2 * (y1 - y3) * (x1 - x2) - 2 * (y1 - y2) * (x1 - x3));
py = ((x1 - x3) * (w(x1) - w(x2) + w(y1) - w(y2)) - (x1 - x2) * (w(x1) - w(x3) + w(y1) - w(y3))) / (2 * (x1 - x3) * (y1 - y2) - 2 * (x1 - x2) * (y1 - y3));
//r = (a * b * c) / sqrt((a + b + c) * (b + c - a) * (a - b + c) * (a + b - c));
x = ((a*a)-((b*b)+(c*c)))/(-2*b*c);
y = sqrt(1-x*x);
r = a/(2*y);
printf("%.3f %.3f %.3f\n", px, py, r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:29:5: error: 'x' was not declared in this scope
29 | x = ((a*a)-((b*b)+(c*c)))/(-2*b*c);
| ^
a.cc:30:5: error: 'y' was not declared in this scope
30 | y = sqrt(1-x*x);
| ^
|
s689907498
|
p00010
|
C++
|
#include <iostream>
int main(){
int n;
double a,b,c,d,e,f;
double x1,x2,x3,y1,y2,y3;
double px,py;
double r;
cin >> n;
for(int i=0;i<n;i++){
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
a = (x2-x1)*2.0;
b = (y2-y1)*2.0;
c = (x2*x2 + y2*y2 - x1*x1 - y1*y1);
d = (x3-x1)*2.0;
e = (y3-y1)*2.0;
f = (x3*x3 + y3*y3 - x1*x1 - y1*y1);
px = (c*e-b*f)/(a*e-b*d);
py = (a*f-c*d)/(a*e-b*d);
r = sqrt((px-x1)*(px-x1) + (py-y1)*(py-y1));
printf("%.3f %.3f %.3f\n",px,py,r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
10 | 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:22:9: error: 'sqrt' was not declared in this scope
22 | r = sqrt((px-x1)*(px-x1) + (py-y1)*(py-y1));
| ^~~~
|
s940213838
|
p00010
|
C++
|
#include<iostream>
using namespace std;
class Point {
public:
double x, y;
};
double distance(Point x, Point y) {
return pow(pow(fabs(x.x - y.x), 2) + pow(fabs(x.y - y.y), 2), 0.5);
}
int main() {
Point p[3],s;
for (int i = 0; i < 3; i++) {
cin >> p[i].x >> p[i].y;
}
double a, b, c, d, e, f;
a = (-2)*p[0].x + 2 * p[1].x;
b = (-2)*p[0].y + 2 * p[1].y;
c = (-2)*p[0].x + 2 * p[2].x;
d = (-2)*p[0].y + 2 * p[2].y;
e = pow(p[0].x, 2) + pow(p[0].y, 2) - pow(p[1].x, 2) - pow(p[1].y, 2);
f = pow(p[0].x, 2) + pow(p[0].y, 2) - pow(p[2].x, 2) - pow(p[2].y, 2);
s.x = (b*f - d*e) / (a*d - b*c);
s.y = (a*f - c*e) / (b*c - a*d);
cout << s.x << " " << s.y << " " << distance(p[0], s) << endl;
return 0;
}
|
a.cc: In function 'double distance(Point, Point)':
a.cc:8:24: error: 'fabs' was not declared in this scope; did you mean 'labs'?
8 | return pow(pow(fabs(x.x - y.x), 2) + pow(fabs(x.y - y.y), 2), 0.5);
| ^~~~
| labs
a.cc:8:20: error: 'pow' was not declared in this scope
8 | return pow(pow(fabs(x.x - y.x), 2) + pow(fabs(x.y - y.y), 2), 0.5);
| ^~~
a.cc:8:16: error: 'pow' was not declared in this scope
8 | return pow(pow(fabs(x.x - y.x), 2) + pow(fabs(x.y - y.y), 2), 0.5);
| ^~~
a.cc: In function 'int main()':
a.cc:20:13: error: 'pow' was not declared in this scope
20 | e = pow(p[0].x, 2) + pow(p[0].y, 2) - pow(p[1].x, 2) - pow(p[1].y, 2);
| ^~~
|
s174946401
|
p00010
|
C++
|
#include<iostream>
using namespace std;
int main(){
int n;
double x[3], y[3], a, b, c, d, e, f, l , m, n;
cin >> n;
while(n--){
????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
a = 2 * (x[1] - x[0]);
b = 2 * (y[1] - y[0]);
c = ( (x[1]*x[1]) + (y[1]*y[1]) ) -( (x[0]*x[0]) + (y[0]*y[0]) );
d = 2 * (x[2] - x[0]);
e = 2 * (y[2] - y[0]);
f = ( (x[2]*x[2]) + (y[2]*y[2]) ) -( (x[0]*x[0]) + (y[0]*y[0]) );
l = (c*e - f*b) / (a*e - d*b);
m = (c*d - f*a) / (b*d - e*a);
n = sqrt((l - x[0])*(l - x[0]) + (m - y[0])*(m - y[0]));
cout << fixed << setprecision(3) << l << " " << m << " " << n << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:5:53: error: conflicting declaration 'double n'
5 | double x[3], y[3], a, b, c, d, e, f, l , m, n;
| ^
a.cc:4:13: note: previous declaration as 'int n'
4 | int n;
| ^
a.cc:8:1: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:2: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:3: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:4: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:5: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:6: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:7: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:8: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:9: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:10: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:11: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:12: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:13: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:14: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:15: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:16: error: expected primary-expression before '?' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:8:67: error: expected ':' before ';' token
8 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:8:67: error: expected primary-expression before ';' token
a.cc:21:21: error: 'sqrt' was not declared in this scope
21 | n = sqrt((l - x[0])*(l - x[0]) + (m - y[0])*(m - y[0]));
| ^~~~
a.cc:23:34: error: 'setprecision' was not declared in this scope
23 | cout << fixed << setprecision(3) << l << " " << m << " " << n << endl;
| ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
1 | #include<iostream>
+++ |+#include <iomanip>
2 | using namespace std;
|
s317741540
|
p00010
|
C++
|
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int k;
double x[3], y[3], a, b, c, d, e, f, l , m, n;
cin >> k;
while(k--){
????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
a = 2 * (x[1] - x[0]);
b = 2 * (y[1] - y[0]);
c = ( (x[1]*x[1]) + (y[1]*y[1]) ) -( (x[0]*x[0]) + (y[0]*y[0]) );
d = 2 * (x[2] - x[0]);
e = 2 * (y[2] - y[0]);
f = ( (x[2]*x[2]) + (y[2]*y[2]) ) -( (x[0]*x[0]) + (y[0]*y[0]) );
l = (c*e - f*b) / (a*e - d*b);
m = (c*d - f*a) / (b*d - e*a);
n = sqrt((l - x[0])*(l - x[0]) + (m - y[0])*(m - y[0]));
cout << fixed << setprecision(3) << l << " " << m << " " << n << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:9:1: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:2: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:3: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:4: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:5: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:6: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:7: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:8: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:9: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:10: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:11: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:12: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:13: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:14: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:15: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:16: error: expected primary-expression before '?' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:9:67: error: expected ':' before ';' token
9 | ????????????????cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
| ^
| :
a.cc:9:67: error: expected primary-expression before ';' token
a.cc:24:34: error: 'setprecision' was not declared in this scope
24 | cout << fixed << setprecision(3) << l << " " << m << " " << n << endl;
| ^~~~~~~~~~~~
a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
2 | #include<cmath>
+++ |+#include <iomanip>
3 | using namespace std;
|
s023163858
|
p00010
|
C++
|
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int k;
double x[3], y[3], a, b, c, d, e, f, l , m, n;
cin >> k;
while(k--){
cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
a = 2 * (x[1] - x[0]);
b = 2 * (y[1] - y[0]);
c = ( (x[1]*x[1]) + (y[1]*y[1]) ) -( (x[0]*x[0]) + (y[0]*y[0]) );
d = 2 * (x[2] - x[0]);
e = 2 * (y[2] - y[0]);
f = ( (x[2]*x[2]) + (y[2]*y[2]) ) -( (x[0]*x[0]) + (y[0]*y[0]) );
l = (c*e - f*b) / (a*e - d*b);
m = (c*d - f*a) / (b*d - e*a);
n = sqrt((l - x[0])*(l - x[0]) + (m - y[0])*(m - y[0]));
cout << fixed << setprecision(3) << l << " " << m << " " << n << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:19:18: error: 'setprecision' was not declared in this scope
19 | cout << fixed << setprecision(3) << l << " " << m << " " << n << endl;
| ^~~~~~~~~~~~
a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
2 | #include<cmath>
+++ |+#include <iomanip>
3 | using namespace std;
|
s515738617
|
p00010
|
C++
|
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int k;
double x[3], y[3], a, b, c, d, e, f, l , m, n;
cin >> k;
while(k--){
cin>> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
a = 2 * (x[1] - x[0]);
b = 2 * (y[1] - y[0]);
c = ( (x[1]*x[1]) + (y[1]*y[1]) ) -( (x[0]*x[0]) + (y[0]*y[0]) );
d = 2 * (x[2] - x[0]);
e = 2 * (y[2] - y[0]);
f = ( (x[2]*x[2]) + (y[2]*y[2]) ) -( (x[0]*x[0]) + (y[0]*y[0]) );
l = (c*e - f*b) / (a*e - d*b);
m = (c*d - f*a) / (b*d - e*a);
n = sqrt((l - x[0])*(l - x[0]) + (m - y[0])*(m - y[0]));
cout << fixed <<setprecision(3) << l << " " << m << " " << n << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:19:17: error: 'setprecision' was not declared in this scope
19 | cout << fixed <<setprecision(3) << l << " " << m << " " << n << endl;
| ^~~~~~~~~~~~
a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
2 | #include<cmath>
+++ |+#include <iomanip>
3 | using namespace std;
|
s210134748
|
p00010
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int d(int x1,int y1,int x2,int y2) {
int k;
k = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
return k;
}
int main()
{
int n;
cin >> n;
for (int k = 0; k < n; k++) {
int A[3][2];
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
cin >> A[i][j];
}
}
cout << d(A[0][0], A[0][1], A[1][0], A[1][1]) << endl;
cout << d(A[1][0], A[1][1], A[2][0], A[2][1]) << endl;
cout << d(A[2][0], A[2][1], A[0][0], A[0][1]) << endl;
}
return 0;
}
|
a.cc: In function 'int d(int, int, int, int)':
a.cc:7:9: error: 'sqrt' was not declared in this scope
7 | k = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
| ^~~~
|
s656669893
|
p00010
|
C++
|
#include <iostream>
#include <cstdio>
#define MAX 1000000
using namespace std;
int main() {
double x1, y1, x2, y2, x3, y3;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
double x = ((y1-y3)*(y1*y1-y2*y2+x1*x1-x2*x2)-(y1-y2)*(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)*(x1-x2)-2*(y1-y2)*(x1-x3));
double y = ((x1-x3)*(x1*x1-x2*x2+y1*y1-y2*y2)-(x1-x2)*(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));
printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:55: error: 'pow' was not declared in this scope
18 | printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
| ^~~
a.cc:18:50: error: 'sqrt' was not declared in this scope
18 | printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
| ^~~~
|
s041547947
|
p00010
|
C++
|
#include <iostream>
#include <stdio.h>
#define MAX 1000000
using namespace std;
int main() {
double x1, y1, x2, y2, x3, y3;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
double x = ((y1-y3)*(y1*y1-y2*y2+x1*x1-x2*x2)-(y1-y2)*(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)*(x1-x2)-2*(y1-y2)*(x1-x3));
double y = ((x1-x3)*(x1*x1-x2*x2+y1*y1-y2*y2)-(x1-x2)*(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));
printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:55: error: 'pow' was not declared in this scope
18 | printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
| ^~~
a.cc:18:50: error: 'sqrt' was not declared in this scope
18 | printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
| ^~~~
|
s439190058
|
p00010
|
C++
|
#include <iostream>
#include "stdio.h"
#define MAX 1000000
using namespace std;
int main() {
double x1, y1, x2, y2, x3, y3;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
double x = ((y1-y3)*(y1*y1-y2*y2+x1*x1-x2*x2)-(y1-y2)*(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)*(x1-x2)-2*(y1-y2)*(x1-x3));
double y = ((x1-x3)*(x1*x1-x2*x2+y1*y1-y2*y2)-(x1-x2)*(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));
printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:55: error: 'pow' was not declared in this scope
18 | printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
| ^~~
a.cc:18:50: error: 'sqrt' was not declared in this scope
18 | printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
| ^~~~
|
s679340639
|
p00010
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
double x1, y1, x2, y2, x3, y3;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
double x = ((y1-y3)*(y1*y1-y2*y2+x1*x1-x2*x2)-(y1-y2)*(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)*(x1-x2)-2*(y1-y2)*(x1-x3));
double y = ((x1-x3)*(x1*x1-x2*x2+y1*y1-y2*y2)-(x1-x2)*(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));
printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:55: error: 'pow' was not declared in this scope
16 | printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
| ^~~
a.cc:16:50: error: 'sqrt' was not declared in this scope
16 | printf("%.3f %.3f %.3f\n", x, y, sqrt(pow((x1 - x), 2) + pow((y1 - y), 2)));
| ^~~~
|
s801064231
|
p00010
|
C++
|
#include<iostream>
#include<math.h>
using namespace std;
#define MAX 256
float LOSER(float x){
if((int)(x*10000)%10 > 4)return x + 0.001;
return x;
}
int main(void){
int n,i = 0;
float x1,y1,x2,y2,x3,y3;
float px[MAX],py[MAX],r[MAX];
cin >> n;
while(i < n){
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
px[i] = ((y1-y3)(y1*y1-y2*y2+x1*x1-x2*x2)+(y1-y2)(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)(x1-x2)+2*(y1-y2)(x1-x3));
py[i] = ((x1-x3)(x1*x1-x2*x2+y1*y1-y2*y2)+(x1-x2)(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)(y1-y2)+2*(x1-x2)(y1-y3));
r[i] = sqrt((px[i]-x1)*(px[i]-x1)+(py[i]-y1)*(py[i]-y1));
LOSER(px[i]);
LOSER(py[i]);
LOSER(r[i]);
i++;
}
for(int i = 0;i < n;i++){
scanf("%.3f %.3f %.3f",px[i],py[i],r[i]);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:33: error: expression cannot be used as a function
21 | px[i] = ((y1-y3)(y1*y1-y2*y2+x1*x1-x2*x2)+(y1-y2)(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)(x1-x2)+2*(y1-y2)(x1-x3));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:66: error: expression cannot be used as a function
21 | px[i] = ((y1-y3)(y1*y1-y2*y2+x1*x1-x2*x2)+(y1-y2)(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)(x1-x2)+2*(y1-y2)(x1-x3));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:103: error: expression cannot be used as a function
21 | px[i] = ((y1-y3)(y1*y1-y2*y2+x1*x1-x2*x2)+(y1-y2)(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)(x1-x2)+2*(y1-y2)(x1-x3));
| ~~~~~~~^~~~~~~
a.cc:21:120: error: expression cannot be used as a function
21 | px[i] = ((y1-y3)(y1*y1-y2*y2+x1*x1-x2*x2)+(y1-y2)(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)(x1-x2)+2*(y1-y2)(x1-x3));
| ~~~~~~~^~~~~~~
a.cc:22:33: error: expression cannot be used as a function
22 | py[i] = ((x1-x3)(x1*x1-x2*x2+y1*y1-y2*y2)+(x1-x2)(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)(y1-y2)+2*(x1-x2)(y1-y3));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:66: error: expression cannot be used as a function
22 | py[i] = ((x1-x3)(x1*x1-x2*x2+y1*y1-y2*y2)+(x1-x2)(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)(y1-y2)+2*(x1-x2)(y1-y3));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:103: error: expression cannot be used as a function
22 | py[i] = ((x1-x3)(x1*x1-x2*x2+y1*y1-y2*y2)+(x1-x2)(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)(y1-y2)+2*(x1-x2)(y1-y3));
| ~~~~~~~^~~~~~~
a.cc:22:120: error: expression cannot be used as a function
22 | py[i] = ((x1-x3)(x1*x1-x2*x2+y1*y1-y2*y2)+(x1-x2)(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)(y1-y2)+2*(x1-x2)(y1-y3));
| ~~~~~~~^~~~~~~
|
s442578888
|
p00010
|
C++
|
#include<iostream>
#include<stdio,h>
#include<math.h>
using namespace std;
#define MAX 256
float LOSER(float x){
if((int)(x*10000)%10 > 4)return x + 0.001;
return x;
}
int main(void){
int n,i = 0;
float x1,y1,x2,y2,x3,y3;
float px[MAX],py[MAX],r[MAX];
cin >> n;
while(i < n){
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
px[i] = ((y1-y3)*(y1*y1-y2*y2+x1*x1-x2*x2)+(y1-y2)*(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)*(x1-x2)+2*(y1-y2)*(x1-x3));
py[i] = ((x1-x3)*(x1*x1-x2*x2+y1*y1-y2*y2)+(x1-x2)*(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)*(y1-y2)+2*(x1-x2)*(y1-y3));
r[i] = sqrt((px[i]-x1)*(px[i]-x1)+(py[i]-y1)*(py[i]-y1));
px[i]=LOSER(px[i]);
py[i]=LOSER(py[i]);
r[i]=LOSER(r[i]);
i++;
printf("%.3f %.3f %.3f",px[i],py[i],r[i]);
}
return 0;
}
|
a.cc:2:9: fatal error: stdio,h: No such file or directory
2 | #include<stdio,h>
| ^~~~~~~~~
compilation terminated.
|
s847999656
|
p00010
|
C++
|
#include <iostream>
#include <utility>
using namespace std;
class vec{
public:
double x;
double y;
double normEXP2() const{
return x*x + y*y;
}
vec& operator+(const vec& v){
x += v.x;
y += v.y;
return *this;
}
vec& operator-(const vec& v){
x -= v.x;
y -= v.y;
return *this;
}
vec& operator*(double scala){
x *= scala;
y *= scala;
return *this;
}
double operator*(const vec& v) const{
return x*v.x + y*v.y;
}
};
istream& operator>>(istream& i, vec& v){
i >> v.x >> v.y;
return i;
}
pair<double, double> cramer(const vec& a, const vec& b){
pair<double, double> solve;
solve.first = (2 * a.normEXP2()*b.normEXP2() - 2 * b.normEXP2()*(a*b)) / (4 * a.normEXP2()*b.normEXP2() - 4 * ((a*b)*(a*b)));
solve.second = (2 * a.normEXP2()*b.normEXP2() - 2 * a.normEXP2()*(a*b)) / (4 * a.normEXP2()*b.normEXP2() - 4 * ((a*b)*(a*b)));
return solve;
}
int main(){
int n;
vec v1, v2, v3;
vec b, c;
vec solveVec;
pair<double, double> solve;
double x, y;
double r;
cin >> n;
for (int i = 0; i < n; i++){
cin >> v1 >> v2 >> v3;
b = v2 - v1;
c = v3 - v1;
solve = cramer(b, c);
solveVec = (b*solve.first) + (c*solve.second);
solveVec = v1 + solveVec;
r = sqrt(solveVec.normEXP2());
y = (double)((int)((solveVec.y * 1000) + 0.5)) / 1000;
r = (double)((int)((r * 1000) + 0.5)) / 1000;
x = (double)((int)((solveVec.x * 1000) + 0.5)) / 1000;
printf("%.3lf %.3lf %.3lf\n", x, y, r);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:68:21: error: 'sqrt' was not declared in this scope
68 | r = sqrt(solveVec.normEXP2());
| ^~~~
|
s849255872
|
p00010
|
C++
|
#include <iostream>
#include <algorism>
#include <stdio.h>
#include <cmath>
using namespace std;
double min(double x0, double x1, double x2){ return min(min(x0, x1), x2); }
double max(double x0, double x1, double x2){ return max(max(x0, x1), x2); }
double d(double x, double y, double p, double q){ return sqrt((p-x)*(p-x)+(q-y)*(q-y)); }
double diff(double x0, double x1, double x2){ return max(x0,x1,x2)-min(x0,x1,x2); }
int main(){
double x[3], y[3];
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
double ax,ay, r;
double p, q;
ax = (max(x[0],x[1],x[2]) + min(x[0],x[1],x[2]))/2;
ay = (max(y[0],x[1],x[2]) + min(x[0],x[1],x[2]))/2;
p = (max(x[0],x[1],x[2]) + min(x[0],x[1],x[2]))/4;
q = (max(y[0],x[1],x[2]) + min(x[0],x[1],x[2]))/4;
for(int i=0; i<10; i++){
p = (max(x[0],x[1],x[2]) + min(x[0],x[1],x[2]))/4;
q = (max(y[0],x[1],x[2]) + min(x[0],x[1],x[2]))/4;
while(1){
if(diff(d(x[0],y[0],ax+p,ay),d(x[1],y[1],ax+p,ay),d(x[2],y[2],ax+p,ay)) > diff(d(x[0],y[0],ax-p,ay),d(x[1],y[1],ax-p,ay),d(x[2],y[2],ax-p,ay))){
ax -= p;
}
else if(diff(d(x[0],y[0],ax+p,ay),d(x[1],y[1],ax+p,ay),d(x[2],y[2],ax+p,ay)) < diff(d(x[0],y[0],ax-p,ay),d(x[1],y[1],ax-p,ay),d(x[2],y[2],ax-p,ay)) ){
ax += p;
}
if(p<0.0001) break;
p /= 2;
}
while(1){
if(diff(d(x[0],y[0],ax,ay+q),d(x[1],y[1],ax,ay+q),d(x[2],y[2],ax,ay+q)) > diff(d(x[0],y[0],ax,ay-q),d(x[1],y[1],ax,ay-q),d(x[2],y[2],ax,ay-q))){
ax -= q;
}
else if(diff(d(x[0],y[0],ax,ay+q),d(x[1],y[1],ax,ay+q),d(x[2],y[2],ax,ay+q)) < diff(d(x[0],y[0],ax,ay-q),d(x[1],y[1],ax,ay-q),d(x[2],y[2],ax,ay-q))){
ax += q;
}
if(q<0.0001) break;
q /= 2;
}
}
double a, b, c;
a = d(x[0],y[0],x[1],y[1]); b = d(x[1],y[1],x[2],y[2]); c = d(x[2],y[2],x[0],y[0]);
r = sqrt((a*a+b*b+c*c)*(a*a+b*b+c*c) - (a*a*a*a + b*b*b*b + c*c*c*c))/4;
r *= 2/(a+b+c);
printf("%.3f %.3f %.3f\n",ax, ay, r);
return 0;
}
|
a.cc:2:10: fatal error: algorism: No such file or directory
2 | #include <algorism>
| ^~~~~~~~~~
compilation terminated.
|
s352875870
|
p00010
|
C++
|
int main(void){
int n;
cin >> n;
for(int i = 0;i < n;i++){
double x1,y1,x2,y2,x3,y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
double a = sqrt(pow(x2-x1,2) + pow(y2-y1,2));
double b = sqrt(pow(x3-x2,2) + pow(y3-y2,2));
double c = sqrt(pow(x3-x1,2) + pow(y3-y1,2));
double r = a*b*c / sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c));
double A = pow(x2-x1,2) + pow(y2-y1,2);
double B = pow(x3-x2,2) + pow(y3-y2,2);
double C = pow(x3-x1,2) + pow(y3-y1,2);
double s = 4*((x2-x1)*(y3-y1) -(x3-x1)*(y2-y1));
double x = A*(B+C-A) / s;
double y = B*(C+A-B) / s;
printf("%.3f %.3f %.3f\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
4 | cin >> n;
| ^~~
a.cc:11:21: error: 'pow' was not declared in this scope
11 | double a = sqrt(pow(x2-x1,2) + pow(y2-y1,2));
| ^~~
a.cc:11:16: error: 'sqrt' was not declared in this scope
11 | double a = sqrt(pow(x2-x1,2) + pow(y2-y1,2));
| ^~~~
a.cc:25:5: error: 'printf' was not declared in this scope
25 | printf("%.3f %.3f %.3f\n");
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main(void){
|
s585521977
|
p00010
|
C++
|
#include <bits/stdc++.h>
#include <vector>
using namespace std;
double n, r, x1, y1, x2, y2, x3, y3, xa, ya, xb, yb, xc, yc, ma, mb, mc, y_hasil, x_hasil;
int main(){
cin >> n;
for(int i = 1; i <= n; i++){
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
ma = (x2-x1)/(y1-y2);
mb = (x3-x2)/(y2-y3);
mc = (x3-x1)/(y1-y3);
xa = (x1+x2)/2;
ya = (y1+y2)/2;
xb = (x2+x3)/2;
yb = (y2+y3)/2;
xc = (x3+x1)/2;
yc = (y3+y1)/2;
// cout << ma << " " << xa << " " << mb << " " << xb << " " << yb << " " << ya << "\n";
if(y1 - y2 == 0){
x_hasil = (x2 + x1) / 2;
y_hasil = mb*(x_hasil - xb) + yb;
}else if(y2 - y3 == 0){
x_hasil = (x2 + x3) / 2;
y_hasil = ma*(x_hasil - xa) + ya;
}else{
x_hasil = (ma*xa - mb*xb + yb - ya)/(ma - mb);
y_hasil = ma*(x_hasil - xa) + ya;
}
r = sqrt((x_hasil - x1)*(x_hasil - x1) + (y_hasil - y1)*(y_hasil - y1));
cout << fixed << setprecision(3) << x_hasil << " " << y_hasil << " " << r << "\n";
}
return 0;
}
|
a.cc:5:18: error: 'double y1' redeclared as different kind of entity
5 | double n, r, x1, y1, x2, y2, x3, y3, xa, ya, xb, yb, xc, yc, ma, mb, mc, y_hasil, x_hasil;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:27: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ~~~~~~~~~ ^~ ~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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:10:30: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
/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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: 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]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
|
|
s298150226
|
p00010
|
C++
|
#include <bits/stdc++.h>
#include <vector>
using namespace std;
double n, r, x1, y1, x2, y2, x3, y3, xa, ya, xb, yb, xc, yc, ma, mb, mc, y_hasil, x_hasil;
int main(){
cin >> n;
for(int i = 1; i <= n; i++){
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
ma = (x2-x1)/(y1-y2);
mb = (x3-x2)/(y2-y3);
mc = (x3-x1)/(y1-y3);
xa = (x1+x2)/2;
ya = (y1+y2)/2;
xb = (x2+x3)/2;
yb = (y2+y3)/2;
xc = (x3+x1)/2;
yc = (y3+y1)/2;
// cout << ma << " " << xa << " " << mb << " " << xb << " " << yb << " " << ya << "\n";
if(y1 - y2 == 0){
x_hasil = (x2 + x1) / 2;
y_hasil = mb*(x_hasil - xb) + yb;
}else if(y2 - y3 == 0){
x_hasil = (x2 + x3) / 2;
y_hasil = ma*(x_hasil - xa) + ya;
}else{
x_hasil = (ma*xa - mb*xb + yb - ya)/(ma - mb);
y_hasil = ma*(x_hasil - xa) + ya;
}
r = sqrt((x_hasil - x1)*(x_hasil - x1) + (y_hasil - y1)*(y_hasil - y1));
cout << fixed << setprecision(3) << x_hasil << " " << y_hasil << " " << r << "\n";
}
return 0;
}
|
a.cc:5:18: error: 'double y1' redeclared as different kind of entity
5 | double n, r, x1, y1, x2, y2, x3, y3, xa, ya, xb, yb, xc, yc, ma, mb, mc, y_hasil, x_hasil;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:27: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ~~~~~~~~~ ^~ ~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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:10:30: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
/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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
| ^~
| |
| double (*)(double) noexcept
a.cc:10:30: 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:10:30: 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]
10 | cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
|
|
s802848655
|
p00010
|
C++
|
#include <iostream>
#include <vector>
//#include <math.h>
//#include <string>
#include <cmath>
#include <iomanip>
int main();
double round(double dSrc, int iLen);
int main(){
int cnt = 0; //データセットの個数
double x1, y1, x2, y2, x3, y3;
std::vector<double> p; //外接円の中心のx座標
std::vector<double> q; //外接円の中心のy座標
std::vector<double> r; //外接円の半径
std::cin >> cnt;
for (int i = 0; i < cnt; i++){
std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
p.push_back(((y1 - y3) * (pow(y1, 2) - pow(y2, 2) + pow(x1, 2) - pow(x2, 2)) - (y1 - y2) * (pow(y1, 2) - pow(y3, 2) + pow(x1, 2) - pow(x3, 2))) / (2 * (y1 - y3) * (x1 - x2) - 2 * (y1 - y2) * (x1 - x3)));
q.push_back(((x1 - x3) * (pow(x1, 2) - pow(x2, 2) + pow(y1, 2) - pow(y2, 2)) - (x1 - x2) * (pow(x1, 2) - pow(x3, 2) + pow(y1, 2) - pow(y3, 2))) / (2 * (x1 - x3) * (y1 - y2) - 2 * (x1 - x2) * (y1 - y3)));
r.push_back(sqrt((pow((p[i] - x1), 2) + pow((q[i] - y1), 2))));
//#define AAA
#ifdef AAA
int temp = p[i];
if (p[i] - temp != 0){
p[i] = round(p[i], 3);
}
temp = q[i];
if (q[i] - temp != 0){
q[i] = round(q[i], 3);
}
temp = r[i];
if (r[i] - temp != 0){
r[i] = round(r[i], 3);
}
std::cout << std::fixed << std::setprecision(3) << p[i] << " " << q[i] << " " << r[i] << std::endl;
}
#endif
#ifndef AAA
for (int i = 0; i < cnt; i++){
int temp = p[i];
if (p[i] - temp != 0){
p[i] = round(p[i], 3);
}
temp = q[i];
if (q[i] - temp != 0){
q[i] = round(q[i], 3);
}
temp = r[i];
if (r[i] - temp != 0){
r[i] = round(r[i], 3);
}
std::cout << std::fixed << std::setprecision(3) << p[i] << " " << q[i] << " " << r[i] << std::endl;
}
#endif
//while (1);
return 0;
}
/**
* 指定桁で四捨五入を行う
* args:数値, 四捨五入する桁数
* return:結果
* 参考:http://oresi.hatenablog.com/entry/2014/06/23/【C%2CC%2B%2B】指定桁数で端数処理%EF%BC%88切り上げ、切り下げ
*/
double round(double dSrc, int iLen)
{
double dRet;
dRet = dSrc * pow(10.0, iLen);
dRet = (double)(int)(dRet + 0.5);
return dRet * pow(10.0, -iLen);
}
|
a.cc: In function 'int main()':
a.cc:76:1: error: a function-definition is not allowed here before '{' token
76 | {
| ^
a.cc:83:2: error: expected '}' at end of input
83 | }
| ^
a.cc:11:11: note: to match this '{'
11 | int main(){
| ^
|
s503331141
|
p00010
|
C++
|
#include<stdio.h>
#include<math.h>
int main(){
int a;
cin >>a;
while(a--){
double x1,y1,x2,y2,x3,y3;
cin >>x1 >>y1 >>x2 >> y2 >> x3 >> y3;
double a1=2*(x2-x1);
double b1=2*(y2-y1);
double c1=x1*x1-x2*x2+y1*y1-y2*y2;
double a2=2*(x3-x1);
double b2=2*(y3-y1);
double c2=x1*x1-x3*x3+y1*y1-y3*y3;
double x=(b1*c2-b2*c1)/(a1*b2-a2*b1);
double y=(c1*a2-c2*a1)/(a1*b2-a2*b1);
double r=hypot(x-x1,y-y1);
printf("%.3lf %.3lf %.3lf\n",x,y,r);
}
}
|
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
5 | cin >>a;
| ^~~
| sin
|
s176226079
|
p00010
|
C++
|
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
int a;
cin >>a;
while(a--){
double x1,y1,x2,y2,x3,y3;
cin >>x1 >>y1 >>x2 >> y2 >> x3 >> y3;
double a1=2*(x2-x1);
double b1=2*(y2-y1);
double c1=x1*x1-x2*x2+y1*y1-y2*y2;
double a2=2*(x3-x1);
double b2=2*(y3-y1);
double c2=x1*x1-x3*x3+y1*y1-y3*y3;
double x=(b1*c2-b2*c1)/(a1*b2-a2*b1);
double y=(c1*a2-c2*a1)/(a1*b2-a2*b1);
double r=hypot(x-x1,y-y1);
printf("%.3lf %.3lf %.3lf\n",x,y,r);
}
}
|
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >>a;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<math.h>
+++ |+#include <iostream>
3 | using namespace std;
|
s344077172
|
p00010
|
C++
|
#include <iostream>
#include <vector>
#include<iomanip>
using namespace std;
struct Circles {
double x;
double y;
double r;
};
Circles countCircle(double x1,double y1, double x2, double y2, double x3, double y3){
double a = ((y2 - y1)*(y3*y3 - y1 * y1 + x3 * x3 - x1 * x1) - (y3 - y1)*(y2*y2 - y1 * y1 + x2 * x2 - x1 * x1)) / (2.0*((x3 - x1)*(y2 - y1) - (x2 - x1)*(y3 - y1)));
double b = ((x2 - x1)*(x3*x3 - x1 * x1 + y3 * y3 - y1 * y1) - (x3 - x1)*(x2*x2 - x1 * x1 + y2 * y2 - y1 * y1)) / (2.0*((y3 - y1)*(x2 - x1) - (y2 - y1)*(x3 - x1)));
double r = sqrt((x1 - a)*(x1 - a) + (y1 - b)*(y1 - b));
return Circles{ a,b,r };
}
int main() {
vector<Circles> dst;
int n;
double x1, y1, x2, y2, x3, y3;
cin >> n;
while (n-->0) {
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
dst.push_back(countCircle(x1, y1, x2, y2, x3, y3));
}
for (vector<Circles>::iterator it = dst.begin(); it < dst.end(); it++) {
cout.setf(ios::fixed);
cout << fixed << setprecision(3) << (*it).x << " " << (*it).y << " " << (*it).r << endl;
}
return 0;
}
|
a.cc: In function 'Circles countCircle(double, double, double, double, double, double)':
a.cc:15:20: error: 'sqrt' was not declared in this scope
15 | double r = sqrt((x1 - a)*(x1 - a) + (y1 - b)*(y1 - b));
| ^~~~
|
s815538470
|
p00010
|
C++
|
# -*- coding: utf-8 -*-
from math import sqrt
# import numpy as np
n = int(input())
for i in range(n):
tmp = input().split(' ')
a, b, c = [(float(tmp[i]), float(tmp[i+1])) for i in range(0, len(tmp), 2)]
#A = np.array(((a[0], a[1], 1),
# (b[0], b[1], 1),
# (c[0], c[1], 1)))
A_tmp1 = 1/(a[0]*b[1] + a[1]*c[0] + b[0]*c[1] - b[1]*c[0] - a[1]*b[0] - a[0]*c[1])
A_tmp2 = [[b[1]-c[1], -(a[1]-c[1]), a[1]-b[1]],
[-(b[0]-c[0]), (a[0]-c[0]), -(a[0]-b[0])],
[b[0]*c[1] - b[1]*c[0], -(a[0]*c[1] - a[1]*c[0]), a[0]*b[1] - a[1]*b[0]]]
A = [list(map(lambda x: A_tmp1*x, A_tmp2[i])) for i in range(3)]
#B = np.array((((-(a[0]**2 + a[1]**2))),
# ((-(b[0]**2 + b[1]**2))),
# ((-(c[0]**2 + c[1]**2)))))
B = [[-(a[0]**2 + a[1]**2)],
[-(b[0]**2 + b[1]**2)],
[-(c[0]**2 + c[1]**2)]]
tmp = [sum([A[i][j]*B[j][0] for j in range(3)]) for i in range(3)]
# tmp = np.dot(np.linalg.inv(A), B)
print(tmp)
x = -tmp[0]/2
y = -tmp[1]/2
r = sqrt((tmp[0]**2 + tmp[1]**2 - 4*tmp[2])/4)
print('{:.3} {:.3} {:.3}'.format(x, y, r))
|
a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:3:3: warning: #import is a deprecated GCC extension [-Wdeprecated]
3 | # import numpy as np
| ^~~~~~
a.cc:3:10: error: #import expects "FILENAME" or <FILENAME>
3 | # import numpy as np
| ^~~~~
a.cc:13:6: error: invalid preprocessing directive #A
13 | #A = np.array(((a[0], a[1], 1),
| ^
a.cc:14:20: error: invalid preprocessing directive #(
14 | # (b[0], b[1], 1),
| ^
a.cc:15:20: error: invalid preprocessing directive #(
15 | # (c[0], c[1], 1)))
| ^
a.cc:22:6: error: invalid preprocessing directive #B
22 | #B = np.array((((-(a[0]**2 + a[1]**2))),
| ^
a.cc:23:20: error: invalid preprocessing directive #(
23 | # ((-(b[0]**2 + b[1]**2))),
| ^
a.cc:24:20: error: invalid preprocessing directive #(
24 | # ((-(c[0]**2 + c[1]**2)))))
| ^
a.cc:31:7: error: invalid preprocessing directive #tmp
31 | # tmp = np.dot(np.linalg.inv(A), B)
| ^~~
a.cc:38:11: warning: multi-character literal with 17 characters exceeds 'int' size of 4 bytes
38 | print('{:.3} {:.3} {:.3}'.format(x, y, r))
| ^~~~~~~~~~~~~~~~~~~
a.cc:2:1: error: 'from' does not name a type
2 | from math import sqrt
| ^~~~
|
s222800726
|
p00010
|
C++
|
#!/usr/bin/env python
from math import *
def g(x):
y = (int((1000 * abs(x)) * 2 + 1) // 2) / 1000
if x < 0:
y *= -1
return y
def func(x):
x1, y1, x2, y2, x3, y3 = x
a = x1 - x2
b = y1 - y2
c = (x1 * x1 + y1 * y1 - x2 * x2 - y2 * y2) / 2
d = x1 - x3
e = y1 - y3
f = (x1 * x1 + y1 * y1 - x3 * x3 - y3 * y3) / 2
x = (e * c - b * f) / (a * e - b * d)
y = (a * f - d * c) / (a * e - b * d)
r = sqrt((x1 - x) * (x1 - x) + (y1 - y) * (y1 - y))
x = "{0:.3f}".format(g(x))
y = "{0:.3f}".format(g(y))
r = "{0:.3f}".format(g(r))
print(x + " " + y + " " + r)
n = int(input())
a = []
for _ in range(n):
a.append(list((map(float, input().split()))))
for i in a:
func(i)
|
a.cc:1:2: error: invalid preprocessing directive #!
1 | #!/usr/bin/env python
| ^
a.cc:2:1: error: 'from' does not name a type
2 | from math import *
| ^~~~
|
s205976143
|
p00010
|
C++
|
include<iostream>
#include<cmath>
using namespace std;
int main() {
int n=0;
double ax,ay,bx,by,cx,cy,S,R,a,b,c,x=0,y=0;
cin>>n;
for(int i=0; i<n; i++){
cin>>ax>>ay>>bx>>by>>cx>>cy;
S=((bx-ax)*(cy-ay)-(cx-ax)*(by-ay))/2;
a=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
b=sqrt((cx-bx)*(cx-bx)+(cy-by)*(cy-by));
c=sqrt((ax-cx)*(ax-cx)+(ay-cy)*(ay-cy));
R=a*b*c/(4*S);
x=(a*a*(b*b+c*c-a*a)*ax+b*b*(c*c+a*a-b*b)*bx+c*c*(a*a+b*b-c*c)*cx)/(16*S*S);
y=(a*a*(b*b+c*c-a*a)*ay+b*b*(c*c+a*a-b*b)*by+c*c*(a*a+b*b-c*c)*cy)/(16*S*S);
cout<<x<<" "<<y<<" "<<R<<endl;
}
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
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,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906:
/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: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)>
| ^~~~~~
In file included from /usr/include/stdlib.h:32,
from /usr/include/c++/14/bits/std_abs.h:38,
from /usr/include/c++/14/cmath:49:
/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_algobase.h:65:
/usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type
125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
+++ |+#include <cstddef>
1 | // Types used in iterator implementation -*- C++ -*-
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type
214 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type
225 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_algobase.h:66:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type
112 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
65 | #include <debug/assertions.h>
+++ |+#include <cstddef>
66 | #include <bits/stl_iterator_base_types.h>
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type
118 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_iterator.h:67,
from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits
|
s133124462
|
p00010
|
C++
|
#include<stdio.h>
#include<iostream>
using namespace std;
struct Line{
bool isRightX, isRightY;
double x, y, a, b;
};
Line getBisector(double x1, double y1, double x2, double y2){
Line bisector;
bisector.isRightX = bisector.isRightY = false;
if ( y1 == y2 ){
bisector.isRightY = true;
bisector.x = ( x1 + x2 ) / 2;
} else if ( x1 == x2 ){
bisector.isRightX = true;
bisector.y = ( y1 + y2 ) / 2;
} else {
bisector.a = ( x2 - x1 ) / ( y1 - y2 );
bisector.b = ( y1 + y2 ) / 2 - bisector.a * (( x1 + x2 ) / 2);
}
return bisector;
}
void compute(){
double x1, y1, x2, y2, x3, y3, x, y, r;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
Line AB = getBisector(x1, y1, x2, y2);
Line AC = getBisector(x1, y1, x3, y3);
if ( AB.isRightX ){
if ( AC.isRightY ){
x = AC.x; y = AB.y;
} else {
y = AB.y; x = (y - AC.b) / AC.a;
}
} else if ( AB.isRightY ){ //y ツ篠イツづ可閉スツ行
if ( AC.isRightX ){
x = AB.x; y = AC.y;
} else {
x = AB.x; y = AC.a * x + AC.b;
}
} else {
if ( AC.isRightX ) {
y = AC.y; x = (y - AB.b) / AB.a;
} else if ( AC.isRightY ) {
x = AC.x; y = AB.a * x + AB.b;
} else {
x = (AC.b - AB.b) / (AB.a - AC.a);
y = AB.a * x + AB.b;
}
}
r = sqrt( (x - x1)*(x - x1) + (y - y1)*(y - y1) );
printf("%.3lf %.3lf %.3lf\n", x, y, r);
}
int main(){
int tcase; cin >> tcase;
for ( int i = 0; i < tcase; i++ ){
compute();
}
return 0;
}
|
a.cc: In function 'void compute()':
a.cc:55:9: error: 'sqrt' was not declared in this scope
55 | r = sqrt( (x - x1)*(x - x1) + (y - y1)*(y - y1) );
| ^~~~
|
s037840530
|
p00010
|
C++
|
}else{
P max = point[0];
P min = point[0];
if(max.real() < point[1].real())max=point[1];
if(min.real() > point[1].real())min=point[1];
if(max.real() < point[1].real())max=point[2];
if(min.real() > point[1].real())min=point[2];
ans = max + min;
ans = (ans.real()/2,ans.imag()/2);
}
|
a.cc:1:5: error: expected declaration before '}' token
1 | }else{
| ^
a.cc:1:6: error: expected unqualified-id before 'else'
1 | }else{
| ^~~~
|
s398246619
|
p00010
|
C++
|
#include <iostream>
#include <iomanip>
using namespace std;
double get_num(double x){
x = x * 1000;
if(x >= 0){
x = (int)(x + 0.5);
return ((double)x / 1000);
} else {
x = (int)(x - 0.5);
return ((double)x / 1000);
}
}
int main()
{
int n;
cin >> n;
for(int i = 0; i < n; i++){
double x1, y1;
double x2, y2;
double x3, y3;
double m12x, m12y;
double m13x, m13y;
double dx12, dy12;
double dx13, dy13;
double c12, c13;
double xp, yp;
double r;
cin >> x1 >> y1 >> x2
>> y2 >> x3 >> y3;
m12x = (x1 + x2) / 2;
m12y = (y1 + y2) / 2;
m13x = (x1 + x3) / 2;
m13y = (y1 + y3) / 2;
dx12 = x2 - x1;
dy12 = y2 - y1;
dx13 = x3 - x1;
dy13 = y3 - y1;
c12 = m12x * dx12 + m12y * dy12;
c13 = m13x * dx13 + m13y * dy13;
yp = (c12 * dx13 - c13 * dx12) / (dy12 * dx13 - dy13 * dx12);
if(dx12 == 0){
xp = (c13 - (dy13 * yp)) / dx13;
}else{
xp = (c12 - (dy12 * yp)) / dx12;
}
r = sqrt((xp - x1) * (xp - x1) + ((yp - y1) * (yp - y1)));
xp = get_num(xp);
yp = get_num(yp);
r = get_num(r);
cout << fixed << setprecision(3) << xp << " " << yp << " " << r << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:49:21: error: 'sqrt' was not declared in this scope
49 | r = sqrt((xp - x1) * (xp - x1) + ((yp - y1) * (yp - y1)));
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.