![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
暑假日常
文章平均质量分 71
__Spinach
这个作者很懒,什么都没留下…
展开
-
暑假第一周D,E,F题
D - Valued KeysYou found a mysterious function f. The function takes two strings s1 and s2. These strings must consist only of lowercase English letters, and must be the same length.The output o原创 2017-07-22 13:42:57 · 467 阅读 · 0 评论 -
快速排序
没有啥要说的,日常保留代码系列。#include#include#includeusing namespace std;int a[1000000];void quick_sort(int l, int r){ int i = l; int j = r; int mid = (l + r) / 2; int x = a[mid]; while(i <= j) {原创 2017-08-17 17:55:13 · 124 阅读 · 0 评论 -
归并排序
日常保存代码系列。#include#includeusing namespace std;int a[1000000];int b[1000000];void merge(int l, int mid, int r){ int p1 = l; int p2 = mid + 1; for(int i = l; i <= r; i++) { if(p1 r || (a原创 2017-08-17 17:57:32 · 131 阅读 · 0 评论 -
归并求逆序对
求这个逆序对只需要在归并排序的代码中加一句即可。感觉自己有点说不清楚,随手附上别人的详细解释,请戳:详细介绍#include#include#include using namespace std;int a[1000000];int b[1000000];int sum = 0;void merge(int l, int mid, int r){ int p原创 2017-08-17 21:48:10 · 264 阅读 · 0 评论 -
Oil Deposits
紫书上面的例题一个关于油田联通块的问题,书上用的是递归的dfs搜索,悄悄记录一下* * * * @* @ @ * @* @ * * @@ @ @ * @@ @ * * @#include#includeconst int maxn = 100 + 5;cha转载 2017-08-03 17:28:30 · 147 阅读 · 0 评论 -
Bear and Different Names
D - Bear and Different Names In the army, it isn't easy to form a group of soldiers that will be effective on the battlefield. The communication is crucial and thus no two soldiers should share a na原创 2017-07-28 15:53:09 · 268 阅读 · 0 评论