会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
25
26
27
28
29
30
31
32
33
···
45
下一页
2024年3月31日
洛谷P1102 A-B数对
摘要: 双指针做法: 反过来,从后往前看也是一样的: #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define For(i, j, n) for (int i
阅读全文
posted @ 2024-03-31 19:15 Gold_stein
阅读(20)
评论(0)
推荐(0)
2024年3月28日
P8792 [蓝桥杯 2022 国 A] 最大公约数
摘要: #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define For(i, j, n) for(int i = j ; i <= n ; ++i) usin
阅读全文
posted @ 2024-03-28 09:33 Gold_stein
阅读(39)
评论(0)
推荐(0)
2024年3月25日
P1525 [NOIP2010 提高组] 关押罪犯
摘要: 带权并查集中,dist[]数组可以理解为一个向量,这样子比按照距离来理解更透彻: 优秀学习资料: AcWing 240. 食物链(带权并查集) - AcWing 即d[a]表示向量a->fa[a] 这道题的并查集解法: #include <iostream> #include <stdio.h> #
阅读全文
posted @ 2024-03-25 20:36 Gold_stein
阅读(43)
评论(0)
推荐(0)
2023 Hubei Provincial Collegiate Programming Contest TF
摘要: #include <bits/stdc++.h> #define int long long using namespace std; const int N = 3e6 + 9; int a[N]; char b[N]; signed main() { ios::sync_with_stdio(0
阅读全文
posted @ 2024-03-25 14:22 Gold_stein
阅读(53)
评论(0)
推荐(0)
2024年3月23日
2023 Hubei Provincial Collegiate Programming Contest TJ
摘要: 最开始的思路想错了: 把所有是负数段的连成一块,发现下一步会走到这些负数区域的时候,就算出来需要差了多少,然后在当前这个正数块停留一段时间。 但有可能我们当前踩着的这一块正数非常小,导致我们要等很长时间,所以正确的贪心应该是: 记录最大值的位置,先不停往后走,当发现结果变为负数的时候,就算出需要在之
阅读全文
posted @ 2024-03-23 00:25 Gold_stein
阅读(23)
评论(0)
推荐(0)
2023 Hubei Provincial Collegiate Programming Contest TC
摘要: MC里面无限水的模型 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define For(i, j, n) for(int i = j ; i <= n
阅读全文
posted @ 2024-03-23 00:19 Gold_stein
阅读(36)
评论(0)
推荐(0)
2024年3月22日
P5657 [CSP-S2019] 格雷码
摘要: #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define For(i, j, n) for(int i = j ; i <= n ; ++i) usin
阅读全文
posted @ 2024-03-22 16:59 Gold_stein
阅读(71)
评论(0)
推荐(0)
2024年3月19日
P8685 [蓝桥杯 2019 省 A] 外卖店优先级
摘要: 这道题虽然难度很低,但是细节不少 1.要先处理减,再处理加。因为是先经历了空档期的优先级衰减,然后才有订单带来的优先级提升;先减后加的时候有0这个下限兜底,如果先加后减可能会导致答案偏小。 2.减之后和加之后都要check一下,如果in_cache为true,减完之后小于等于三,但是加了以后又上升到
阅读全文
posted @ 2024-03-19 15:18 Gold_stein
阅读(46)
评论(0)
推荐(0)
ubuntu域名解析暂时失效解决办法
摘要: 你好!如果你在 Ubuntu 虚拟机中遇到域名解析失效的问题,我可以提供一些解决方法。请注意,以下方法适用于 VMware 虚拟机中的 Ubuntu。 修改 DNS 设置: 打开终端(命令行)。 输入以下命令以编辑 resolv.conf 文件: sudo vi /etc/resolv.conf 进
阅读全文
posted @ 2024-03-19 09:01 Gold_stein
阅读(2523)
评论(0)
推荐(0)
2024年3月18日
P8626 [蓝桥杯 2015 省 A] 灾后重建
摘要: 根号分治之类的思路分析这里就不讲了,主要关注代码细节: #include <iostream> #include <stdio.h> #include <algorithm> #include <vector> #include <string> #include <cmath> #define F
阅读全文
posted @ 2024-03-18 23:01 Gold_stein
阅读(38)
评论(0)
推荐(0)
上一页
1
···
25
26
27
28
29
30
31
32
33
···
45
下一页
公告