摘要: 题目链接https://www.nowcoder.com/acm/contest/70/B思路没有代码限制 先打表 打出 幸运数字的表 然后 二分查找 第一个 大于 r 的幸运数字 然后 往 L 那边 遍历 求和 AC代码#include #include #incl... 阅读全文
posted @ 2018-03-16 22:00 Dup4 阅读(3281) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.nowcoder.com/acm/contest/70/A思路 暴力每一个子串 用 MAP 标记一下 然后 最后 遍历一遍 MAP 找出 出现次数最多 并且 字典序最小的那个AC代码#include #include #include ... 阅读全文
posted @ 2018-03-16 21:58 Dup4 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-017思路第一个条件是 人群的规模尽可能接近 那么 N 为偶数的时候 就是 一半 一半 N 为奇数的时候 就是 一个 一半 + 1 一个 一半 - 1 第... 阅读全文
posted @ 2018-03-16 16:54 Dup4 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-010思路因为 题意中 朋友的朋友 就是朋友 那么 朋友的关系 用 并查集 保存 但是 敌对关系 只有直接的敌对关系才是具有敌对关系 所以直接用结构体保存就好 AC代码#inclu... 阅读全文
posted @ 2018-03-16 16:26 Dup4 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-009思路用结构体存储,然后结构体排序 注意一下 个人编号是从 1 开始 计数的 AC代码#include #include #include #include #include #... 阅读全文
posted @ 2018-03-16 15:48 Dup4 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-003思路 用贪心思路 最后注意一下 总售价有可能是浮点数 AC代码#include #include #include #include #include #include #in... 阅读全文
posted @ 2018-03-16 14:57 Dup4 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-015思路 在求和的过程中 标记一下 最大值和最小值,在最后求平均的时候 用总和减去最大值和最小值 去除 (总数 - 2) 然后最后排序的时候 先按升序来排 然后 最后 POP 掉 ... 阅读全文
posted @ 2018-03-16 13:24 Dup4 阅读(132) 评论(0) 推荐(0) 编辑