Description
Problem D: Airport Express
In a small city called Iokh, a train service, Airport-Express, takes residents to the airport more quickly than other transports. There are...
分类:
其他好文 时间:
2014-07-22 22:49:34
阅读次数:
262
ubuntu10.0.4使用再生龙还原后在启动时不能正常启动,出现上图界面,在网上搜了很多解决方案,如修改rootdelay,修改启动项,重复恢复,使用live usb盘等等,最后发现是硬盘数据线坏了,nnd,数据线坏了也不能报这...
分类:
其他好文 时间:
2014-07-22 08:31:35
阅读次数:
186
在1.4.0之前(不包含1.4.0)无法使用多个绑定的,单个示例为:$('.clickme').live('click', function() { // Live handler called.});1.4.0-1.4.2开始支持了,实例如下:$('.hoverme').live('mouseo....
分类:
Web程序 时间:
2014-07-21 10:19:10
阅读次数:
252
dp题目,dp[i][j]=1表示前i个数字形成的表达式的值除以K之后可以余j#include #include using namespace std;int dp[10001][101];int a[10001];int main(){ int m,n,k,u; while(cin>>m){ w...
分类:
其他好文 时间:
2014-07-21 09:39:06
阅读次数:
154
UVA 10870 - Recurrences
题目链接
题意:f(n) = a1 f(n - 1) + a2 f(n - 2) + a3 f(n - 3) + ... + ad f(n - d), for n > d.
已知前d项求第n项
思路:矩阵快速幂,对应矩阵为
|a1 a2 a3 ... ad|
|1 0 0 ... 0 0 0|
|0 1 0 ... 0 0 ...
分类:
其他好文 时间:
2014-07-21 09:30:29
阅读次数:
211
Description
Problem C: A Walk Through the Forest
Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to ...
分类:
其他好文 时间:
2014-07-21 09:27:14
阅读次数:
300
UVA 10655 - Contemplation! Algebra
题目链接
题意:给定p, q, n代表p=a+b,q=ab求an+bn
思路:矩阵快速幂,公式变换一下得到(an+bn)(a+b)=an+1+bn+1+ab(an?1+bn?1),移项一下得到an+1+bn+1=(an+bn)p?q(an?1+bn?1)
这样就可以用矩阵快速幂求解了
代码:
...
分类:
其他好文 时间:
2014-07-20 23:36:03
阅读次数:
300
UVA 11149 - Power of Matrix
题目链接
题意:给定一个n*n的矩阵A和k,求∑kiAi
思路:利用倍增去搞,∑kiAi=(1+Ak/2)∑k/2iAi,不断二分即可
代码:
#include
#include
const int N = 45;
int n, k;
struct mat {
int v[N][N];
mat() ...
分类:
其他好文 时间:
2014-07-20 23:07:20
阅读次数:
274
Description
The army of United Nations launched a new wave of air strikes on terroristforces. The objective of the mission is to reduce enemy's logistical mobility. Each airstrike will destroy a pa...
分类:
其他好文 时间:
2014-07-20 23:04:26
阅读次数:
332
Square City is a very easy place for people to walk around. The two-way streets run North-South or East-West dividing the city into regular blocks. Most street int...
分类:
其他好文 时间:
2014-07-20 22:33:53
阅读次数:
295