推一下公式.就会发现是这个.. 由于设结果有x种方案.则每一个数字出现的概率都均等,然后和就是x*m 每种方案的概率是1/x 每一个数出现的概率都是1/n 所以每一个方案的和就是 sum/n *m #include <cstring> #include <cstdio> #include <algorithm> using namespace std; typedef long long ll; const int N = 1005; int main() { int…
Crossing Rivers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 738 Accepted Submission(s): 387 Problem Description You live in a village but work in another village. You decided to follow t…
Calendar Game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1871 Accepted Submission(s): 1065 Problem Description Adam and Eve enter this year’s ACM International Collegiate Programming Con…
Abandoned country 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5723 Description An abandoned country has n(n≤100000) villages which are numbered from 1 to n. Since abandoned for a long time, the roads need to be re-built. There are m(m≤1000000) ro…