#include <algorithm> #include <string> #include <cstring> #include <vector> #include <map> #include <stack> #include <set> #include <queue> #include < ...
分类:
其他好文 时间:
2020-07-24 23:42:50
阅读次数:
81
Dijkstra's algorithm is one of the very famous greedy algorithms. It is used for solving the single source shortest path problem which gives the short ...
分类:
其他好文 时间:
2020-07-24 21:53:35
阅读次数:
107
可能是要咕咕咕的题目,先上下代码。 代码: 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<cmath> 5 #include<queue> 6 #include<algorithm> 7 using na ...
分类:
其他好文 时间:
2020-07-24 16:21:35
阅读次数:
67
代码如下: 将小写转换为大写 #include<cstdio> #include<iostream>#include<algorithm>using namespace std;int main(){ char a; cin>>a; char b; b=a-32; cout<<b<<endl; re ...
分类:
其他好文 时间:
2020-07-24 09:57:40
阅读次数:
62
搜索依然爆炸的烂,继续加油吧。 题解:按照 h 排序的大根堆,每次寻找四周 h 小的接上dp串。 #include <iostream> #include <queue> #include <algorithm> using namespace std; /* * time: 2020.7.23 * ...
分类:
其他好文 时间:
2020-07-23 23:26:22
阅读次数:
94
分析: 首先是一个$O(n2)$的DP,设$f_{i,j,0/1}$表示做了前$i$个,用了$j$个$A$,最后一个是$A/B$的方案数 然后我们不看最后一位,发现$f_{i,j}$两个状态可以用$2*2$的转移矩阵DP 发现转移矩阵与$j$没有关系,把$j$去掉,维护$f_i=\sum_a_jxj ...
分类:
其他好文 时间:
2020-07-22 20:29:49
阅读次数:
64
[Lyndon分解] HDU 6761 Minimum Index (2020多校训练) 题解 待补。 Code #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cstdi ...
分类:
其他好文 时间:
2020-07-22 01:46:30
阅读次数:
178
链接:Miku 对顶堆做法 #include<iostream> #include<cstdio> #include<algorithm> #include<queue> using namespace std; priority_queue <int,vector<int>,greater<int ...
分类:
其他好文 时间:
2020-07-21 13:58:51
阅读次数:
72
示例代码: #include <map>#include <iostream>#include <string>#include <algorithm> using namespace std;int main(){ string name="jack"; pair<int,string> pair ...
分类:
其他好文 时间:
2020-07-21 11:34:26
阅读次数:
67
题目 传送门 思路 比较巧妙的一道构造题 首先考虑排列的情况 因为是排列,所以每一个数位上的最终状态一定是固定的 设$b_i$满足$a_=i$ 如果交换$a_,a_$,那么$b_i,b_j$一定也会被交换 再者,如果$a$有序,那么$b$一定也有序,反之亦然 考虑逆序对映射到$b$上会是什么情况 \ ...
分类:
其他好文 时间:
2020-07-20 13:23:21
阅读次数:
66