摘要: 独木舟上的旅行时间限制:3000ms | 内存限制:65535KB难度:2描述进行一次独木舟的旅行活动,独木舟可以在港口租到,并且之间没有区别。一条独木舟最多只能乘坐两个人,且乘客的总重量不能超过独木舟的最大承载量。我们要尽量减少这次活动中的花销,所以要找出可以安置所有旅客的最少的独木舟条数。现在请写一个程序,读入独木舟的最大承载量、旅客数目和每位旅客的重量。根据给出的规则,计算要安置所有旅客必须的最少的独木舟条数,并输出结果。输入第一行输入s,表示测试数据的组数;每组数据的第一行包括两个整数w,n,80#includeusing namespace std;int a[305];int c. 阅读全文
posted @ 2013-10-23 18:17 ABCDL 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Dinner时间限制:100ms | 内存限制:65535KB难度:1描述Little A is one member of ACM team. He had just won the gold in World Final. To celebrate, he decided to invite all to have one meal. As bowl, knife and other tableware is not enough in the kitchen, Little A goes to take backup tableware in warehouse. There are m 阅读全文
posted @ 2013-10-23 17:34 ABCDL 阅读(238) 评论(0) 推荐(0) 编辑