摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1099 最最简单的概率dp,完全是等概率转移。 设dp[i]为已有i张票,还需要抽几次才能集齐的期望。 那么dp[n]=0,因为我们已经集齐了。 $$dp[i]=(\frac{i}{n} dp[i]+\frac{n 阅读全文
posted @ 2019-04-19 23:44
韵意
阅读(196)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1019 LCM即各数各质因数的最大值,搞个map乱弄一下就可以了。 cpp include using namespace std; typedef long long ll; typedef unsigned i 阅读全文
posted @ 2019-04-19 23:05
韵意
阅读(147)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1071 解一个给定三个点的坐标二次函数某区域的积分值。 设出方程之后高斯消元得到二次函数。然后再消元得到直线。 两次积分然后相减就可以了。 把自适应辛普森改成了传入函数指针的形式,有点多此一举。 可以这样做的原因, 阅读全文
posted @ 2019-04-19 22:31
韵意
阅读(168)
评论(0)
推荐(0)
摘要:
2108 阅读全文
posted @ 2019-04-19 17:07
韵意
阅读(309)
评论(0)
推荐(0)
摘要:
一位数中缀表达式转后缀表达式并求后缀表达式值 cpp include using namespace std; typedef long long ll; //比较lhs的优先级是否不高于rhs,rhs表示栈顶的符号 bool priority(const char &lhs, const char 阅读全文
posted @ 2019-04-19 15:07
韵意
阅读(139)
评论(0)
推荐(0)
摘要:
```cpp #include using namespace std; typedef long long ll; struct Point; typedef Point Vector; struct Point { ll x,y; Point(){} Point(ll _x,ll _y):x(_x),y(_y){} ll how_many_points(Po... 阅读全文
posted @ 2019-04-19 12:09
韵意
阅读(126)
评论(0)
推荐(0)
摘要:
原来两道题的本质是一样的。 阅读全文
posted @ 2019-04-19 11:30
韵意
阅读(113)
评论(0)
推荐(0)

浙公网安备 33010602011771号