13 约定 A common problem that arises when wrapping C libraries is that of maintaining reliability and checking for errors. The fact of the matter is tha ...
分类:
其他好文 时间:
2020-06-29 22:57:18
阅读次数:
82
地址 https://www.acwing.com/problem/content/description/922/ H城是一个旅游胜地,每年都有成千上万的人前来观光。 为方便游客, 巴士公司在各个旅游景点及宾馆,饭店等地都设置了巴士站并开通了一些单程巴士线路。 每条单程巴士线路从某个巴士站出发,依 ...
P3378 【模板】堆 #include<bits/stdc++.h> using namespace std; priority_queue<int,vector<int>,greater<int> >q;//小根堆 int n; int op; int x; int main(){ scanf( ...
分类:
其他好文 时间:
2020-06-29 18:42:21
阅读次数:
76
题目 https://www.luogu.com.cn/problem/P3916 思路 要有建反向图的意识,当看到是一个点对多个点的操作的时候,我们要注意进行反向建边,由 原来的一个点可以到达的点中最大值改为 计算这个较大的点能到达哪些点 具体的实现方法就是先将题目中的点由大到小进行DFS遍历,在 ...
分类:
其他好文 时间:
2020-06-29 17:13:07
阅读次数:
56
地址 https://www.acwing.com/problem/content/description/905/ 年轻的探险家来到了一个印第安部落里。 在那里他和酋长的女儿相爱了,于是便向酋长去求亲。 酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。 探险家拿不出这么多金币,便请求酋长降低 ...
题目 https://www.luogu.com.cn/problem/P5266 思路 使用map记录数据,注意map以下函数的使用 代码 #include<iostream> #include<cstdio> #include<string> #include<cstring> #include ...
分类:
其他好文 时间:
2020-06-28 22:55:38
阅读次数:
81
题目 https://www.luogu.com.cn/problem/P1536 这道题第一眼的思路感觉是最小生成树,但是发现它的边没有权值,所以这道题的问题是求解这个图的连通块的个数,而需要连接的道路条数就是连通块的个数减一 代码 #include<iostream> #include<cstd ...
分类:
其他好文 时间:
2020-06-28 22:50:01
阅读次数:
103
Description 编写用来交换两个数的函数,使得“Append Code”中的main()函数能正确运行。 用C实现三个函数int_swap()、dbl_swap()、SWAP(),其中SWAP()是个带参宏。 用C++实现两个函数,都以Swap()命名。 以上函数的调用格式见“Append ...
分类:
移动开发 时间:
2020-06-28 22:46:43
阅读次数:
95
题目 https://www.luogu.com.cn/problem/P3370 思路 大致的方法就是先自己预定一个base基值,将字符串的每一位与base相乘,解决冲突的方法就是使用自然溢出、双哈希等 代码 自然溢出 #include<iostream> #include<cstdio> #in ...
分类:
其他好文 时间:
2020-06-28 22:37:23
阅读次数:
55
题目 https://www.luogu.com.cn/problem/P1102 思路 使用一个map记录一样的数字出现的次数,使用另外一个map记录数字来寻找比自己大c和小c的数字 7 10 与10 7都算,最后整体除以2就行 代码 #include<iostream> #include<cst ...
分类:
其他好文 时间:
2020-06-28 22:26:58
阅读次数:
71