poj-2287---Tian Ji -- The Horse Racing】的更多相关文章

题意:田忌和齐王有n匹马,进行n局比赛,每局比赛输者给胜者200,问田忌最多能得多少钱. 分析:如果田忌最下等的马比齐王最下等的马好,是没必要拿最下等的马和齐王最好的马比的.(最上等马同理) 因此,如果田忌最下等的马>齐王最下等的马或者田忌最上等的马>齐王最上等的马,直接得200,如果不满足该条件,那么才让田忌最下等的马与齐王最上等的马来比. #pragma comment(linker, "/STACK:102400000, 102400000") #include<…
/* * POJ_2287.cpp * * Created on: 2013年10月9日 * Author: Administrator */ #include <iostream> #include <cstdio> #include <algorithm> #include <cmath> using namespace std; int main() { int n; int a[1010]; int b[1010]; while (scanf(&qu…
Tian Ji -- The Horse Racing 田忌赛马,还是English,要不是看题目,我都被原题整懵了,直接上Chinese吧 Descriptions: 田忌和齐王赛马,他们各有n匹马,依次派出一匹马比赛,赢了加200,输了减200,平局不加钱,问如何安排马的出场顺序,使得田忌赢的钱最多 Input 输入最多包含 50 组测试数据.对于每组测试数据,第一行包括一个正整数 n (n ≤ 1000),表示每一方的马的数目.第二行中的 n 个整数,表示田忌的马的速度.第三行中的 n 个…
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…
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…
思路:先按从小到大排序, 然后从最快的開始比(如果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…
转载请注明出处:http://blog.csdn.net/u012860063 题目链接:pid=1052">http://acm.hdu.edu.cn/showproblem.php?pid=1052 Tian Ji -- The Horse Racing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17346    Acc…
http://acm.hdu.edu.cn/showproblem.php? pid=1052 Tian Ji -- The Horse Racing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 18058    Accepted Submission(s): 5239 Problem Description Here is a f…
Tian Ji -- The Horse Racing Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) 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 cou…