随笔分类 - 贪心
摘要:链接:https://www.nowcoder.com/acm/contest/115/G来源:牛客网 题目描述 周末,小Q喜欢在PU口袋校园上参加各种活动刷绩点,体验丰富多彩的大学生活。 但是每个活动有各自的开始时间、结束时间、Happy值以及绩点数,活动之间可能存在时间冲突。 小Q是一个认真踏实
阅读全文
摘要: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
阅读全文
摘要:题意:就是一个集合分开,有两种区分 对子:两个相同数字,顺子:连续三个不同数字,问最多分多少个 解法:贪心,如果当前数字不构成顺子就取对子 /2,如果可以取顺子,那么先取顺子再取对子
阅读全文
摘要: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,
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文