您的位置:首页 > 其它

UVa 10812 Beat the Spread! (陷阱)

2013-11-21 20:07 399 查看

10812 - Beat the Spread!

Time limit: 3.000 seconds

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1753

蛋碎了,被水题坑到了。。

完整代码:

/*0.018s*/

#include<cstdio>

int main()
{
	int t, s, d;
	scanf("%d", &t);
	while (t--)
	{
		scanf("%d%d", &s, &d);
		if (s < d || (s + d) & 1) puts("impossible");
		else printf("%d %d\n", (s + d) >> 1, (s - d) >> 1);
	}
	return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: