hdu4649Professor Tian】的更多相关文章

http://acm.hdu.edu.cn/showproblem.php?pid=4649 枚举当前状态是0或者是1的概率 其实就枚举1的概率 最后概率乘这个数 位运算用得不熟  老出错 #include <iostream> #include<cstdio> #include<cstring> #include<stdlib.h> #include<algorithm> using namespace std; ]; ]; ],dp[]; i…
Tian Ji -- The Horse Racing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18291    Accepted Submission(s): 5327 Problem Description Here is a famous story in Chinese history. "That was about 2…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1052 Problem Description Here is a famous story in Chinese history. "That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and…
题意: 田忌和齐王各有n匹马,如果马的速度比齐王的快就赢200,慢则输200,相等不赔不赚. 已知两人每匹马的速度(为整数)和齐王所排出的马的顺序,问田忌该如何应对才能使收益最大. 分析: 本以为是一道很简单的贪心,上来就贪,结果什么都没贪出来. 看了题解才发现贪心是比较复杂的. 这里贴上poj某牛的神分析. 贪心策略: 1,如果田忌的最快马快于齐王的最快马,则两者比. (因为若是田忌的别的马很可能就赢不了了,所以两者比) 2,如果田忌的最快马慢于齐王的最快马,则用田忌的最慢马和齐王的最快马比.…
Here is a famous story in Chinese history. That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others. Both of Tian and the king have three horses in different classes,…
Tian Ji -- The Horse Racing Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 19   Accepted Submission(s) : 5 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description Here is a…
Tian Ji -- The Horse Racing Here is a famous story in Chinese history. That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others. Both of Tian and the king have three…
Professor Tian Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 376    Accepted Submission(s): 199 Problem Description Timer took the Probability and Mathematical Statistics course in the 2012,…
思路:先按从小到大排序, 然后从最快的開始比(如果i, j 是最慢的一端, flag1, flag2是最快的一端 ),田的最快的大于king的 则比較,如果等于然后推断,有三种情况: 一:大于则比較,二等于在推断田的最慢的是不是比king的最快的慢,三小于则与king的最快的比較: Tian Ji -- The Horse Racing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe…
Tian Ji -- The Horse Racin Problem Description Here is a famous story in Chinese history. "That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others." "Both…