hdu 2552 (这题很强大)

点击打开链接

自己不要被题目的公式吓住,那根本用不到。。。

这里用到了两个高中学的公式:

1.tan(a+b) = ( tan(a) + tan(b) ) / (1 – tan(a) * tan(b) )


2.tan( atan(x) ) = x


arctan(1/s) = arctan(1/u)+arctan(1/v)
所以得1/s = tan( arctan(1/u)+arctan(1/v) ) = (tan(arctan(1/u)) + tan(arctan(1/v)))/(1-tan(arctan(1/u))*tan(arctan(1/v))) = (1/u + 1/v) / (1 - 1/(uv))

所以解得 uv = 1 + us + vs
最后可以推出,无论输入什么,结果都是1。。。。


#include"stdio.h"
int main()
{
	int t,a,b;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&a,&b);
		printf("1\n");
	}
	return 0;
}


posted on 2013-04-05 12:23  Slege  阅读(153)  评论(0)    收藏  举报

导航