链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4108 题意:求第l个斐波那契数到第r个斐波那契数的和,判断这个和奇偶性,若为奇输出1,偶输出0 题解:很明显要利用前缀和,通过打表可以发现斐波那契前缀和的奇偶性为 奇 ...
分类:
其他好文 时间:
2019-05-04 12:15:06
阅读次数:
156
正解:矩阵快速幂 解题报告: 我永远喜欢loj! 一看到这个就应该能想到矩阵快速幂? 然后就考虑转移式,发现好像直接想不好想,,,主要的问题在于这个*$i$,就很不好搞$QAQ$ 其实不难想到,$\sum_{i=1}^{n}a_i\cdot(n-i)$这样一个式子是可以在矩阵快速幂中推出来的(类似这 ...
分类:
其他好文 时间:
2019-05-03 16:09:29
阅读次数:
117
#include int sockfd_to_family(int); int mcast_get_if(int sockfd) { switch (sockfd_to_family(sockfd)) { case AF_INET: { /* TODO: similar to mcast_set_i... ...
分类:
其他好文 时间:
2019-05-03 14:47:33
阅读次数:
136
A sequence X_1, X_2, ..., X_n is fibonacci-like if: n >= 3 X_i + X_{i+1} = X_{i+2} for all i + 2 <= n Given a strictly increasing array A of positive ...
分类:
其他好文 时间:
2019-05-03 09:23:55
阅读次数:
97
The i’th Fibonacci number f(i) is recursively de?ned in the following way: ? f(0) = 0 and f(1) = 1 ? f(i + 2) = f(i + 1) + f(i) for every i ≥ 0 Your t ...
分类:
其他好文 时间:
2019-04-28 20:25:06
阅读次数:
113
"传送门" 一道良心的练习FWT和子集卷积的板子…… 具体来说就是先把所有满足$s_a \& s_b = 0$的$s_a \mid s_b$的值用子集卷积算出来,将所有$s_a \oplus s_b$用xor卷积算出来,把斐波那契数代进去,然后将三个数组and卷积,最后取$2^i (i \in Z) ...
分类:
其他好文 时间:
2019-04-27 17:02:21
阅读次数:
260
研究:长期不吃早餐,患心脏病风险增加87% Skipping breakfast could raise risk of heart disease by 87% 研究:长期不吃早餐,患心脏病风险增加87% Skipping breakfast could raise risk of heart d ...
分类:
其他好文 时间:
2019-04-26 13:29:02
阅读次数:
129
Consider all the leaves of a binary tree. From?left to right order, the values of those?leaves form a leaf value sequence. For example, in the given t ...
分类:
其他好文 时间:
2019-04-26 00:43:52
阅读次数:
177
Processes in the foreground job of a controlling terminal have unrestricted access to that terminal; background proesses do not. This section describe ...
分类:
系统相关 时间:
2019-04-25 18:59:58
阅读次数:
248
Mat is some kind of smart pointer for the pixels Mat a=b will have shared pixels for a and b. similar situation for push_back() if you need a 'deep co ...
分类:
其他好文 时间:
2019-04-25 15:55:49
阅读次数:
275