摘要: 原题目: "牛客网" 题目描述 : 现有一块大奶酪,它的高度为 h,它的长度和宽度我们可以认为是无限大的,奶酪中间有许多半径相同的球形空洞。我们可以在这块奶酪中建立空间坐标系, 在坐标系中,奶酪的下表面为 z = 0,奶酪的上表面为 z = h。 现在, 奶酪的下表面有一只小老鼠 Jerry, 它知 阅读全文
posted @ 2019-08-08 12:11 十魇 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 原题: " 牛客网 " 动态规划dynamic programming 的入门级题目 题目描述 : 给你一个长度为50的数字串,问你有多少个子序列构成的数字可以被3整除 答案对1e9+7取模 输入描述: 输入一个字符串,由数字构成,长度小于等于50 输出描述: 输出一个整数 示例 输入: 132 输 阅读全文
posted @ 2019-08-07 15:40 十魇 阅读(360) 评论(0) 推荐(0) 编辑
摘要: B. Subsegments set进阶 Programmer Sasha has recently begun to study data structures. His coach Stas told him to solve the problem of finding a minimum o 阅读全文
posted @ 2019-08-07 11:57 十魇 阅读(164) 评论(0) 推荐(0) 编辑
摘要: F. Vanya and Label While walking down the street Vanya saw a label "Hide&Seek". Because he is a programmer, he used & as a bitwise AND for these two w 阅读全文
posted @ 2019-08-06 12:51 十魇 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 浅入动态规划 dynamic programming is a method for solving a complex problem by breaking it down into a collection of simpler subproblems. 最近进行动态规划的学习,看到了一个很好 阅读全文
posted @ 2019-07-31 13:34 十魇 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 时间性能 算法复杂性函数: $$ f(n)=n^2 +1000n+\log_{10}n+1000 $$ 当n的数据规模逐渐增大时,f(n)的增长趋势: 当n增大到一定值以后,计算公式中影响最大的就是n的幂次级最高的项,并且其他的常数项和低幂次项都可以忽略,我们更关注的是它是一个什么量级的算法,是线性 阅读全文
posted @ 2019-07-29 10:21 十魇 阅读(210) 评论(0) 推荐(0) 编辑
摘要: STL初步 提交ACM会TLE /仅以学习STL与迭代器使用 C. Cards Sorting time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outp 阅读全文
posted @ 2019-07-26 15:52 十魇 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 二叉树的编号 例题 6 6 小球下落问题 有一棵二叉树,最大深度为D,且所有叶子深度都相同。所有节点从上到下,从左到右编号为1,2,3,4,....,2^D 1。在节点1处放置小球,他会往下落。每个节点上都有一个开关,初始全部关闭,每当有小球落到一个开关上时,状态都会改变,当一个小球到达节点时,如果 阅读全文
posted @ 2019-07-25 09:46 十魇 阅读(252) 评论(0) 推荐(0) 编辑
摘要: D Candies! Consider a sequence of digits of length [a1,a2,…,a]. We perform the following operation with it: replace pairs (a2i+1,a2i+2) with (a2i+1+a2 阅读全文
posted @ 2019-07-25 09:09 十魇 阅读(277) 评论(0) 推荐(0) 编辑
摘要: typedef的用法 typedef关键字可以用于给数据类型定义一个别名,即可以给long long 定义成ll,也可以给结构体定义,当你定义了一个结构体时,每次创建一个结构体都要使用struct+结构体名的方式,而用了typedef之后,只要s使用定义好的结构体别名就可以创建了。例如 该代码实际完 阅读全文
posted @ 2019-07-20 11:34 十魇 阅读(247) 评论(0) 推荐(0) 编辑
GenerateContentList