文件名称:zhuangzaiwenti
介绍说明--下载内容均来自于网络,请自行研究使用
描述:
有两艘船,载重量分别是c1、 c2,n个集装箱,重量是wi (i=1…n),且所有集装箱的总重量不超过c1+c2。确定是否有可能将所有集装箱全部装入两艘船。
输入:
多个测例,每个测例的输入占两行。第一行一次是c1、c2和n(n<=10);第二行n个整数表示wi (i=1…n)。n等于0标志输入结束。
输出:
对于每个测例在单独的一行内输出Yes或No。
输入样例:
7 8 2
8 7
7 9 2
8 8
0 0 0
输出样例:
Yes
No-Descr iption: There are two boats, carrying capacity are c1, c2, n containers, the weight wi (i = 1 ... n), and the total weight of all containers of not more than c1+ c2. Determine whether it is possible to load two ships full of all containers. Input: number of test cases, test cases each accounted for two lines of input. The first line time is c1, c2, and n (n < = 10) the second line of n integers that wi (i = 1 ... n). n = 0 marks the end of input. Output: For each test cases in a separate line in the output Yes or No. Input sample: 7828779288000 output sample: Yes No
有两艘船,载重量分别是c1、 c2,n个集装箱,重量是wi (i=1…n),且所有集装箱的总重量不超过c1+c2。确定是否有可能将所有集装箱全部装入两艘船。
输入:
多个测例,每个测例的输入占两行。第一行一次是c1、c2和n(n<=10);第二行n个整数表示wi (i=1…n)。n等于0标志输入结束。
输出:
对于每个测例在单独的一行内输出Yes或No。
输入样例:
7 8 2
8 7
7 9 2
8 8
0 0 0
输出样例:
Yes
No-Descr iption: There are two boats, carrying capacity are c1, c2, n containers, the weight wi (i = 1 ... n), and the total weight of all containers of not more than c1+ c2. Determine whether it is possible to load two ships full of all containers. Input: number of test cases, test cases each accounted for two lines of input. The first line time is c1, c2, and n (n < = 10) the second line of n integers that wi (i = 1 ... n). n = 0 marks the end of input. Output: For each test cases in a separate line in the output Yes or No. Input sample: 7828779288000 output sample: Yes No
(系统自动生成,下载前可以参看下载内容)
下载文件列表
zhuangzaiwenti.cpp