![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
201901acm
文章平均质量分 79
yikshing
这个作者很懒,什么都没留下…
展开
-
acm 第五天:图
转载 2019-01-17 13:52:53 · 121 阅读 · 0 评论 -
讲故事混下去20190123
图的表示昨天小明回复了我的消息,那么今天我要去小明家,好像情感发展进度很快呀,哈哈哈!现在我手头有一份地图,但是我不关心其他图例和注记,只想看我家和他家的联通关系,那么我家和他家都可以视为点,路径可以视为线(有时是桥),有时甚至有长短,有方式,比如坐船去和做飞机去,路线不一样,花费也不一样。我可以用邻接矩阵来记录,就是一个表,可以记录有向图(存在单行线),有的时候也会有环,似乎出租车司机欺负外...原创 2019-01-23 15:58:47 · 112 阅读 · 0 评论 -
讲故事混下去20190122
我有一段信息要传给小明,但是我不想让别人知道,于是我采取加密传送的方式。加密方法是第i个字乘以第i个素数在对7取摸。例如12345678加密为 12 23 35 47 511 613 717 819 -> 再取模 2 6 1 0 6 1 0 5于是我发送了26106105,小明同学收到并愉快地回复了。这里涉及两个数论知识:素数和取模。下面逐一讲解。素数C语言课上学习过寻找素数可...原创 2019-01-22 18:11:23 · 226 阅读 · 1 评论 -
acm 第十天:并查集&最小生成树
#include<iostream>#include<string.h>#include<algorithm>#include<cstdio>using namespace std;#define Max 110#define ll long long#define INF 0x3f3f3f3fint fa[1002],ans,n,...转载 2019-01-22 11:31:27 · 104 阅读 · 0 评论 -
acm 第九天:区间DP
末减初原创 2019-01-22 11:29:46 · 109 阅读 · 0 评论 -
POJ 1287 Networking 最小生成树_错误分析(只给了点的数量,没给边得数量)
POJ 1287 Networking 最小生成树在这里总结一下着几天做题的感悟,其实算法还算简单,只是你要静下心去参悟,所谓开窍了就好,所以耐心就好,还有就是现在是打基础,一定要扎牢;Runtime Error 运行错误,一般是数组开的太小Time Limit Exceeded 时间超限,也许是读入时没有加截至条件,程序一直在等待输入,就造成了超时,还有就是没有加!=EOFMemory...转载 2019-01-22 11:28:30 · 192 阅读 · 0 评论 -
acm 第四天:博弈
模板#include <cstdio>#include <cstdlib>#include <cstring>#include <map>#include <list>#include <algorithm>#include <iostream>using namespace std;int l转载 2019-01-16 10:33:25 · 87 阅读 · 0 评论 -
acm 第三天:STL整理(包含iterator和operator)
#include &amp;lt;bits/stdc++.h&amp;gt;或者要include好多个,如&amp;lt;string&amp;gt;。using namespace std;队列queue的函数q.pop() 删除queue的队头元素q.front() 返回队列的队头元素,但不删除该元素q.back() 返回队列的队尾元素,但不删除该元素q.push(arg) 将元...转载 2019-01-15 19:40:09 · 172 阅读 · 0 评论 -
acm 第三天:KMP
字符串匹配动图:https://blog.csdn.net/lxt_Lucia/article/details/79762636代码:#include <iostream>#include<cstdio>#include<algorithm>#include<cstdio>#include<cstring>#includ...转载 2019-01-15 19:10:02 · 80 阅读 · 0 评论 -
acm 第八天:动态规划
重点是推出状态转移方程(递推式)全局最优且前 i 步也最优int maxsum(int x,int y){ if(x==n) return mp[x][y]; int sum1=maxsum(x+1,y); int sum2=maxsum(x+1,y+1); if(sum1>sum2) return sum1+mp[x][y]; return s...转载 2019-01-20 11:07:19 · 103 阅读 · 0 评论 -
acm 第七天:贪心
#include <iostream> #include <algorithm> using namespace std; int main(){ int n, m, v[1024], res = 0, x, y ; cin >> n >> m ; for(int i = 1; i <= n; i++) cin >&...转载 2019-01-20 08:46:59 · 107 阅读 · 0 评论 -
acm第十一天:排列组合
基础:高中就学了的隔板法。提高:鸽巢定理—&gt;升级:Ramsey定理卡特兰数(第一类+第二类)转载 2019-01-24 16:46:38 · 336 阅读 · 0 评论 -
stl lower_bound()和up_bound()
iter=data.erase(iter);删掉转载:http://www.cnblogs.com/cobbliu/archive/2012/05/21/2512249.htmlSTL中的每个算法都非常精妙,接下来的几天我想集中学习一下STL中的算法。ForwardIter lower_bound(ForwardIter first, ForwardIter last,const _Tp&...转载 2019-01-24 16:44:03 · 196 阅读 · 0 评论 -
acm 第二天:搜索
广度搜索与深度搜索图的记录:邻接表邻接矩阵BFSDFSchar board[10][15];int k,n;bool vis[10]={};int f(int r,int m) {//当前已经搜索到第r行,还应再放m个棋子 if(m&lt;=0) return 1; if(r==n) return 0; int res=f(r+1,m); for(in...转载 2019-01-14 10:31:03 · 128 阅读 · 0 评论 -
acm 第一天:数论
数论转载自:https://www.cnblogs.com/zyf3855923/找素数 Miller_Rabin#include &lt;bits/stdc++.h&gt;#define maxn 10005using namespace std;typedef long long LL;const int inf= 1e9;struct Miller_Rabin{ L...转载 2019-01-13 16:20:46 · 117 阅读 · 0 评论 -
acm 第一天:二分查找法
二分查找法mark/*----qsort函数----*/#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;int cmp(const void*a,const void*b){ return *(int*)a-*(int*)b;}int main(){ int n; scanf("%d",转载 2019-01-13 16:05:11 · 214 阅读 · 0 评论 -
acm 第六天:树
#include<cstdio>#include<cstring>using namespace std;int head[10200];int headcnt;int res,t;struct list{ int u,v,w; int next;}edge[10200];void add(int u,int v,int w){ ed...转载 2019-01-18 10:35:50 · 110 阅读 · 0 评论 -
Supreme Number(找规律)(ACM-ICPC计蒜客)
A prime number (or a prime) is a natural number greater than1that cannot be formed by multiplying two smaller naturalnumbers.Now lets define a number N as the supreme number if and only if each num...原创 2019-05-05 20:12:48 · 170 阅读 · 0 评论