随笔分类 -  C++

1 2 3 4 5 ··· 7 下一页
摘要:蓝桥杯 矩阵翻硬币 暴力 暴力模拟: 但是发现暴力模拟只能通过第一个样例,因为数的范围太大了,所以说是思路上的问题 考虑整个过程 我参考了 "h_hui_hui" 大佬的博客,他写的很详细,很容易看懂 感觉那样一步一步推导出结果的过程很酷,也很难 现在能看懂,但是如果自己想的话就可能出问题,积累经验 阅读全文
posted @ 2018-03-28 21:10 pprp 阅读(217) 评论(0) 推荐(0) 编辑
摘要:大数相乘 今天运气很好找到一个讲的很好的博客,谢谢你啦@ "静之吾心" 易错点 数组的大小 数组的清零 前导0清除方法 大数相乘的规律 ans[i+j] = a[i] a[j]; 然后在进行进位处理,不停的累加到ans[i+j]上 然后也不用过多担心三位数以上,其实都是可以进位的不必要一下就处理完 阅读全文
posted @ 2018-03-28 20:14 pprp 阅读(232) 评论(0) 推荐(0) 编辑
摘要:简单并查集 Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid March 阅读全文
posted @ 2018-03-28 10:21 pprp 阅读(156) 评论(0) 推荐(0) 编辑
摘要:quicksort 快速排序 有几个细节比较重要 之前的学习都太过于肤浅,没有深刻理解程序内涵,所以今后写的代码一定要高质量,博客内容也不能太不好,要认真的去对待,全心投入,毕竟有一件可以全身心投入的事情是多么不容易。 快速排序需要记住的几个点 取等条件 在递归的过程中要严格控制取等条件,因为稍不注 阅读全文
posted @ 2018-03-27 21:00 pprp 阅读(216) 评论(0) 推荐(0) 编辑
摘要:L1 3 宇宙无敌加法器 令人激动的一道题目 题目 地球人习惯使用十进制数,并且默认一个数字的每一位都是十进制的。而在PAT星人开挂的世界里,每个数字的每一位都是不同进制的,这种神奇的数字称为“PAT数”。每个PAT星人都必须熟记各位数字的进制表,例如“……0527”就表示最低位是7进制数、第2位是 阅读全文
posted @ 2018-03-25 19:59 pprp 阅读(645) 评论(0) 推荐(0) 编辑
摘要:``` #include #include #include #include #include #include using namespace std; int vv[10000]; int N, M; void print() { bool t = 1; for(int i= 0 ; i > N >> M; for(int i= 0 ; i > vv[i]; ... 阅读全文
posted @ 2018-03-21 21:39 pprp 阅读(193) 评论(0) 推荐(0) 编辑
摘要:/ 7 9 集合相似度 / include using namespace std; setss[100]; int aa, bb, n, m, t; void solve(int a, int b){ int same = 0; set::iterator it; for(it = ss[a].b 阅读全文
posted @ 2018-03-21 21:39 pprp 阅读(413) 评论(0) 推荐(0) 编辑
摘要:``` #include #include #include #include #include #include using namespace std; int vv[10000]; int N, M; void print() { bool t = 1; for(int i= 0 ; i > N >> M; for(int i= 0 ; i > vv[i]; ... 阅读全文
posted @ 2018-03-21 21:39 pprp 阅读(345) 评论(0) 推荐(0) 编辑
摘要:``` include include include include include using namespace std; int bulk[1001]; int n; int main(){ memset(bulk,0,sizeof bulk); cin n; int recnum = 1, 阅读全文
posted @ 2018-03-20 21:35 pprp 阅读(278) 评论(0) 推荐(0) 编辑
摘要:占个坑,等自己数学好一点以后再来重新把这个题写一遍 "附上链接" 附上大牛代码: c++ include include define INF 99999999 define ll long long using namespace std; struct line { int x, y1, y2; 阅读全文
posted @ 2018-03-20 20:42 pprp 阅读(492) 评论(0) 推荐(0) 编辑
摘要:深度搜索,一开始没有想到,说明基本功还是不够啊,加油 阅读全文
posted @ 2018-03-20 16:14 pprp 阅读(1470) 评论(0) 推荐(0) 编辑
摘要:Dijkstra 算法 简述 辅助空间 vis数组:记录是否已经判断过 dis数组:记录指定原点到其他点的距离 mp二维数组:记录图的信息 初始化 vis数组:设置为false dis:设置为原点为0,其余为inf mp:初始化为inf 最重要的初始化是将dis[i]=mp[st][i] 遍历操作 阅读全文
posted @ 2018-02-02 17:21 pprp 阅读(198) 评论(0) 推荐(0) 编辑
摘要:``` include include define LL long long using namespace std; const int maxn = 10000; LL a[maxn]; int n; //返回row的值 int xorGauss()//可以用来解模二的方程,加快速度 { in 阅读全文
posted @ 2017-12-24 17:45 pprp 阅读(197) 评论(0) 推荐(0) 编辑
摘要:AC自动机模板 2.4.1 头文件&宏&全局变量 2.4.2 辅助函数 2.4.3 主要函数 2.4.4 可选参考函数 2.4.5 用法 阅读全文
posted @ 2017-11-10 13:22 pprp 阅读(271) 评论(0) 推荐(0) 编辑
摘要:字典树 知识补充 ‘\0’和‘\n’的区别 '\0' 是一个字符串的结尾 '\n' 是换行符 gets 和 scanf 的区别 gets()函数总结: gets() 从标准输入设备读取字符串,以回车结束读取,使用'\0'结尾,回车符'\n'被舍弃没有遗留在缓冲区。 可以用来输入带空格的字符串。 可以 阅读全文
posted @ 2017-11-07 21:35 pprp 阅读(196) 评论(0) 推荐(0) 编辑
摘要:拓扑排序 writer:pprp 分析: 建立一个队列,将所有入度为0的节点放到队列中 输出该节点,更新与其相连的其他点的入度 再次将所有更新节点中入度为0的点加入队列 算法思路: 每次选取一个入度为0的点,将其从该图中删除,再按照以上步骤进行依次删除,如果不能删除那么说明存在环状结构导致没有入度为 阅读全文
posted @ 2017-11-05 21:35 pprp 阅读(414) 评论(0) 推荐(0) 编辑
摘要:广度搜索 链式前向星表示法 writer:pprp 分析: 参数:当前节点的标号为bfs的参数 注意:要另外开一个VIS数组进行涂色,涂过色的就不要再涂色了 head数组应该全置 1,VIS数组全置0 遍历的时候利用到了queue进行操作,注意应该在qu.front()和qu.pop()的位置 代码 阅读全文
posted @ 2017-11-05 20:29 pprp 阅读(271) 评论(0) 推荐(0) 编辑
摘要:深度搜索 链式前向星表示法 writer:pprp 分析: 参数:当前节点的标号为dfs的参数 注意:要另外开一个VIS数组进行涂色,涂过色的就不要再涂色了 head数组应该全置 1,VIS数组全置0 遍历的条件应该注意一下 k = edge[k].next 代码如下: 阅读全文
posted @ 2017-11-05 19:59 pprp 阅读(558) 评论(0) 推荐(0) 编辑
摘要:链式前向星 writer:pprp 分析:比较难以理解,关键代码其实很短 如下: 结点声明: 建立语句: 遍历语句: include using namespace std; const int maxn = 1000; struct node { int to; int w; int next; 阅读全文
posted @ 2017-11-05 16:01 pprp 阅读(865) 评论(1) 推荐(0) 编辑
摘要:同余问题 基本定理: 若a,b,c,d是整数,m是正整数, a = b(mod m), c = d(mod m) 1. a+c = b+c(mod m) 2. ac = bc(mod m) 3. ax+cy = bx+dy(mod m) 同余式可以相加 4. ac = bd(mod m) 同余式可以 阅读全文
posted @ 2017-10-15 15:21 pprp 阅读(269) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 7 下一页
点击右上角即可分享
微信分享提示