随笔分类 -  贪心

摘要:链接:https://www.nowcoder.com/acm/contest/115/G来源:牛客网 题目描述 周末,小Q喜欢在PU口袋校园上参加各种活动刷绩点,体验丰富多彩的大学生活。 但是每个活动有各自的开始时间、结束时间、Happy值以及绩点数,活动之间可能存在时间冲突。 小Q是一个认真踏实 阅读全文
posted @ 2018-04-21 22:49 樱花落舞 阅读(320) 评论(0) 推荐(0) 编辑
摘要:A B Problem Statement You are given an integer sequence of length N, a1,a2,…,aN. For each 1≤i≤N, you have three choices: add 1 to ai, subtract 1 from  阅读全文
posted @ 2017-09-02 23:36 樱花落舞 阅读(1167) 评论(0) 推荐(0) 编辑
摘要:题意:就是一个集合分开,有两种区分 对子:两个相同数字,顺子:连续三个不同数字,问最多分多少个 解法:贪心,如果当前数字不构成顺子就取对子 /2,如果可以取顺子,那么先取顺子再取对子 阅读全文
posted @ 2017-08-31 16:05 樱花落舞 阅读(477) 评论(2) 推荐(0) 编辑
摘要:The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S,M, 阅读全文
posted @ 2017-07-26 23:15 樱花落舞 阅读(321) 评论(0) 推荐(0) 编辑
摘要:All our characters have hobbies. The same is true for Fedor. He enjoys shopping in the neighboring supermarket. The goods in the supermarket have uniq 阅读全文
posted @ 2017-07-24 01:11 樱花落舞 阅读(154) 评论(0) 推荐(0) 编辑
摘要:Description Your search for Heidi is over – you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that 阅读全文
posted @ 2017-06-08 23:59 樱花落舞 阅读(299) 评论(0) 推荐(0) 编辑
摘要:Description Petya recieved a gift of a string s with length up to 105 characters for his birthday. He took two more empty strings t and u and decided 阅读全文
posted @ 2017-04-17 09:55 樱花落舞 阅读(391) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示