发布时间: 2016年12月3日 16:34 最后更新: 2016年12月3日 16:34 时间限制: 1000ms 内存限制: 65536M
The first line of input contains an integer N which is the number of data sets that follow (1 <= N <= 100). Each data set consists of three lines. The first line of each dataset specifies your two hole cards. The second line is your opponent’s hole cards. The third line is the four community cards. A card is specified by two characters: it’s rank (A,2,3,4,5,6,7,8,9,T,J,Q,K) and it’s suit (S,D,H,C) for Spades, Diamonds, Hearts, and Clubs respectively. For example, the Ace of Hearts would be AH, the Nine of Spades would be 9S. Within a line, there are no spaces or invalid characters. All input will be valid.
For each data set, your program will output (on a new line) the data set number followed by a colon, followed by a space, and a list of card(s) that will maximize the amount of money you could get playing the hand. If no card will allow you to win or tie, just display “LOSER” instead of the cards. Each card should be separated by a single space. Your program will display up to 15 cards on each output line. If more than one output line is required for a dataset, additional lines should be indented by exactly 3 spaces. Cards should be output in suit order (S,D,H,C) and rank order within each suit (Ace high).
3 JD3S KH5S KDAC2DQD 2S3S 2C3C 4D5DJHAH 4S7D KHKD AHADKSKC
1: TS 3D 4D 5D 6D 7D 8D 9D TD AD TH TC 2: 4S 5S 6S 7S 8S 9S TS JS QS KS AS 2D 3D 6D 7D 8D 9D TD JD QD KD AD 2H 3H 4H 5H 6H 7H 8H 9H TH QH KH 4C 5C 6C 7C 8C 9C TC JC QC KC AC 3: LOSER