ICode9

精准搜索请尝试: 精确搜索
  • CF1637E Best Pair 题解2022-05-30 11:32:34

    心理阴影题。考试时写了奇怪的线段树分治,在每个线段树节点上维护单调栈在栈内二分…… 这题注意到两维分别是 \(x,cnt_x\),应该对 \(cnt\) 比较敏感的是它的自然根号性质,由于 \(\sum_{cnt_x}=n\),所以实际上 \(cnt_x\) 的种类只有 \(O(\sqrt n)\) 种。我们直接枚举所有这样的对,用一

  • C++ 容器中 begin()、cbegin()、rbegin()、crbegin2022-04-03 13:00:36

    cbegin() 与 begin() 唯一区别 是c 是const 迭代器不能修改指向的元素内容 (29条消息) C++ 容器中 begin()、cbegin()、rbegin()、crbegin_肥喵王得福_ฅ・ω・ฅ的博客-CSDN博客_容器begin

  • 2021-10-01leetcode840.矩阵中的幻方2021-10-01 20:33:48

    class Solution { public: vector<int> m={8,1,6,7,2,9,4,3,8,1,6,7,2,9,4,3}; //这个是为了表示旋转的数组 int numMagicSquaresInside(vector<vector<int>>& grid) { int di[8]={-1,-1,-1,0,1,1,1,0}; int dj[8]={-1,0,1,1,1,0,-1,

  • 寒假算法训练6-D(清理手机内存问题,重要性有1和2)2021-03-06 10:29:06

    Input 5 5 7 5 3 2 1 4 2 1 1 2 1 1 3 2 1 5 10 2 3 2 3 2 1 2 1 2 1 4 10 5 1 3 4 1 2 1 2 4 5 3 2 1 2 2 1 2 1 Output 2 -1 6 4 3 思路:将两种重要性的app根据内存大小从大到小排序。然后枚举。枚举也很讲究,最好用vector记录下前i项和。 #include <bits/stdc++.h> using n

  • AtCoder Beginner Contest 170 E - Smart Infants2020-06-15 20:52:47

    题意:给n个人 每个人有一个值a[i] 属于b[i]组 有q次询问 每次询问让第c个人变成d组  问每次改变后  每个组中的最大值中的最小值为多少 题目链接:https://atcoder.jp/contests/abc170/tasks/abc170_e 思路:纯模拟题 但是要熟悉multiset 的用法  还有一些rbegin和begin的使用 用mul

  • code forces1249D Too Many Segments2019-11-07 22:53:03

    大佬连接::https://blog.csdn.net/weixin_43847416/article/details/102749985 题意::删除最少数量的区段使每个整数点的覆盖次数不大于K 思路:: 以区间左端点为头,右端点由小到大排序,如果端点相同,按标号存入。 从头开始遍历每个点,判断每个点上覆盖次数,大于k时删除最长的那个区间。 1 #

  • D. Equalize the Remainders set的使用+思维2019-10-06 22:03:25

    D. Equalize the Remainders set的学习::https://blog.csdn.net/byn12345/article/details/79523516 注意set的end()和rbegin()的区别。 end()是指向最后一个元素的下一个,rbegin()是指向最后一个元素。   题目大意:给你一个n长度的数组,给一个模数m,问对m取模,余数从0到m-1的每一种都是

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有