04 2020 档案

摘要:组合c(n,m)的三种计算方法 普通、杨辉打表、质因数分解 阅读全文
posted @ 2020-04-30 21:53 Jason66661010 阅读(3496) 评论(0) 推荐(0) 编辑
摘要:求n个数的全排列 阅读全文
posted @ 2020-04-30 21:42 Jason66661010 阅读(944) 评论(0) 推荐(0) 编辑
摘要:线性筛 埃式筛 欧拉筛 阅读全文
posted @ 2020-04-30 21:38 Jason66661010 阅读(258) 评论(0) 推荐(0) 编辑
摘要:线段树的相关知识,分为求区间最值与求区间和两个版本,分别讲解线段树的单点更新、区间查询、区间更新、区间查询。 阅读全文
posted @ 2020-04-29 10:24 Jason66661010 阅读(195) 评论(0) 推荐(1) 编辑
摘要:动态规划中的最长公共子序列问题 阅读全文
posted @ 2020-04-27 22:04 Jason66661010 阅读(253) 评论(0) 推荐(0) 编辑
摘要:动态规划问题中的数塔问题 阅读全文
posted @ 2020-04-27 21:58 Jason66661010 阅读(570) 评论(0) 推荐(0) 编辑
摘要:动态规划的基本思想 如果各个子问题不是独立的,不同的子问题的个数只是多项式量级,如果我们能够保存已经解决的子问题的答案,而在需要的时候再找出已求得的答案,这样就可以避免大量的重复计算。由此而来的基本思路是,用一个表记录所有已解决的子问题的答案,不管该问题以后是否被用到,只要它被计算过,就将其结果填入 阅读全文
posted @ 2020-04-27 21:54 Jason66661010 阅读(331) 评论(0) 推荐(0) 编辑
摘要:大数问题:包括大数加减乘除以及阶乘 阅读全文
posted @ 2020-04-27 18:29 Jason66661010 阅读(414) 评论(0) 推荐(0) 编辑
摘要:题目 有n种物品和一个容积为V的背包,第i种物品有amount[i]个,体积cost[i]和价值valum[i],问如何选取物品使得放入背包的物品价值之和最大。 优化 amount[i]==1时,当01背包处理。 amount[i]≥1时,采用二进制拆分,从而转换成01背包求解,具体如下: 在上面的 阅读全文
posted @ 2020-04-27 18:17 Jason66661010 阅读(556) 评论(0) 推荐(0) 编辑
摘要:有N种物品和一个容量为V的背包。第i种物品最多有p[i]件可用,每件费用是w[i],价值是v[i]v[i]v[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。 具体转换为01背包的策略: 二进制拆分 将第i种物品分成若干件物品,其中 例如意见物品的p【i】为13,则 阅读全文
posted @ 2020-04-27 18:14 Jason66661010 阅读(518) 评论(0) 推荐(1) 编辑
摘要:完全背包问题 阅读全文
posted @ 2020-04-27 18:10 Jason66661010 阅读(155) 评论(0) 推荐(0) 编辑
摘要:01背包问题 阅读全文
posted @ 2020-04-27 17:24 Jason66661010 阅读(543) 评论(0) 推荐(1) 编辑
摘要:树状数组的相关知识,未完结待更新 阅读全文
posted @ 2020-04-26 22:28 Jason66661010 阅读(307) 评论(0) 推荐(0) 编辑
摘要:1.题目A reversible prime in any number system is a prime whose "reverse" in that number system is also a pri... 阅读全文
posted @ 2020-04-25 21:36 Jason66661010 阅读(118) 评论(0) 推荐(0) 编辑
摘要:1.题目It is vitally important to have all the cities connected by highways in a war. If a city is occupied b... 阅读全文
posted @ 2020-04-24 19:22 Jason66661010 阅读(124) 评论(0) 推荐(0) 编辑
摘要:1.题目Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answ... 阅读全文
posted @ 2020-04-24 16:26 Jason66661010 阅读(96) 评论(0) 推荐(0) 编辑
摘要:1.题目A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members ... 阅读全文
posted @ 2020-04-24 15:23 Jason66661010 阅读(103) 评论(0) 推荐(0) 编辑
摘要:参考https://blog.csdn.net/zhang__shuang_/article/details/86578800例题题目描述: 求任意两个不同进制非负整数的转换(2进制~16进制),所给整数在lon... 阅读全文
posted @ 2020-04-23 16:25 Jason66661010 阅读(636) 评论(0) 推荐(0) 编辑
摘要:1.题目People often have a preference among synonyms of the same word. For example, some may prefer "the poli... 阅读全文
posted @ 2020-04-21 16:06 Jason66661010 阅读(83) 评论(0) 推荐(0) 编辑
摘要:1.题目Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of... 阅读全文
posted @ 2020-04-21 15:26 Jason66661010 阅读(86) 评论(0) 推荐(0) 编辑
摘要:1.题目For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in n... 阅读全文
posted @ 2020-04-21 14:58 Jason66661010 阅读(95) 评论(0) 推荐(0) 编辑
摘要:1.题目Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elemen... 阅读全文
posted @ 2020-04-17 09:56 Jason66661010 阅读(113) 评论(0) 推荐(0) 编辑
摘要:1.题目Scientific notation is the way that scientists easily handle very large numbers or very small numbers.... 阅读全文
posted @ 2020-04-17 09:49 Jason66661010 阅读(120) 评论(0) 推荐(0) 编辑
摘要:1.题目A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involv... 阅读全文
posted @ 2020-04-16 21:10 Jason66661010 阅读(101) 评论(0) 推荐(0) 编辑
摘要:1.题目The task of this problem is simple: insert a sequence of distinct positive integers into a hash table,... 阅读全文
posted @ 2020-04-16 20:36 Jason66661010 阅读(86) 评论(0) 推荐(0) 编辑
摘要:1.题目The Japanese language is notorious for its sentence ending particles. Personal preference of such part... 阅读全文
posted @ 2020-04-16 19:54 Jason66661010 阅读(92) 评论(0) 推荐(0) 编辑
摘要:1.题目Given a list of N student records with name, ID and grade. You are supposed to sort the records with r... 阅读全文
posted @ 2020-04-16 18:35 Jason66661010 阅读(94) 评论(0) 推荐(0) 编辑
摘要:1.题目Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.In... 阅读全文
posted @ 2020-04-16 15:55 Jason66661010 阅读(90) 评论(0) 推荐(0) 编辑
摘要:1.题目Indeed there are many different tourist routes from our city to Rome. You are supposed to find your cl... 阅读全文
posted @ 2020-04-16 10:43 Jason66661010 阅读(123) 评论(0) 推荐(0) 编辑
摘要:1.题目An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, ... 阅读全文
posted @ 2020-04-15 18:53 Jason66661010 阅读(92) 评论(0) 推荐(0) 编辑
摘要:1.题目Given a sequence of positive integers and another positive integer p. The sequence is said to be a per... 阅读全文
posted @ 2020-04-15 10:29 Jason66661010 阅读(90) 评论(0) 推荐(0) 编辑
摘要:1.题目On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters c... 阅读全文
posted @ 2020-04-15 10:26 Jason66661010 阅读(95) 评论(0) 推荐(0) 编辑
摘要:1.题目A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involv... 阅读全文
posted @ 2020-04-15 09:44 Jason66661010 阅读(116) 评论(0) 推荐(0) 编辑
摘要:1.题目According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growi... 阅读全文
posted @ 2020-04-15 09:04 Jason66661010 阅读(108) 评论(0) 推荐(0) 编辑
摘要:1.题目For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their... 阅读全文
posted @ 2020-04-15 08:59 Jason66661010 阅读(97) 评论(0) 推荐(0) 编辑
摘要:理解 我们可以把N个数两两建立无向边(即任意两个结点之间都有边,也就是一个N个结点的完全图),然后对每个点作为起点,分别做一次深度优先遍历,当所有点都已经标记时输出当前的遍历路径,就是其中一个排列,这里需要注意,回溯的时候需要将原先标记的点的标记取消,否则只能输出一个排列。如果要按照字典序,则需要在 阅读全文
posted @ 2020-04-11 23:08 Jason66661010 阅读(173) 评论(0) 推荐(0) 编辑
摘要:1.题目A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belon... 阅读全文
posted @ 2020-04-11 20:15 Jason66661010 阅读(105) 评论(0) 推荐(0) 编辑
摘要:1.题目The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and t... 阅读全文
posted @ 2020-04-11 17:02 Jason66661010 阅读(88) 评论(0) 推荐(0) 编辑
摘要:1.题目Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy s... 阅读全文
posted @ 2020-04-11 16:59 Jason66661010 阅读(102) 评论(0) 推荐(0) 编辑
摘要:1.题目A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:... 阅读全文
posted @ 2020-04-11 16:56 Jason66661010 阅读(93) 评论(0) 推荐(0) 编辑
摘要:1.题目According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growi... 阅读全文
posted @ 2020-04-11 16:24 Jason66661010 阅读(83) 评论(0) 推荐(0) 编辑
摘要:1.题目Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated a... 阅读全文
posted @ 2020-04-10 20:42 Jason66661010 阅读(151) 评论(0) 推荐(0) 编辑
摘要:1.题目Among all the factors of a positive integer N, there may exist several consecutive numbers. For exampl... 阅读全文
posted @ 2020-04-10 14:37 Jason66661010 阅读(125) 评论(0) 推荐(0) 编辑
摘要:1.题目The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Hom... 阅读全文
posted @ 2020-04-09 22:18 Jason66661010 阅读(95) 评论(0) 推荐(0) 编辑
摘要:1.题目There is a classical process named partition in the famous quick sort algorithm. In this process we ty... 阅读全文
posted @ 2020-04-09 21:09 Jason66661010 阅读(99) 评论(0) 推荐(0) 编辑
摘要:1.题目People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars. The numbers 1 ... 阅读全文
posted @ 2020-04-09 21:01 Jason66661010 阅读(122) 评论(0) 推荐(0) 编辑
摘要:1.题目When register on a social network, you are always asked to specify your hobbies in order to find some ... 阅读全文
posted @ 2020-04-09 20:54 Jason66661010 阅读(143) 评论(0) 推荐(0) 编辑
摘要:1.题目This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing... 阅读全文
posted @ 2020-04-08 16:35 Jason66661010 阅读(108) 评论(0) 推荐(0) 编辑
摘要:1.题目Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For exampl... 阅读全文
posted @ 2020-04-08 16:32 Jason66661010 阅读(102) 评论(0) 推荐(0) 编辑
摘要:1.题目Input our current position and a destination, an online map can recommend several paths. Now your job ... 阅读全文
posted @ 2020-04-08 16:28 Jason66661010 阅读(120) 评论(0) 推荐(0) 编辑
摘要:1.题目Given a tree, you are supposed to tell if it is a complete binary tree.Input Specification:Each input ... 阅读全文
posted @ 2020-04-07 19:08 Jason66661010 阅读(104) 评论(0) 推荐(0) 编辑
摘要:1.题目Formation is very important when taking a group photo. Given the rules of forming K rows with N people... 阅读全文
posted @ 2020-04-07 17:00 Jason66661010 阅读(101) 评论(0) 推荐(0) 编辑
摘要:1.题目The basic task is simple: given N real numbers, you are supposed to calculate their average. But what ... 阅读全文
posted @ 2020-04-07 16:51 Jason66661010 阅读(180) 评论(0) 推荐(0) 编辑
摘要:1.题目This time, you are supposed to help us collect the data for family-owned property. Given each person's... 阅读全文
posted @ 2020-04-07 16:49 Jason66661010 阅读(142) 评论(0) 推荐(0) 编辑
摘要:1.题目A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:... 阅读全文
posted @ 2020-04-07 14:52 Jason66661010 阅读(86) 评论(0) 推荐(0) 编辑
摘要:1.题目Given a set of N (>1) positive integers, you are supposed to partition them into two disjoint sets A​1... 阅读全文
posted @ 2020-04-06 16:44 Jason66661010 阅读(60) 评论(0) 推荐(0) 编辑
摘要:1.题目On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the charac... 阅读全文
posted @ 2020-04-06 16:26 Jason66661010 阅读(91) 评论(0) 推荐(0) 编辑
摘要:1.题目An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtr... 阅读全文
posted @ 2020-04-02 18:44 Jason66661010 阅读(114) 评论(0) 推荐(0) 编辑
摘要:1.题目Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in t... 阅读全文
posted @ 2020-04-02 11:20 Jason66661010 阅读(91) 评论(0) 推荐(0) 编辑
摘要:1.题目British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he ... 阅读全文
posted @ 2020-04-02 09:38 Jason66661010 阅读(76) 评论(0) 推荐(0) 编辑
摘要:1.题目"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Techn... 阅读全文
posted @ 2020-04-02 09:37 Jason66661010 阅读(86) 评论(0) 推荐(0) 编辑
摘要:1.题目The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a c... 阅读全文
posted @ 2020-04-01 11:45 Jason66661010 阅读(113) 评论(0) 推荐(0) 编辑
摘要:1.题目"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find ... 阅读全文
posted @ 2020-04-01 11:08 Jason66661010 阅读(95) 评论(0) 推荐(0) 编辑
摘要:1.题目Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is th... 阅读全文
posted @ 2020-04-01 11:06 Jason66661010 阅读(80) 评论(0) 推荐(0) 编辑
摘要:1.题目Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be... 阅读全文
posted @ 2020-04-01 09:57 Jason66661010 阅读(105) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示