题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4927解题报告:对于n,结果如下:C(0,n-1) *A[n] - C(1,n-1) * A[n-1] + C(2,n-1) * A[n-2] - C(3,n-1) * A[n-3] ....... C(...
分类:
其他好文 时间:
2014-08-07 22:42:15
阅读次数:
289
http://acm.hdu.edu.cn/showproblem.php?pid=4927同学用java写的大整数相减Series 1Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others) ...
分类:
其他好文 时间:
2014-08-07 21:55:00
阅读次数:
216
Problem Description
Let A be an integral series {A1, A2, . . . , An}.
The zero-order series of A is A itself.
The first-order series of A is {B1, B2, . . . , Bn-1},where Bi = Ai+1 - Ai.
The ...
分类:
其他好文 时间:
2014-08-07 18:59:40
阅读次数:
248
题目链接:hdu 4927 Series 1
题目大意:给定一个长度为n的序列a,每次生成一个新的序列,长度为n-1,新序列b中bi=ai+1?ai,直到序列长度为1.输出最后的数。
解题思路:n最多才3000,ai最大也才1000,貌似不会超int,但是要注意,有些数不止被计算了一次,最多的数被计算了C(15003000),所以肯定要用高精度处理,那么用o(n2)的复杂度肯定就跪了。...
分类:
其他好文 时间:
2014-08-07 18:57:40
阅读次数:
237
LCS!~如果你在百度上搜这个的话会出来”英雄联盟冠军联赛”,orz。。但是今天要讲的LCS是最长公共子序列 ,"Longest Common Subsequence "not"League of Legends Championship Series"小盆友们又要涨姿势了~ 最长公共子序列也称作最...
分类:
其他好文 时间:
2014-08-07 18:46:50
阅读次数:
271
链接:http://poj.org/problem?id=3233
题意:给一个N*N的矩阵(N,求S = A + A^2 + A^3 +
… + A^k(k
思路:很明显直接用矩阵快速幂暴力求和的方法复杂度O(klogk),肯定会超时,我采用的是二分的方法, A + A^2 + A^3 +
… + A^k=(1+A^(k/2)) *(A + A^2 + A^3 +
… + A^(...
分类:
其他好文 时间:
2014-08-07 13:25:40
阅读次数:
266
Welcome back to what’s going to be the last “official” part of this series – I’ll do more GPU-related posts in the future, but this series is long eno...
分类:
其他好文 时间:
2014-08-05 02:56:18
阅读次数:
427
# -*- coding: utf-8 -*-import pandas as pdimport numpy as npimport matplotlib.pyplot as pltimport jsons = pd.Series([1,3,5,np.nan,6,8]);print(s);s = p...
分类:
其他好文 时间:
2014-08-01 15:53:01
阅读次数:
202
题目链接:http://poj.org/problem?id=3233解题报告:输入一个边长为n的矩阵A,然后输入一个k,要你求A + A^2 + A^3 + A^4 + A^5.......A^k,然后结果的每个元素A[i][j] % m。(n 2 #include 3 #include ...
分类:
其他好文 时间:
2014-07-31 20:43:37
阅读次数:
229