Competitive Programmer's Handbook下载

weixin_39820780 2020-06-26 12:00:38
Competitive Programmer's Handbook
相关下载链接://download.csdn.net/download/wizardforcel/10799382?utm_source=bbsseo
...全文
48 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
演算法的handbookPreface ix I Basic techniques 1 1 Introduction 3 1.1 Programming languages . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Input and output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 Working with numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.4 Shortening code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.5 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.6 Contests and resources . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2 Time complexity 17 2.1 Calculation rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.2 Complexity classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.3 Estimating efficiency . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.4 Maximum subarray sum . . . . . . . . . . . . . . . . . . . . . . . . . 21 3 Sorting 25 3.1 Sorting theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.2 Sorting in C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.3 Binary search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4 Data structures 35 4.1 Dynamic arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.2 Set structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4.3 Map structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.4 Iterators and ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.5 Other structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.6 Comparison to sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 5 Complete search 47 5.1 Generating subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.2 Generating permutations . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.3 Backtracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.4 Pruning the search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.5 Meet in the middle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6 Greedy algorithms 57 6.1 Coin problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.2 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.3 Tasks and deadlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.4 Minimizing sums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.5 Data compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7 Dynamic programming 65 7.1 Coin problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 7.2 Longest increasing subsequence . . . . . . . . . . . . . . . . . . . . . 70 7.3 Paths in a grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.4 Knapsack problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.5 Edit distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 7.6 Counting tilings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 8 Amortized analysis 77 8.1 Two pointers method . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 8.2 Nearest smaller elements . . . . . . . . . . . . . . . . . . . . . . . . . 79 8.3 Sliding window minimum . . . . . . . . . . . . . . . . . . . . . . . . . 81 9 Range queries 83 9.1 Static array queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 9.2 Binary indexed tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 9.3 Segment tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 9.4 Additional techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 10 Bit manipulation 95 10.1 Bit representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 10.2 Bit operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 10.3 Representing sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 10.4 Bit optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 10.5 Dynamic programming . . . . . . . . . . . . . . . . . . . . . . . . . . 102 II Graph algorithms 107 11 Basics of graphs 109 11.1 Graph terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 11.2 Graph representation . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 12 Graph traversal 117 12.1 Depth-first search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 12.2 Breadth-first search . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 12.3 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

12,779

社区成员

发帖
与我相关
我的任务
社区描述
CSDN 下载资源悬赏专区
其他 技术论坛(原bbs)
社区管理员
  • 下载资源悬赏专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧