会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
29
30
31
32
33
34
35
36
37
···
45
下一页
2023年12月26日
P8648 [蓝桥杯 2017 省 A] 油漆面积
摘要: 1.首先想到的错解 看到数据范围,就想先写个n^2的暴力:先把所有矩形的面积都算出来,然后再把所有重合的部分挨个减去,把每个重合的部分当成一个个小矩形,用set来判重。 画一个稍复杂些的样例,就会发现,在这些由重合部分产生的小矩形之间,仍有重合,所以这种算法,会导致算出来的重合部分偏大,而导致最后的
阅读全文
posted @ 2023-12-26 12:44 Gold_stein
阅读(67)
评论(1)
推荐(1)
2023年12月22日
P8647 [蓝桥杯 2017 省 AB] 分巧克力
摘要: 二分 #include <iostream> #include <stdio.h> #include <algorithm> #include <cstring> #define For(i, j, n) for(int i = j ; i <= n ; ++i) using namespace s
阅读全文
posted @ 2023-12-22 17:41 Gold_stein
阅读(53)
评论(0)
推荐(0)
P8646 [蓝桥杯 2017 省 AB] 包子凑数
摘要: 根据裴蜀定理可得INF的情况是所有数的最大公约数非1 而我们的完全背包的上限是多少呢? 设置为Σai即可,因为把每一个ai用上之后的集合,和ai可以重复使用的集合,只差了整数倍个ai,因此可达性是完全一致的,这里N<=100,ai<=100,所以我们把这个背包的上限设置为10000. #includ
阅读全文
posted @ 2023-12-22 17:18 Gold_stein
阅读(43)
评论(0)
推荐(0)
P8638 [蓝桥杯 2016 省 A] 密码脱落
摘要: 基本可以确定这道题是一个dp,我首先想到的思路是,根据回文序列对称的特性,把这个原序列分成前后两半来做,但是每次对序列进行添加操作,都会导致中心点的移动,导致这种做法非常麻烦,因此需要转换思路: 不妨直接把整个序列颠倒过来,那些本身是回文串的部分,颠倒之后还是回文串,而剩下的那些部分,为了把它们变成
阅读全文
posted @ 2023-12-22 16:58 Gold_stein
阅读(41)
评论(0)
推荐(0)
2023年12月19日
[排序,贪心,置换环]洛谷P1327&&P8637,双倍经验
摘要: 前置知识: 置换环,最小交换次数 https://blog.csdn.net/yunxiaoqinghe/article/details/113153795?ops_request_misc=&request_id=&biz_id=102&utm_term=%E6%9C%80%E5%B0%91%E4
阅读全文
posted @ 2023-12-19 17:45 Gold_stein
阅读(121)
评论(0)
推荐(0)
2023年12月17日
P8636 [蓝桥杯 2016 省 AB] 最大比例
摘要: 注意,最后统计答案的时候,要把f[1]也考虑进去,也可以直接把f[0]设为1,就能保证正确性了。 #include <iostream> #include <stdio.h> #include <algorithm> #include <cstring> #define For(i, j, n) f
阅读全文
posted @ 2023-12-17 02:07 Gold_stein
阅读(24)
评论(0)
推荐(0)
2023年12月13日
P8635 [蓝桥杯 2016 省 AB] 四平方和
摘要: 四个数,当前三个确定时最后一个可以通过前三个所出来,所以只需要枚举前三个 #include <iostream> #include <stdio.h> #include <algorithm> #include <cmath> #include <cstring> #define For(i, j,
阅读全文
posted @ 2023-12-13 00:48 Gold_stein
阅读(42)
评论(0)
推荐(0)
P8627 [蓝桥杯 2015 省 A] 饮料换购
摘要: #include <iostream> #include <stdio.h> #include <algorithm> #include <cstring> #define For(i, j, n) for(int i = j ; i <= n ; ++i) using namespace std;
阅读全文
posted @ 2023-12-13 00:18 Gold_stein
阅读(26)
评论(0)
推荐(0)
2023年12月12日
[Floyd][拓扑排序]ACwing343.排序
摘要: 1.Floyd写法: #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 26; int n, m; bool d[N][N]; bool st[N]; int
阅读全文
posted @ 2023-12-12 14:05 Gold_stein
阅读(16)
评论(0)
推荐(0)
2023年12月11日
洛谷P3396 哈希冲突
摘要: 根号分治模板题 #include <iostream> #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #define RED "\033[0;32;31m" #define NONE "\033
阅读全文
posted @ 2023-12-11 22:20 Gold_stein
阅读(11)
评论(0)
推荐(0)
上一页
1
···
29
30
31
32
33
34
35
36
37
···
45
下一页
公告