UVa 12502 Three Families (想法题)

原创 2013年12月03日 19:21:37

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


哈哈。考想法的一道题。

首先注意到这句话:You may assume both families were cleaning at the same speed.

所以按理来说,(样例1中)本应该周末每个家庭都花3小时来清理花园,但A在忙完自己的一部分后又帮了C2小时,B帮了C1小时所以A要得90*2/(2+1)=60美刀


完整代码:

/*0.019s*/

#include<cstdio>

int main()
{
	int t, a, b, m;
	scanf("%d", &t);
	while (t--)
	{
		scanf("%d%d%d", &a, &b, &m);
		printf("%d\n", m * (2 * a - b) / (a + b));
	}
	return 0;
}

uva 12502 - Three Families

12502 - Three Families Three families share a garden. They usually clean the garden together at the...

Three Families

2012年湖南省省赛题 http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p...

UVa 10152 ShellSort (想法题)

10152 - ShellSort Time limit: 3.000 seconds  http://uva.onlinejudge.org/index.php?option=com_onlinej...

CERC 2004 / UVa 1335 Beijing Guards (二分&贪心&想法题)

1335 - Beijing Guards Time limit: 3.000 seconds  http://uva.onlinejudge.org/index.php?option=com_onl...

World Finals 2004 / UVa 1030 Image Is Everything (想法题&迭代更新)

1030 - Image Is Everything Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com...

UVa 757 / POJ 1042 / East Central North America 1999 Gone Fishing (枚举&贪心&想法题&优先队列)

757 - Gone Fishing Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinej...

UVa 12400 - 3, 2, 1, 0 (数学想法题&高精度 or 打表)

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

UVA 1450 Airport(二分+想法题)

题意: 有一个飞机场,有两条待飞跑到w和e,一条起飞跑道,每一时刻只能起飞一架飞机,然后有w[i]和e[i]架飞机进入w和e跑道,飞机编号从0开始,问说如何安排起飞可以使得飞机编号的最大值最小。 ...

UVa 696 How Many Knights (想法题)

696 - How Many Knights Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=online...

Uva16009 POJ 1906 Three Powers 数论 玄学找规律题 高精

玄学找规律 高精 有坑 uva poj
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:UVa 12502 Three Families (想法题)
举报原因:
原因补充:

(最多只允许输入30个字)