![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
思考题
JalexDooo
努力中...
展开
-
HDU 4586 Play the Dice 简单思考
题意:给你N个骰子,1-n上标有各自的数,然后掷骰子一次,得到朝上数字数量的钱;再给你m,然后m个数表示,当该数朝上时,你可以得到这么多钱,并且可以继续掷骰子。问你你能得到的钱的期望。思路:若骰子上面的数字和为sum,则掷第一次:sum/n第二次:sum/n*(m/n)第三次:sum/n*(m/n)*(m/n).........第k次:sum/n*(m/n)^k答案为当原创 2016-07-27 19:17:02 · 394 阅读 · 0 评论 -
CodeForces 518B Tanya and Postcard 计数
先来错误代码, Wrong answer test 8:#include #include #include #include #include using namespace std;const int maxn = 200000 + 24;char s[maxn], t[maxn], ans[maxn];map mp;int main() { scanf("%s%s",原创 2016-07-07 09:46:34 · 401 阅读 · 0 评论 -
UVa 1330 LA 3029
蓝书第一章的题目,神奇的解法:详细见P50,City Game LA3029, UVa 1330#include <iostream>#include <cstdio>#include <cstring>#include <string>#include <algorithm>#include <cmath>using namespace std;typedef long long L原创 2016-08-09 11:44:20 · 341 阅读 · 0 评论