自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

didi的博客

didi的成长

  • 博客(10)
  • 收藏
  • 关注

原创 2020-08-28

POJ 3268 题意: 各个点到x的最短距离 + x 到各个点的距离 的最大值 思路:跑两次dijkstra, 在找各个点到x的最短距离可以把g[a][b]反转为g[b][a]计算更方便。 代码: #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 1010, INF = 0

2020-08-28 20:01:49 75

原创 并查集

处理区间合并查询问题 合并集合 询问两个元素是否一个集合 AcWing 836模板: #include <iostream> #include <cstdio> #include <string> #include <cstring> using namespace std; const int N = 1e5 + 10; int p[N];...

2020-02-26 23:57:38 130

原创 2020.02.02 前缀和 +差分 复习

一维前缀和 for(int i = 1; i <= n; i ++) scanf("%d",&a[i]), sum[i] = sum[i - 1] + a[i]; 查询[l, r] sum[r] - sum[l - 1] 代码: #include<iostream> #include<cstdio> using namespace std...

2020-02-02 23:57:14 98

原创 2020.01.31 七分糖 Trie 字符串统计

字符串统计(Trie) 模板:ACWing 835 #include <iostream> #include <cstring> using namespace std; const int N = 100010; int son[N][26], cnt[N], idx; //son[N][26]:每个节点连接的字母 || cnt[N]:统计字符串出现次数 char...

2020-01-31 22:39:34 118

原创 2020.01.15.搜索练习

poj 2488 题意:从任意点出发,是否可以遍历整个棋盘,类似于马走‘日’ **思路:**dfs记录路径 WA: 字典序最小 (我是菜鸡) 我的方向:(-2,1)(-2,-1)… 为何脑子不好嘞 长这个亚子的图 代码: #include <cstdio> #include <iostream> using namespace std; const int N = 50...

2020-01-16 12:44:19 122

原创 2019.12.18 七分糖~ 学习(单调栈,单调队列)

数组模拟单调栈 代码: /* 找到a[i]左边离i最近且比a[i]小 */ #include <cstdio> #include <iostream> using namespace std; const int N = 100010; int sta[N],tt; int n; int main(){ scanf("%d",&n); int ...

2019-12-18 20:49:49 131

原创 一个好玩的

头文件:#include setw(n),域宽为n个字符 setfill© ,填充字符为c left,right代表左对齐,右对齐。 待更。。。。

2019-07-25 23:08:46 204

原创 didi暑期训练赛补题1

B : CF 371C 题意:能组成最多的汉堡,条件是:输入字符串B,S,C的个数 思路:二分查找值能够使总值==n的答案,推出总和公式 (ll) max((ll) 0, m * ans1 - nb) * pb + (ll) max((ll) 0, m * ans2 - ns) * ps + (ll) max((ll) 0, m * ans3 - nc) * pc 代码: #include&lt...

2019-07-18 23:01:36 129

原创 牛客小白月赛 16

B 小雨的三角形 https://ac.nowcoder.com/acm/contest/949/B 题意:杨辉三角第x行到第y行的和 思路:打表运算 代码: #include #define ll long long using namespace std; const int mod=1e9+7; const int Maxn = 1010; ll sum[Maxn], xx[Maxn][...

2019-07-18 15:06:58 154

原创 四舍五入

四舍五入基本操作: double 类型:int(a+0.5) 撤销:Ctrl/Command + Z 重做:Ctrl/Command + Y 加粗:Ctrl/Command + B 斜体:Ctrl/Command + I 标题:Ctrl/Command + Shift + H 无序列表:Ctrl/Command + Shift + U 有序列表:Ctrl/Command + Shift + O 检...

2019-07-08 20:37:34 187

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除