摘要: 书上的欧拉回路定义不在重复,欧拉回路定义,弗洛莱走边的方法也不再细讲,弗洛莱算法描述这里只说怎么进行代码实现。/*无向图的欧拉回路 邻接矩阵存图原理:dfs走边,当走不动时就将其放入栈中,最后将顶点从栈中取出的顺序就是欧拉路径。如果走错边则必定会堵,那么就会将堵的放入... 阅读全文
posted @ 2018-06-13 12:49 _年少有为 阅读(607) 评论(0) 推荐(0) 编辑
摘要: 最近再做一个系统时,写了一个基类4个派生类,基类中有虚函数,每次修改之后就将二级制信息存储进*.dat文件。但是在再起启动程序时就出现这样的访问冲突问题,然后就一直困扰了3天,搜百度,博客,知乎等。最后还是在老师的提醒下发现问题出现在哪里。 每... 阅读全文
posted @ 2018-06-12 20:02 _年少有为 阅读(742) 评论(0) 推荐(0) 编辑
摘要: Every day, farmer Ion (this is a Romanian name) takes out all his horses, so they may run and play. When they are done, farmer Ion has... 阅读全文
posted @ 2018-05-17 17:28 _年少有为 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.nowcoder.com/acm/contest/112/B有n个队伍,每个队伍的人数小于等于5,每辆车最多坐5个人,要求一个队伍的人都在一辆车上,求最少的车数贪心思想:4 要么自己一车 ,要么和1一车3要么和2一车 要么和1一... 阅读全文
posted @ 2018-05-12 10:26 _年少有为 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Haoren is very good at solving mathematic problems. Today he is working a problem like this: Find three positive integers X, Y and... 阅读全文
posted @ 2018-05-09 11:53 _年少有为 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 操作1.找到一个枢纽pivotkey ,对于一个一次操作让枢纽左边的值都小于等于pivotkey,枢纽右边的值都大于等于pivotkey2.一个排序后将该区间分成两部分继续递归排序,直至不符合l#include#include#include#include#incl... 阅读全文
posted @ 2018-05-08 18:16 _年少有为 阅读(239) 评论(0) 推荐(0) 编辑
摘要: cjj is fun with math problem. One day he found a Olympic Mathematics problem for primary school students. It is too difficult for cjj.... 阅读全文
posted @ 2018-04-19 21:14 _年少有为 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 看代码解释/*求逆元费马小定理a^(p-1)=1(mod p)故a^(p-2)=1/a(mod p)inv(a)(a关于p的逆元)=a^(p-2)*/#include#include#include#include#include#include#include#de... 阅读全文
posted @ 2018-04-16 21:46 _年少有为 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/612/D题目大意:给出n条线段,让你算这些线段重合次数大于等于k次的部分输入: 第一行:给出两个数n k 分别表示要输入的线段个数和所需的线段最少重叠次数接下来n... 阅读全文
posted @ 2018-04-11 18:54 _年少有为 阅读(277) 评论(0) 推荐(0) 编辑
摘要: lower_bound()返回这个有序序列中第一个大于等于value的位置upper_bound()返回这个有序序列中第一个大于vlaue的位置具体STL库好像用的二分查找举个例子代码#include#include#include#include#include#i... 阅读全文
posted @ 2018-04-10 11:40 _年少有为 阅读(169) 评论(0) 推荐(0) 编辑