<img src="http://image.baidu.com/search/detailidlsimipic?tn=detailidlsimipic&dututype=similar&word=&pn=0&queryurl=http%3A%2F%2Fa.hiphotos.baidu.com%2F... ...
分类:
其他好文 时间:
2018-07-27 14:43:29
阅读次数:
163
/ 斐波那契数列是 f(0)=0 n=0 f(1)=1 n=1 f(n 1)+f(n 2) n 1 如果采用递归求数列,有很多数字需要重复计算多次,采用分治法可以避免重复计算, 使计算的时间复杂段由指数级变为线性的O(n) / public int fibonacci(int n){ int rs ...
分类:
其他好文 时间:
2018-07-25 20:45:34
阅读次数:
212
[CF126D]Fibonacci Sums/[BJOI2012]最多的方案 题目大意: 将$n(n\le10^9)$表示成若干个不同斐波那契数之和的形式,求方案数。 思路: 如果不考虑$0$,则$10^9$以内的斐波那契数只有86个。 首先求出字典序最大的方案,考虑分裂里面的数。 用$c_i$表示 ...
分类:
其他好文 时间:
2018-07-25 16:22:59
阅读次数:
173
Two arrays are called similar if one can be obtained from another by swapping at most one pair of elements in one of the arrays. Given two arrays a an ...
分类:
其他好文 时间:
2018-07-24 23:51:48
阅读次数:
383
folly/Format.h folly/Format.h provides a fast, powerful, type-safe, flexible facility for formatting text, using a specification language similar to P ...
分类:
其他好文 时间:
2018-07-24 14:00:53
阅读次数:
199
folly/ThreadLocal.h Improved thread local storage for non-trivial types. ~4x faster than boost::thread_specific_ptr. Similar speed as using pthread_ge ...
分类:
其他好文 时间:
2018-07-24 14:00:35
阅读次数:
201
folly/dynamic.h folly/dynamic.h provides a runtime dynamically typed value for C++, similar to the way languages with runtime type systems work (e.g. ...
分类:
其他好文 时间:
2018-07-24 13:57:25
阅读次数:
263
题目不难,被第二题卡了半个多小时QAQ,另一个就是以后能用Hashmap和Hashset的绝不遍历。 1. Leaf-Similar Trees dfs、层次遍历把叶子节点遍历然后对比即可,只要是先遍历左节点后遍历右节点就行。 874. Walking Robot Simulation 被这题卡了好 ...
分类:
其他好文 时间:
2018-07-22 21:16:38
阅读次数:
572
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1250 Hat's Fibonacci Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
分类:
其他好文 时间:
2018-07-17 23:23:13
阅读次数:
212