随笔分类 - 贪心
摘要:题目描述 老师在开学第一天就把所有作业都布置了,每个作业如果在规定的时间内交上来的话才有学分。每个作业的截止日期和学分可能是不同的。例如如果一个作业学分为10,要求在6天内交,那么要想拿到这10学分,就必须在第6天结束前交。每个作业的完成时间都是只有一天。例如,假设有7次作业的学分和完成时间如下:老
阅读全文
摘要:题目描述 我们计划搞一次独木舟旅游活动。独木舟可以在港口租到,并且它们之间是没有区别的。一条独木舟上最多只能乘坐两个人,且乘客的总重量不能超过独木舟的最大承载量。我们想要尽可能的减少我们在这次活动中的花销,所以要找出可以安置所有旅客的最少的独木舟的条数。请写一个程序:读入独木舟的最大承载量,旅客的数
阅读全文
摘要:题目描述 输入一个高精度的正整数n(≤240位),去掉其中任意s个数字后,剩下的数字按原左右次序组成一个新的正整数。编程对给定的n和s,寻找一种方案,使得剩下的数字组成的新数最小。 输入一个高精度的正整数n(≤240位),去掉其中任意s个数字后,剩下的数字按原左右次序组成一个新的正整数。编程对给定的
阅读全文
摘要:问题 F: Go Home 题目描述 There is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0. During the period between t
阅读全文
摘要:问题 H: Lining Up 题目描述 There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the orde
阅读全文
摘要:6474: AtCoDeer and Rock-Paper 题目描述 AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each play
阅读全文
摘要:问题 G: Boxes and Candies 题目描述 There are N boxes arranged in a row. Initially, the i-th box from the left contains ai candies.Snuke can perform the foll
阅读全文
摘要:问题 C: Cities 题目描述 There are n cities in Byteland, and the ith city has a value ai. The cost of building a bidirectional road between two cities is the
阅读全文
摘要:问题 L: Robots 题目描述 You’re the leading designer of a complex robot, that will explore human unreachable locations. Your job is to design a robot that wi
阅读全文

浙公网安备 33010602011771号