- 博客(7)
- 资源 (3)
- 收藏
- 关注
原创 uva10247 - Complete Tree Labeling
Problem BComplete Tree Labeling! Input: standard inputOutput: standard outputTime Limit: 45 secondsMemory Limit: 32 MB A complete k-ary tree is a k-ary tree in which all leaves have same
2013-12-22 17:06:03 515
原创 矩阵快速幂
之前只做了快速幂取模,这次是矩阵。 就因为线代没怎么学,今天还花了一些时间去想为什么矩阵A^k+A^l=A^(k+l),是因为A^n=A^(n-1)*A=A^(n-2)*A*A=.....由于矩阵相乘满足结合律(可以以三个为例证明一下),所以可以任意取位置先后结合,所以有A^k+A^l=A^(k+l)。 两个矩阵相乘,复杂度是O(N^3),再乘M次,所以一个矩阵的M次方时间复杂度是O(
2013-12-17 22:53:05 663
原创 uva11176 - Winning Streak 数学期望 DP
Problem BWinning StreakInput: Standard InputOutput: Standard Output "You can run onfor a long time,sooner or later God'll cut you down."– Traditional folksong Mikael likes to gamble,a
2013-12-17 19:52:13 596
原创 uva10900 - So you want to be a 2n-aire? 概率 递推
Problem A: So you want to be a 2n-aire?The player starts with a prize of $1, and is asked a sequence of n questions. For each question, he mayquit and keep his prize. answer the question. If wro
2013-12-12 11:54:56 580
原创 upc1976 树状数组和线段树两种做法
1976: problem FTime Limit: 3 Sec Memory Limit: 64 MBSubmit: 78 Solved: 17[Submit][Status][Web Board]Description在一个小镇上住着n位武林高手,他们互相之间经常PK,不过PK的时候必须要有一位裁判在场。这个小镇上的房子从1—n依次排列(一条直线上),两个人要单
2013-12-03 22:58:30 512
原创 uva557 - Burger 概率递推
Burger When Mr. and Mrs. Clinton's twin sons Ben and Bill had their tenth birthday, the party was held at the McDonald's restaurant at South Broadway 202, New York. There were 20 kids at
2013-12-03 22:26:01 847
原创 uva11181 - Probability|Given 条件概率
Problem GProbability|GivenInput: Standard InputOutput: Standard Output N friends go to the local super market together. The probability of their buying something from the market is respecti
2013-12-03 10:03:37 791
表情多v0.2
2015-06-20
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人