文件名称:baoleiwenti
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:678byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
描述:
有两艘船,载重量分别是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
(系统自动生成,下载前可以参看下载内容)
下载文件列表
baoleiwenti.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.