![](https://img-blog.csdnimg.cn/20210323235952645.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
蓝桥杯 程序设计C/C++
蓝桥杯 程序设计C/C++
菱形继承
懒癌患者,IT民工,前进路上经常磕磕碰碰
展开
-
Leetcode 197. 上升的温度(datediff、暴力双表连接)
select w1.id from weather w1 join weather w2 on datediff(w1.recorddate,w2.recorddate)=1 and w1.temperature>w2.temperature原创 2021-04-03 20:59:43 · 108 阅读 · 0 评论 -
Leetcode 185. 部门工资前三高的所有员工(分组最值变种,用distinct+count)
select d.name "Department",e.name "Employee",Salary from Employee e join Department d on e.Departmentid=d.id where (select count(distinct(e1.salary)) from Employee e1 where e.salary<e1.salary and e.Departmentid=e1.Depart...原创 2021-04-03 20:56:54 · 57 阅读 · 0 评论 -
第十二届蓝桥杯大赛模拟赛(第四期)
问题描述 请问在 1900 到 2020 中,有多少个质数。 答案提交 这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。 暴力,没啥好说的 打印 没啥好说的 记度为0点为x0,度为1点为x1,度为2点为x2 x2=x0+1,当树节点个数为奇数时,1度点为0,否则为1,最大2*2021+1+1=4044 %3打个暴力 问题描述 一个身份证号码有 18...原创 2021-03-29 12:28:08 · 2060 阅读 · 29 评论 -
蓝桥杯 激光炸弹(二维前缀和)
找二维矩阵中r*r子矩形的最大值,预处理出前缀和然后暴力枚举即可 #include<bits/stdc++.h> using namespace std; const int M=5010; int a[M][M],n,r; int main(){ cin>>n>>r; r=min(5001,r); while(n--){ int x,y,z; cin>>x>>y>>z; ..原创 2021-03-24 00:35:47 · 175 阅读 · 0 评论 -
蓝桥杯 飞行员兄弟(枚举 二进制)
解题思路:这道题目解题思路大致是,首先我们可以构造一个16位的二进制数,然后呢,二进制数的每一位代表4*4矩阵中的一位,例如1代表(1,1),2代表(1,2),3代表(1,3),4代表(1,4),5代表(2,1)。既然这样的话,那么我们只需要枚举这个16位的二进制数,就可以确定我们的方案,因为题目只需要最优解方案,所以时间复杂度大约是O(16 * 2^16) #include<bits/stdc++.h> using namespace std; const int N=5; cha...原创 2021-03-24 00:01:56 · 197 阅读 · 0 评论