- 博客(44)
- 收藏
- 关注
原创 关于wifi连接不上的问题
今天电脑开机重启后 enable-wifi就黑掉了...... 然后开始查的是用ifconfig查看网络状态(我也看不懂,感觉和我之前看的没区别,就认为是正确的) 然后有这样一个命令: rfkill list(依据我的理解,是用来查联网蓝牙卡的) 0: tpacpi_bluetooth_sw: Bluetooth Soft blocked: no Hard block
2016-05-02 21:14:24
595
原创 Codeforces Round #340 (Div. 2)
这场的codeforces异常简单 几乎没有什么算法题//虽然codeforces一直如此,想法题多于算法题 A签到题 B我的思路一开始很正确: 数连续出现的0的个数(夹在两个1中间才有效) 最后把这个连续0的个数都加1然后乘起来就是结果//就是高中数学中挡板问题 但是在做的时候出现了一点小纰漏 就是没考虑只有夹在两个1中间的连续的0是有效的 不然 0001100
2016-01-24 10:58:41
337
原创 codeforces edutional Round
个人感觉edutional专场难度低于正常的比赛 做了几个专场 Round 6: 这场比较简单,我做了5个题,其中,E题是线段树,非常简单,可我不会线段树,因此这题没有做 以下是题目简述 A,B签到题 C刚开始我是用^来做的,结果发现1^2^3也能出来0,忘记之前是哪个奇怪的题了,或许是我没注意使用条件//记性不好 然后用map做,不难,下面是代码: #includ
2016-01-23 15:49:55
398
原创 寒假
前期忙着期末,没怎么敲题 //虽然期末又考的一塌糊涂 寒假是时候补一波题了 想考toefl,总之就是很多事要干 总之,虽然能力不行,可也不能颓废,恩,年轻人,多做点总是好的 新年flag: 1,TOEFL,GRE一考过//TOEFL最好能上110 2,下学期的均分过95 3,ACM能走多远是多远吧 4,瘦十斤! 我不贪心,只有这四个愿望,
2016-01-19 17:09:51
412
原创 Codeforces Round#339 div1,div2
A 这个题一点都不难,不过竟然会爆long long 代码如下 #include #include #include #include #include #define LL long long using namespace std; int main(){ LL l,r,k; while(~scanf("%lld%lld%lld",&l,&r,&k)){
2016-01-19 17:02:25
323
原创 打表
有一次在BC上遇到了一个其实挺难的数学题,不过这个数学题又不是特别难,因为这个可以打表强过,因为打表出来杰伦特别容易看出来也很好写fn(x)=x+n+1 然后套个欧拉函数的模板就过了......
2015-12-13 11:05:10
499
原创 multiset
在写BC的一个题时碰到了multiset,在这里来写一写 hdu 5596 multiset我把具体用法写到注释里吧...... #include #include #include #include #include #include #include using namespace std; const int maxn = 50000 + 40
2015-12-13 10:14:29
262
原创 hdu 2089
中文题,不需要理解题意 dp[i][j]表示长度为i,首字母为j的字符串的数目 有好多细节要注意,我刚开始想的不清,就一直在WA,以后写题想清再写...... 还是代码能力弱 附代码 #include #include #include #include #include using namespace std; int dp[10][1
2015-12-07 18:13:15
284
原创 poj 3185
这个题可以用高斯消元来解,那就是水题 不过有很多有意思的解法,例举一二 1贪心: 从左到右枚举一边(每个硬币翻还是不翻仅由其前面的硬币的状态决定) 但是有这种情况: 110000000...(省略n多个0) 可证,反而是从第一个开始翻就比较好 这样就从右再向左枚举一边 两次枚举,得结果 也可这样看,枚举第一个硬币翻还是不翻
2015-12-01 12:13:46
311
转载 高斯消元应用 开关问题
最近在做数论时做到这一部分相关内容了 下面是一些题目 poj 1222 30个格子,就是30个方程,30个未知数。 高斯消元法 对于每个灯的两灭有影响的开关就是它附近十字形内的五个开关。所以对于每个灯可以列一个方程,即周围五个开关异或起来的结果应该可以使该灯熄灭。 就是利用线性代数知识,写出增广矩阵,化为阶梯形矩阵,有下到上依次解出各未知量。 以下是代码
2015-11-30 13:46:27
307
转载 基础知识
先上网址 http://acm.nenu.edu.cn/us/2014/08/30/%E6%95%B0%E8%AE%BA%E5%9F%BA%E7%A1%80%E8%AE%B2%E8%A7%A3/
2015-11-29 12:32:17
231
转载 Dilworth
在做题的时候无意中做到了这方面的题,这个是离散中的一个知识点 我觉得和贪心区别不大 说到偏序集,在离散里的定义是: 设R为非空集合A上的关系,如果R是自反的、反对称的和传递的,则称R为A上的偏序关系,简称偏序,记作≤。 偏序是在集合X上的二元关系≤(这只是个抽象符号,不是“小于或等于”),它满足自反性、反对称性和传递性。即,对于X中的任意元素a,b和c,有: 自反
2015-11-29 11:44:38
378
转载 二分图 KM算法应用
poj 2195 这个之前用最小费用流做过,思路还是很清晰的 这次用的是KM算法(求权值最大,不过求最小权值的话,把权值取负就行了) 算是模板题 下面是代码,也算是KM的模板,还是用的kuangbin的 #include #include #include #include #include using namespace std; //***********
2015-11-27 16:45:37
434
原创 理论知识
http://www.cnblogs.com/kuangbin/archive/2011/08/09/2132828.html //匈牙利算法 http://www.cnblogs.com/kuangbin/archive/2012/08/19/2646535.html //匡斌的博客,讲KM算法的
2015-11-27 16:37:55
220
原创 poj 2724
这个题比较有意思,我单独开一个来写一写 题意: 题意:迈克有一台可以净化奶酪的机器,用二进制表示净化的奶酪的编号。但是,在某些二进制串中可能包含有‘*'。例如01*100,'*'其实就代表可以取0,1两种情况--> 010100 和011100。现在由于迈克不小心,他以同样的方式弄脏了某些奶酪,问你最少用多少次操作就可以把弄脏的奶酪全净化好。(没有被弄脏过的奶酪不能净化。弄脏过的奶酪可
2015-11-27 13:14:48
411
原创 位运算的一些巧用
判断二进制是否之差一位,我一开始自己写得,后来发现有这个好东西,位运算太强大了! C=A^B; C&&((C&(C-1))==0)为真,则成立(A,B二进制表示仅有一位不同) 判断A,B的二进制表示是否只有一位不相同
2015-11-27 12:48:46
391
原创 二分图 匈牙利算法应用
匈牙利算法是kuangbin的 poj 1274 poj 2239 //水题 poj 2584 这个还是有点想法的,把每种衣服拆成n件衣服(每件衣服都是一个单独的节点),然后依次连接 下面是代码,思路还是比较清晰的 #include #include #include #include using namespace std; /* *****************
2015-11-26 13:02:41
388
原创 网络流
网络流模板题 模板来自kuangbin #include #include #include #include using namespace std; const int MAXN=110; const int INF=0x7fffffff; int map[MAXN][MAXN],path[MAXN],flow[MAXN],start,end; in
2015-11-16 16:03:18
332
转载 hdu 1496
之前做过一个类似的题 还是学得不好 #include #include #include using namespace std; const int M = 175447; int counts[M]; int result[M]; int temp[101]; int hashInt(int s) { int k = s % M; if (k < 0)
2015-11-12 18:18:34
422
原创 hdu 1482
额,这个题原本也是挂到hash上的,结果又是水题 ...... #include #include #include #include #include #include using namespace std; char a[100],l[30],r[30],w[30]; int vis[30]; void ori(){ for(int
2015-11-12 09:35:59
290
原创 hdu 1755
恩,不算很难 #include #include #include #include #include #include using namespace std; const int maxn = 500000 ; int arr[15]; int cnt; int n; int num[maxn]; int getnum(){ int re=0; for(i
2015-11-11 15:48:56
293
原创 hdu 1800
我原本挂了个hash专场,不知在哪里看的,把这个题也挂上去了 毛线hash,大水题好吧...... #include #include #include #include #include #define LL long long using namespace std; const LL maxn = 3000 + 30 ; LL arr[maxn]; int m
2015-11-11 14:48:43
270
转载 poj 2002
给你一些点,求这些点中可以组成的正方形的个数 额,把点存起来,然后找的时候用Hash,依次枚举两个点(枚举任意两个点,其他两个点都可以确定,左边一个,右边一个)最后/4(每天边都枚举了4遍) 然后,就没有然后了 #include #include #include using namespace std; const int N = 1010; con
2015-11-11 13:45:11
248
原创 poj 3349
雪花 额,刚开始不知是怎么回事,数组开小了RE,开大了MLE 然后我换了个MOD,过了...... #include #include #include #include #include #include #define MOD 14997 using namespace std; const int maxn = 15000 + 20
2015-11-10 20:12:41
278
原创 poj 1200
题意: 给你n,nc nc表示这个字符串由nc个不同字符组成 让你求长度为n的不同子串的个数 用hash,把字符串转化成十进制数,然后一个一个访问就行了(按照这个道理,MAP应该也是可以的,不过我没试,不知道) 然后我来说我这次犯的几个该打脸的错误 for(int i=0;i+n-1 for(int j=i;j tmp=tmp*cnt+num[str[j
2015-11-10 19:01:28
456
原创 poj 2503
这个题吧,我是水过去的,然而,一看有些想法真的不错 1MAP除了输入之外,没其他要注意的了#include #include #include #include #include #include #include #include #include #include #include #include #include #include #pragm
2015-11-10 09:19:24
253
原创 poj 2785
这也许是最简单的hash #include #include #include #include #include #include const int MOD = 1e7+9 ; using namespace std; const int maxn = 16000011 ; int hash[maxn],cnt[maxn]; int maze[4010][5]; void o
2015-11-09 21:11:50
314
原创 2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Prefer
A 题意:有几个邮箱,格式为@bmail.com的邮箱login域从第一个+到@之间的字符可全忽略 给mail分类 不难 #include using namespace std; map > mp; string cal(string ss) { int len=ss.size(); for(size_t t=0;t<len;t++) ss[t]=t
2015-10-19 19:43:08
389
原创 string.find() string.substr();
string.find('a') 返回第一个出现a的位置,下标(注:非指针) string类的查找函数: int find(char c, int pos = 0) const;//从pos开始查找字符c在当前字符串的位置 int find(const char *s, int pos = 0) const;//从pos开始查找字符串s在当前串中的位置 int find(const char
2015-10-19 14:10:47
415
原创 tolower()
功能:把字符转化成小写字母,非字母字符则不作任何处理 头文件 // tolower(a); 只能为单个字符//只能一位一位处理
2015-10-19 14:08:51
357
转载 poj 题目分类
初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法:
2015-10-17 14:54:43
366
转载 poj 1321
dfs #include #include #include using namespace std; char chess[10][10]; int col[10]; int n,m,ans; void dfs(int row,int num) { int i,j; if(num==m) { ans++; return; } for(i=row+1;i<=n;i++)
2015-10-17 14:49:26
287
转载 poj 3009
dfs 我使用dfs来做的,因为涉及到Maze的形状时刻在变,撞到block后,该block就消失,用bfs还要保存Maze,不方便 上代码 算水题 #include #include #include #include #include using namespace std; #define inf 0x3f3f3f //0 vacant 1
2015-10-17 14:33:11
256
转载 uva 10054
#include #include #include #include #include #include using namespace std; const int maxn = 50+20; const int n = 50; int deg[maxn], G[maxn][maxn], m; void euler(int u){ for(int v=1; v<=n
2015-10-15 20:17:54
304
转载 无向图欧拉回路求法
poj 1041 这个题比较难,然后我也不懂,看了看别人的题解,算是懂了点,但仍然感觉思路不是很清楚 看看http://www.cnblogs.com/ylfdrib/archive/2010/08/24/1807602.html 这个讲的比较好 这道题很不错,由于图已经保证连通,首先用度数是否是偶数,判断图是否是欧拉图,然后,输出最小升序,就成了一大难题,
2015-10-15 19:53:18
1691
转载 Fleury算法
其实就是个dfs Fleury算法: 1.判定该图是否为Euler图,包括有向欧拉通路,有向欧拉回路,无向欧拉通路,无向欧拉回路: 有向欧拉通路:起点:出度-入度=1,终点:入度-出度=1,其它点:入度==出度 有向欧拉回路:所有点:入度==出度 无向欧拉通路:仅有两个奇度点 无向欧拉回路:无奇度点 2.选择起点 3.采用dfs寻找Euler路径。 附无向图欧拉通
2015-10-15 18:57:42
711
原创 无向图欧拉回路的判定
hdu 1878 有这么几点 1无向图各点度数为偶数 2用bfs搜一遍,还有没搜到的点,就非欧拉回路 代码(我开110的数组RE,开成1010就AC) #include #include #include #include #include #include #include #include using namespace std; const int maxn = 1
2015-10-15 14:36:41
339
原创 poj 3414
#include #include #include #include #include using namespace std; const int maxn = 100 + 10; int A,B,C; int vis[maxn][maxn]; struct node{ int a,b,step; char str[111][111]; }; bool bfs(){ q
2015-10-15 13:58:41
271
原创 poj 3126
还是宽搜 题目大意:给你两个素数,从第一个素数变到第二个素数,每次只能变一位, 保证变化过程所有出现的数都是素数 求最少变化次数 直接上代码#include #include #include #include #include #include const int maxn = 100000 + 10; using namespace std; int a,b; bool
2015-10-14 14:31:03
251
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅