![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
《算法竞赛进阶指南》
become__better
大胆去问,大胆去做,效率
展开
-
0101 a^b (快速幂) 《算法竞赛进阶指南》P4
题目地址:http://contest-hunter.org:83/contest/0x00「基本算法」例题/0101 a^b#include <iostream>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <algorithm>usi...原创 2019-05-14 20:53:39 · 145 阅读 · 0 评论 -
0102 64位整数乘法 《算法竞赛进阶指南》 P5
题目地址:http://contest-hunter.org:83/contest/0x00「基本算法」例题/0102 64位整数乘法做法1: 类似于快速幂#include <iostream>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <a...原创 2019-05-15 18:56:58 · 143 阅读 · 0 评论 -
Strange Towers of Hanoi POJ 1985 (递推) 《算法竞赛进阶指南》P14
题目地址:http://contest-hunter.org:83/contest/0x00「基本算法」例题/POJ1958 Strange Towers of Hanoi这是一个有四座塔的汉诺塔(可百度)问题,在汉诺塔问题中,最后你必须留出一座塔把盘子移到最终柱子上。f[]表示在四座塔情况下的移动步数,d[]表示在三座塔下的移动步数,因此f[n]=min 1<=i<n (2*f[...原创 2019-06-12 19:50:17 · 125 阅读 · 0 评论 -
最短Hamilton路径 CH0103 《算法竞赛进阶指南》P7
题目地址:http://contest-hunter.org:83/contest/0x00‘二进制状态压缩挺全面的一个题#include <iostream>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <algorithm>usin...原创 2019-06-06 16:24:28 · 146 阅读 · 0 评论 -
递归 《算法竞赛进阶指南》P12 Contest Hunter
题目地址分别为:http://contest-hunter.org:83/contest/0x00「基本算法」例题/0301 递归实现指数型枚举http://contest-hunter.org:83/contest/0x00「基本算法」例题/0302 递归/非递归实现组合型枚举http://contest-hunter.org:83/contest/0x00「基本算法」例题/0303 递归实...原创 2019-06-08 15:41:49 · 417 阅读 · 0 评论 -
费解的开关 CH 0201 (递推?) 《算法竞赛进阶指南》P14
题目地址:http://contest-hunter.org:83/contest/0x00「基本算法」例题/0201 费解的开关求灯全亮,我开始求了全灭。 读题很重要, 哭哭每一个灯可以由以及其上下左右五盏灯来影响。每个位置至多只会被点击一次,点击的顺序不影响最终结果。我们先用二进制枚举暴力假定第一行的点击情况,把第一行固定好,若发现第一行存在灯灭,只能通过点击第二行的灯会处理(第一行的点...原创 2019-06-10 21:54:43 · 314 阅读 · 1 评论 -
ACWING 245. 你能回答这些问题吗(线段树 区间最大连续子段和)《算法竞赛进阶指南》P213
题目地址:https://www.acwing.com/problem/content/description/246/非常经典的一道题。显然[l,r]区间的最大子段和就是左区间的最大子段和,右区间最大子段和,以及左右两区间结合在一起中间的最大子段和.#include<iostream>#include<cstdio>#include<cstring>...原创 2019-07-31 10:54:42 · 191 阅读 · 0 评论 -
AcWing 98. 分形之城 (分形)
题目地址:htts://www.acwing.com/problem/content/100/#include <iostream>#include <stdio.h>#include <vector>#include <map>#include <utility>#include <math.h>#includ...原创 2019-09-06 21:06:37 · 167 阅读 · 0 评论