摘要: 给你一个整数数组target 。一开始,你有一个数组A ,它的所有元素均为 1 ,你可以执行以下操作: 令x为你数组里所有元素的和,选择满足0 & target, long sum) { if (flag) return; if (sum == target.size()) {flag = true;return;} for (int i... 阅读全文
posted @ 2020-02-16 17:24 拓海藤原 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 给你一个数组events,其中events[i] = [startDayi, endDayi],a56爆大奖在线娱乐会议i开始于startDayi,结束于endDayi。 你可以在满足startDayi 贪心思路 发现这么写,比较简单。。。就按照结束时间升序排序即可,然后用个set,对区间从前往后遍历,如果这个点上没安排会议就添加进去。。对于 100000*[1,100000]10... 阅读全文
posted @ 2020-02-16 17:23 拓海藤原 阅读(657) 评论(0) 推荐(0) 编辑
摘要: #include // std::cout#include // std::priority_queue#include // std::vector#include // std::greater class mycomparison{ bool reverse;public: mycomparison... 阅读全文
posted @ 2020-02-16 17:22 拓海藤原 阅读(261) 评论(0) 推荐(0) 编辑