题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4652 题意: 给你一个有m个面的骰子。 两种询问: (1)"0 m n": “最后n次点数均相同”的投掷次数期望。 (2)"1 m n": “最后n次点数各不相同”的投掷次数期望。 题解: 表示状态: ...
分类:
其他好文 时间:
2017-09-24 02:47:26
阅读次数:
230
From:http://moodycamel.com/blog/2014/a-fast-general-purpose-lock-free-queue-for-c++ So I've been bitten by the lock-free bug! After finishing my singl ...
分类:
编程语言 时间:
2017-09-15 12:16:58
阅读次数:
254
No1. Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would ha ...
分类:
其他好文 时间:
2017-09-03 09:58:50
阅读次数:
252
环境:mac 使用brew 安装elasticsearch 1.在 /usr/local/etc/elasticsearch/elasticsearch.yml 文件中配置快照地址 path.repo: ["/data/backups/my_backup"] 2.重启elasticsearch 3. ...
分类:
其他好文 时间:
2017-08-31 18:03:16
阅读次数:
343
You are given a sequence a1,?a2,?...,?an consisting of different integers. It is required to split this sequence into the maximum number of subsequenc ...
分类:
编程语言 时间:
2017-08-25 21:01:04
阅读次数:
780
Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 14378 Accepted: 5062 Case Time Limit: 1000MS Description Farmer John's cow ...
分类:
其他好文 时间:
2017-08-22 10:41:09
阅读次数:
182
n common cubic dice are thrown. What is the probability that the sum of all thrown dice is at least x? Input Input starts with an integer T (≤ 200), d ...
BFS 1. matrix 邻居都是找好的, 但是此题是八邻居问题 2. visited 数组是防止邻居重叠遍历的问题和重复加入的问题, 而此题需要遍历所有的邻居 但是此题再往队列加的时候判断是否为'E', 并且将其转化为'B' 3. and all of its adjacent unreveal ...
分类:
其他好文 时间:
2017-08-05 11:02:26
阅读次数:
135
题目链接:hdu 5995 Guessing the Dice Roll 题意: 有一个6面的骰子,有n(n≤10)个人每个人猜了一个长度为l(l≤10)的序列,不停的掷骰子直到满足一个人的序列则那个人获胜,求每个人获胜的概率。 题解: 将他们猜的串插入AC自动机,然后转移k次,这里k要足够大才能收 ...
分类:
其他好文 时间:
2017-07-29 16:36:56
阅读次数:
352
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another ...
分类:
其他好文 时间:
2017-07-25 22:41:36
阅读次数:
276