- 博客(5)
- 收藏
- 关注
原创 线段树(堆式)[单点更新, 区间查询]
http://acm.hdu.edu.cn/showproblem.php?pid=1166first blood of seg-tree 单点增减 区间求和#include #include #include using namespace std;const int maxn=60000+123;int T[maxn*2];int M;int bit(int
2012-03-25 18:59:53 760
原创 一些有用的索引
总是会忘记的一些东西, 找起来还怪费劲的,于是存到这里, OK。============ Matrix67's blog ============http://www.matrix67.com/blog/archives/276 十个利用矩阵乘法解决的经典题目 http://www.matrix67.com/blog/archives/813 用位运算生成下一个含有k
2012-03-24 20:02:44 452
原创 HDU 4089 Activation(概率DP)
#include #include #include #include using namespace std;const int maxn=2000+3;const double eps=10e-9;double p[5];double dp[maxn][maxn];double ps[maxn];double c[maxn];int main (){ in
2012-03-24 16:16:48 552
原创 ZOJ10th 纪念赛B Back to the Past(期望DP)
E(i,j)表示从i,j到满足条件的期望///p(i,j)=c(i,j)*p^j*q^(i-j); /// =c(i-1, j-1)*p^(j-1)*q^(i-j)*p+c(i-1, j)*p^j*q^(i-j-1)*q;#include #include #include #include #include #includ
2012-03-15 20:50:19 1078
原创 N皇后
第一次写。。以前刚学搜索都没写过, 这次刷USACO直接位运算, 没想到代码可以这么短。。。算6到13还是没问题的#include #include #include #include #include #include using namespace std;int n;int ans;int a[100];void dfs(int row, int ld,
2012-03-08 20:30:35 419
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人