/ Randle /

记录详情

Wrong Answer

/in/foo.cc: In function 'int main()':
/in/foo.cc:46:13: warning: unused variable 'bb' [-Wunused-variable]
   double aa,bb=-1,cc;
             ^~
# 状态 耗时 内存占用
#1 Accepted 3ms 324.0 KiB
#2 Accepted 2ms 320.0 KiB
#3 Wrong Answer 2ms 316.0 KiB
#4 Wrong Answer 2ms 316.0 KiB
#5 Accepted 2ms 320.0 KiB
#6 Accepted 1ms 316.0 KiB
#7 Accepted 1ms 320.0 KiB
#8 Wrong Answer 1ms 308.0 KiB
#9 Accepted 1ms 316.0 KiB
#10 Wrong Answer 1ms 316.0 KiB
#11 Wrong Answer 1ms 312.0 KiB
#12 Accepted 1ms 308.0 KiB
#13 Accepted 1ms 324.0 KiB
#14 Wrong Answer 1ms 316.0 KiB
#15 Wrong Answer 1ms 316.0 KiB
#16 Accepted 1ms 320.0 KiB
#17 Accepted 1ms 312.0 KiB
#18 Accepted 1ms 316.0 KiB
#19 Accepted 1ms 316.0 KiB
#20 Accepted 1ms 308.0 KiB
#21 Wrong Answer 1ms 312.0 KiB
#22 Accepted 1ms 316.0 KiB
#23 Accepted 1ms 312.0 KiB
#24 Wrong Answer 1ms 308.0 KiB
#25 Wrong Answer 1ms 320.0 KiB
#26 Accepted 2ms 312.0 KiB
#27 Accepted 2ms 316.0 KiB
#28 Accepted 1ms 320.0 KiB
#29 Accepted 1ms 320.0 KiB
#30 Accepted 1ms 308.0 KiB
#31 Accepted 1ms 316.0 KiB
#32 Accepted 1ms 316.0 KiB
#33 Accepted 1ms 316.0 KiB
#34 Wrong Answer 1ms 316.0 KiB
#35 Accepted 1ms 324.0 KiB
#36 Accepted 1ms 316.0 KiB
#37 Accepted 1ms 320.0 KiB
#38 Accepted 1ms 300.0 KiB
#39 Accepted 1ms 316.0 KiB
#40 Accepted 1ms 324.0 KiB
#41 Accepted 1ms 308.0 KiB
#42 Accepted 1ms 308.0 KiB
#43 Wrong Answer 1ms 320.0 KiB
#44 Accepted 1ms 312.0 KiB
#45 Wrong Answer 1ms 308.0 KiB
#46 Accepted 1ms 488.0 KiB
#47 Wrong Answer 1ms 312.0 KiB
#48 Wrong Answer 1ms 312.0 KiB
#49 Wrong Answer 1ms 324.0 KiB
#50 Accepted 1ms 468.0 KiB
#51 Accepted 1ms 312.0 KiB
#52 Wrong Answer 1ms 312.0 KiB
#53 Wrong Answer 1ms 308.0 KiB
#54 Accepted 1ms 308.0 KiB
#55 Accepted 1ms 328.0 KiB
#56 Accepted 1ms 304.0 KiB
#57 Accepted 2ms 316.0 KiB
#58 Wrong Answer 1ms 316.0 KiB
#59 Wrong Answer 1ms 316.0 KiB
#60 Wrong Answer 1ms 312.0 KiB
#61 Wrong Answer 1ms 320.0 KiB
#62 Wrong Answer 1ms 312.0 KiB
#63 Wrong Answer 1ms 316.0 KiB
#64 Wrong Answer 1ms 316.0 KiB
#65 Wrong Answer 1ms 316.0 KiB
#66 Wrong Answer 1ms 312.0 KiB
#67 Accepted 1ms 320.0 KiB
#68 Wrong Answer 1ms 312.0 KiB
#69 Wrong Answer 1ms 312.0 KiB
#70 Wrong Answer 1ms 324.0 KiB
#71 Wrong Answer 1ms 308.0 KiB
#72 Accepted 1ms 304.0 KiB
#73 Accepted 1ms 316.0 KiB
#74 Accepted 1ms 316.0 KiB
#75 Wrong Answer 1ms 312.0 KiB
#76 Accepted 1ms 320.0 KiB
#77 Accepted 1ms 320.0 KiB
#78 Wrong Answer 1ms 320.0 KiB
#79 Accepted 1ms 316.0 KiB
#80 Wrong Answer 1ms 316.0 KiB

代码

#include<bits/stdc++.h>
inline const void read(double &a)
{
	a=0;double b=1;
	char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')b=-1;c=getchar();}
	while(c>='0'&&c<='9')
	{
		a=a*10+c-'0';
		c=getchar();
	}
	a*=b;
}
double xs,ys,xe,ye,xw1,yw1,xw2,yw2,xm1,ym1,xm2,ym2;
class line
{
	public:
		double xstart,xend,ystart,yend,x,y;
		void init(double a,double b,double c,double d)
		{xstart=a;ystart=b;xend=c;yend=d;x=xend-xstart;y=yend-ystart;}
		inline const double operator*(const line&b){return b.x*y-x*b.y;}
		inline const bool common(const line&b)
		{
			line c,d,e,f;
			c.init(xstart,ystart,b.xstart,b.ystart);d.init(xstart,ystart,b.xend,b.yend);
			d.init(xend,yend,b.xstart,b.ystart);f.init(xend,yend,b.xend,b.yend);
			if((c*d)*(e*f)>=0)return false;
			else return true;
		}
}sight,wall,mirror,conf;
int main()
{
	read(xs);read(ys);read(xe);read(ye);sight.init(xs,ys,xe,ye);
	read(xw1);read(yw1);read(xw2);read(yw2);wall.init(xw1,yw1,xw2,yw2);
	read(xm1);read(ym1);read(xm2);read(ym2);mirror.init(xm1,ym1,xm2,ym2);
	if(!sight.common(mirror)&&!sight.common(wall)){std::cout<<"YES";exit(0);}
	if(!sight.common(wall)&&sight.common(mirror)){std::cout<<"NO";exit(0);}
	else
	{
		double xconf,yconf,a,b=-1,c;
		a=(ym2-ym1)/(xm2-xm1);c=ym1-a*xm1;
		double t=-(a*xe+b*ye+2*c);
		xconf=(t-b/a*xe-b*ye)/(a-b/a);yconf=(xe-xconf)/a+ye;
		conf.init(xs,ys,xconf,yconf);
		if(!conf.common(mirror)){std::cout<<"NO";exit(0);}
		double aa,bb=-1,cc;
		aa=(yconf-ys)/(xconf-xs);cc=yconf-aa*xconf;
		double xj=(cc-c)/(a-aa),yj=a*xj+c;
		conf.init(xj,yj,xs,ys);
		if(conf.common(wall)){std::cout<<"NO";exit(0);}
		conf.init(xj,yj,xe,ye);
		if(conf.common(wall)){std::cout<<"NO",exit(0);}
		std::cout<<"YES";
	}
	return 0;
}

信息

递交者
类型
递交
题目
二人对视 T2
题目数据
下载
语言
C++
递交时间
2017-10-01 14:34:47
评测时间
2017-10-01 16:12:20
评测机
分数
53
总耗时
136ms
峰值内存
488.0 KiB