ACM测试题后台测试数据代码参考.doc_第1页
ACM测试题后台测试数据代码参考.doc_第2页
ACM测试题后台测试数据代码参考.doc_第3页
ACM测试题后台测试数据代码参考.doc_第4页
ACM测试题后台测试数据代码参考.doc_第5页
已阅读5页,还剩32页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Three CardsTime limit:1sec.Submitted:29Memory limit:64MAccepted:11Source: Debug cool DescriptionLaoPei and A q are good friends with Debugcool and they like playing cards.There is a way to play cards called Three cards, it is to say, all of the players will get three cards and only one will be the winner.As everyone knows, each card has one of four suits and one of thirteen values: suits:clubs( C ),diamonds( D ),hearts( H )and spades( S ). They have no order. values:2 3 4 9 T( 10 ) J Q K TongHuaShun JinHua ShunZi DuiZi Other, if the players cards have the same type, the values will be taken into count:on one hand, if the same type is DuiZi, the value of the two cards who have the same value will be compared firstly, if they have the same value, the other cards value will be compared. On the other hand, if the type is not DuiZi, from the biggest to the smallest will be compared successively, eg. QC 10C 9C KC 4C 3C. If all value of the three cards of the players are the same, they tied. eg. QC 10C 9C = QH 10H 9H.InputThe input contains several test cases, each test case will have only one line to represent the cards in LaoPeis hand and A qs hand, every line will have six cards, three for LaoPei and three for A q. Each card will consist of two parts:the values and the suits. For example:AS mean spades with value A. The cards will be separated by a space. OutputFor each test case, output a line containing the result of the game. If LaoPeis cards is bigger than A qs, output LaoPei wins!, if A qs cards is bigger than LaoPeis, output A q wins!, if they tied, output Oh my god, who wins, Debugcool knows!Sample InputAC AD AH KC KD KHTD QD JD QC KC JC2D 2C 5S 2S 2H 5CSample OutputLaoPei wins!A q wins!Oh my god, who wins, Debugcool knows!Teamwork Brings Profits!Time limit:1sec.Submitted:84Memory limit:64MAccepted:14Source: Williammed Williammeds father is running a small company now, which has N employees.(2=N=10 and N is an even number). The employees are numbered from 1 to N. All the employees are divided into N/2 groups. One employee can only be in one group, and each group works on one project. As we all know, teamwork is very important to a company, so different team can make different profits. And now, given any two people i and j, Williammeds father can tell how much profit(Pij) can they make if they work together. Here comes the problem, given all the Pij(1 = i = N,1 = j = N,0 Pij= 100), you should tell the most profits this company can make. This is an easy problem, isnt it?InputThe first line of the input is N(2=N=10 and N is an even number),the number of employees in the company.Then therere N lines,each line has N numbers.The jth number in the ith line is Pij,as we discribe above.And we guarantee Pij = Pji,Pii = 0.The end-of-file is denoted by a single line containing the integer 0.OutputFor each case,output the most profits this company can make.Sample Input40 6 62 136 0 35 9462 35 0 513 94 5 00Sample Output156Catch The DuplicateTime limit:2sec.Submitted:9Memory limit:64MAccepted:2Source: windstonedream Assigning a program is a hard progress. And everyone has its own way to solve it. There may be a perfect way to do so, also will be complex ways.Now its for you to assign two absolutely different way to solve a question.Input Each case will start with two integers. N, stand for the number of the procedure. M, stand for the number of relations.(N = 100, M=10000)Then M lines, each line two integers A,B,C( 0 = A, B N , C 1000 ). We can tun Procedure A to Procedure B by the cost of C. Procedure 0 will always be the start. Procedure N-1 will always be the target.Output If there is no such a way to solve it just print a Unsolved. Else if there is such ways, print the shortest one(In one line seperated by a space). Then, if there is an absolutely different way(no procedure will be the same) from the first(except the start and target point), print the shortest one. Else print Useless.Sample Input 4 50 1 21 3 30 3 40 2 22 3 1Sample Output 0 2 30 3Volunteers of HITTime limit:10sec.Submitted:0Memory limit:64MAccepted:0Source: ACMGroup The 3rd Heilongjiang Province Programming Contest hosted by HIT is coming. We have attracted an unprecedented number of participants, and consequently we need a fair number of volunteers to ensure that the contest runs smoothly and uneventfully. The work that volunteers are supposed to do is helping the contestants with some straightforward yet important stuff, such as fetching the printed code one after another or placing a beautiful balloon if a team solves a problem successfully. Different volunteers may have different capabilities in terms of the ranges they are able to take care of. We now have a set of candidate volunteers. However, it is not clear to the contest host that, according to the contest venue size, at least how many volunteers we need to have, such that every team is guaranteed to be taken care of by at least one volunteer. For example, assume that the contest venue is a 4*5 rectangle of cells, and each cell has a team. We have five candidate volunteers, one of range 3 and the other four of range 2. Then well need at least four volunteers to cover all teams as shown below:Should you solve this problem, you will be highly appreciated spiritually by the contest host, although no physical award will be issued.InputThere are multiple test cases (no more than 10). Each case begins with three integers m, n, k (0 m, n 5, 0 k 3). m and n are the number of rows and columns of contestant teams in the contest venue respectively; k donates number of distinct capabilities (ranges) of the volunteers. Each of the following k lines consists of two integers c and t ( 0 c m*n, 0 t m*n) showing the capability and number of volunteers with this capability, respectively. OutputFor each test case, print the minimum number of the volunteers we need in one line. If there are not enough volunteers, print impossible.Sample Input4 5 22 63 13 3 12 1Sample Output4impossible第一题测试数据:InputAC AD AH KC KD KHTD QD JD QC KC JC2D 2C 5S 2S 2H 5C7H AS 7D 8C JS 6C4C 8D 6S 2D TH 7SAH 4H 7H KC 5D 6DTH 6D 7C AS QC 2CTC 7S 6S AH KH QDQS KH 8H 4H 7H 5D3C 6D QD 3H JC TSTH 3C KH 4C 6H KS4D 2S KS TD TH 4C2H KH 9C 5S AD JD3H TC 9D JS AC 2H3S 4H QC 7S QD 2SQD KH JC 9S TD 2HQD AS AC 5H 3C 6DKH 9D QH 2C 8S 5D4S 5C 9S 6H 3S JHKH AD TH 4C 2S 9D7C 2H TD AC KD 8SQD 4D JH 6D 6C 9DTD 4C 3S 7C KC 8S5C TD 9D 4D KS JH3H 7D AS QS KD 4CAD QC 9H 2C 6H 7DQH 8H 8S 4C KH 2D6D 4H QH 7S JH 8C8H QS 5H AD 6D 4HTC 8D 4S 7S 5D JCAC JD KC 9D 3S 5HQH AC 3H JH 3D 5C9S 7H QH 6C 6D AH5H KD JC 6C 9C 7S5H 3D TS 7H 6H 4HAS 2C TC AH 8C 8D5D 5C 3C AH TS 4S4C 9C 4S 2S 9D AD6H 8S KC 4C 2C 5C3S 4H 6C 8C JC AD5C 3D KD JS 2H 4DJD QD 9C 3S 4H KC9D 5S 3S 7C TH 2H5S 6S JD QH 3H TSTH QD AH 7D 9C JD6S AH AD 3H QS TD6D 6C 2H 5C 8S 9C9H QD 5D JH JC QSAD 7D 9D KC 5D 5S8D AC 8H JD 2S QC8D 7S 7C AC 2H 4HTS 2S 7S AS 3S 9CJH 3D AC 9C JS 6HAS AC 9C 6C JH 3H6D 3C 7C 6H 9S TSJS 3S 8S 6D 4S QC7D QS 4H QC 8S 9SAS 6H 3H AD 7C 9S6H 6S JH JD QD 9C9S KH 4D JC 6C 5H6D TD TC 7D 5C 9D6H 3C 5H 9S 6D 2S9H TH AD 7C 5H 3H6C 7C 8D 4C KH 2S7C TC 5D 6D 8C 9C9S JD 6S 4S AS 3DQC 5D TH 7H 3H 4D9D 5D 8C JC KS 2S2C 4H 6H 7H TS 5D8S 4H KC 7C 6D JC8H 9S 4C 2C 3D 6SQS 8D 6D KH 9D 8C4D 6C 5C AC 4H 3S6C 3H 4H 7C 9S 3D5D KH 7S JC QH AD4C 7D 3D 5C JH 9HJC 3C QS AS 9H 7H5C 2D 5H 4C KD KS5H 5C KS JC 3S 2S4D QD QS QH 5D TD4C KS 9S 7C 3H 6HKD 8S TS 5S 4C 2HTC 7H 6C 6D 7S QD8H 5C 9H 6C TC 3DAD AC JS AH KC 4D2D 2H JH 6C 4S 9S6D TD JD 7H 5D 3H8H 4C 2D KC 8S TH3H 5S JC AC 6S 6D7S QD TS TH 4H KCKS AC 9S QS 9H 6H5H 6H 4C 7C AC 8H4D 7H 5C JC 5S 9C5D TH AC KS 8S 9SKC JS 9D 7D 2D 3DKH AS 5D JD 9D 7C5H 8H 5D 6H AD 4S3S 6S 8S 6H KH JS8C JH KC 6H AH 2C2D JS TD 7D 3H KC9H 4S TS 9C 7C QC7C 8S KS 9C 4C KD7H 6C AC 8C 3D 9C2C 9S TD 6C 5H JSJH JC AS 4D 9H 6D5S 2H 9D 4D JC KS7D TD 9C 6H 8S 5D4C 8C 6C 5S 2H 9S2D 8H 4S 3C KD 5SQS AC 9C JC AD 4H9H 5S AD 5C 2H 6H8D 7S 2C KS AC QS5H 4S KD 6C JH AH2D 6C KS AC TD JC4S QH 6S 9D 6C JS3H QD KD 7D 8C 6S2H AD 5S QS TS 4H9S 5H 4H QC 2C 5D7S 8S 3S 3H 5D TSJC 3S 3H KH QD 8S7C 4C QH 4D 3S 5SJD QD AH 5D KS TH3D JD QC TD 7H 4CKC AS AD 9H JH 3H5D 4H 9C 3C JH KSAC 5H 8D 4D 6S 7H8D KD 8C 7S 4C 9S7S 9S 4S KD TD 9C4H 9H 6C JD TC QD7D 4C KH 6S AD QH5S AC 2D 9S 8D 4S2D AS 5H KS 7C TD4C 2C AC 3C 6H 7H9C 9H 6C QC QD 7HAD 2C 2S QH 9C 3C3C 3D 5C 4H 7H TH9C 7C 7H JH 9S QSAC JS KS 8D QH TCKH 5S TS 5C JH QHTD QH 9D JH 3H 4SJC 6C 2S 5H 4D KDAH KC 3S 9C 8S JCKS 6C AS AD 3D 9SQH 3S 7S 2H 6H JH2S 2H 3H JH TS 3D5D 2H QH TD 9C 6DAS 5D TH 8C JH 7CQS 2D AH 9S 5S 9CQS 9S QC QH JD AS5S 7D 7C 6C 9H JH3D QD 3H QS TS 6STD 9D JS 7S 9H QS7D 4H KD JS 9H TDKS 3D 3H 7D 7C 8S8H 2H 2D 5H KH 9H8H KS JS 5S 9H 6DAS 3S 7S QC 9S 8D2H 2S JC 4S TS 3S8S 5D 9H 2C 3H QDJD AS 7D QS 9H 3SAH KH 3H 7C 4S 5SJH AD TS 9D 3H 4D3C KS JD 8D 3H 2HTC QH 4S 2D 8H 9S2S AS 3C 5H JH 4S8D 6C 5C 7S QH 2HKH 5D QH 4D QC JSQD 4C JD 3H 4S 5C3C 2S QC 4H AD KS7D QD QH 8H 4D JHAD 5S KD QS 4S 3S8H TD QC JH 3D 9SQS KS 8C QD 4D 2C8H 9C 8S 5H 4D JDKH 2H 2S JS 5C 6D4D KD 7S 8C AC TD5S KS 7C QH 3C TS8S 3D TS AS 4H 9HAS 2D AH 2C TS 9S4H 8S 7S 5S AH 2H4D 9C JC JH AS QC4H AS QD KH JH 8HTD KC QC 5D 6S 7D7S 5C 8D 9H KS JSJH 7H 3C KH AH 2S2S 8S 9H 5D 3S 4CAH 3D QH 2H 9S 6H8C JS 2D 7S 5D QD4H 3S TC 7S 8S 6SJD AC KS 2C 9S QDAC 3H 2C 4D 7H 9D9C QD 2D TS 6C 4H8S QD 7H 4H AH TC5C JD AS 2C JH 9C5H 4C KC 9S AD JDJH QD KC 3D 5C TH7C JC 3H 6D KS 8S8D 2S AS 7H 9S AC7D 9H QH JC TC 2CQD 2S 2C AD JS TSOutputLaoPei wins!A q wins!Oh my god, who wins, Debugcool knows!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!A q wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!A q wins!A q wins!LaoPei wins!A q wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!A q wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!A q wins!A q wins!LaoPei wins!LaoPei wins!A q wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!A q wins!A q wins!A q wins!LaoPei wins!A q wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!A q wins!A q wins!A q wins!LaoPei wins!A q wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!A q wins!LaoPei wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!LaoPei wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!A q wins!A q wins!A q wins!A q wins!A q wins!LaoPei wins!A q wins!A q wins!LaoPei wins!LaoPei wins!LaoPei wins!A q wins!LaoPei wins!A q wins!LaoPei wins!A q wins!A q wins!A q wins!LaoPei wins!第二题测试数据:Input60 34 70 13 98 7134 0 36 34 8 3570 36 0 53 83 4613 34 53 0 87 5398 8 83 87 0 7171 35 46 53 71 060 46 70 58 13 1746 0 73 85 62 6470 73 0 26 67 158 85 26 0 67 8113 62 67 67 0 1217 64 1 81 12 040 6 62 136 0 35 9462 35 0 513 94 5 040 33 41 5433 0 1 3841 1 0 3254 38 32 0100 21 67 59 24 57 55 40 58 5521 0 53 56 55 21 47 94 25 2367 53 0 4 61 37 74 45 85 659 56 4 0 56 86 52 70 29 124 55 61 56 0 7 3 78 91 7457 21 37 86 7 0 30 62 69 4855 47 74 52 3 30 0 56 59 2640 94 45 70 78 62 56 0 36 3858 25 85 29 91 69 59 36 0 1455 23 6 1 74 48 26 38 14 020 6363 060 77 80 31 88 1677 0 30 99 99 6680 30 0 24 24 9031 99 24 0 17 5388 99 24 17 0 5116 66 90 53 51 060 68 81 93 39 7268 0 48 87 83 581 48 0 88 14 7993 87 88 0 59 7939 83 14 59 0 5772 5 79 79 57 080 88 43 52 94 52 40 4188 0 93 54 3 13 69 7243 93 0 28 90 72 27 9152 54 28 0 54 28 16 9894 3 90 54 0 58 30 1052 13 72 28 58 0 43 6440 69 27 16 30 43 0 7341 72 91 98 10 64 73 0100 31 10 24 16 14 100 96 93 7331 0 39 64 77 11 47 77 31 4110 39 0 98 88 33 36 66 1 8024 64 98 0 81 13 98 37 63 3516 77 88 81 0 73 86 90 76 5514 11 33 13 73 0 28 71 14 21100 47 36 98 86 28 0 39 15 7396 77 66 37 90 71 39 0 63 7093 31 1 63 76 14 15 63 0 6973 41 80 35 55 21 73 70 69 060 46 25 92 8 3446 0 48 64 73 1325 48 0 86 31 6092 64 86 0 23 588 73 31 23 0 4734 13 60 58 47 080 54 65 27 27 87 40 6754 0 43 26 91 92 74 8765 43 0 45 95 16 34 7827 26 45 0 25 36 83 3927 91 95 25 0 59 22 8187 92 16 36 59 0 9 7440 74 34 83 22 9 0 5867 87 78 39 81 74 58 0100 29 69 35 17 18 66 93 3 7629 0 15 35 19 40 54 64 31 9569 15 0 7 56 82 15 4 85 1935 35 7 0 91 65 99 76 58 1317 19 56 91 0 52 9 43 28 4018 40 82 65 52 0 22 68 75 8566 54 15 99 9 22 0 49 9 6193 64 4 76 43 68 49 0 10 673 31 85 58 28 75 9 10 0 4276 95 19 13 40 85 61 67 42 0100 81 72 55 55 85 64 14 9 8181 0 61 26 30 22 95 68 68 4372 61 0 83 79 57 14 16 56 4255 26 83 0 70 21 85 83 23 9855 30 79 70 0 77 90 18 25 585 22 57 21 77 0 57 14 40 5464 95 14 85 90 57 0 32 30 614 68 16 83 18 14 32 0 87 989 68 56 23 25 40 30 87 0 1681 43 42 98 5 54 6 98 16 080 67 38 81 14 54 86 2167 0 3 60 67 69 16 6738 3 0 60 32 94 90 6781 60 60 0 19 11 6 9214 67 32 19 0 57 26 4054 69 94 11 57 0 49 6586 16 90 6 26 49 0 5721 67 67 92 40 65 57 080 13 41 16 16 45 38 4113 0 66 16 57 16 47 241 66 0 54 10 92 36 6716 16 54 0 60 88 37 8416 57 10 60 0 94 93 7645 16 92 88 94 0 64 9638 47 36 37 93 64 0 641 2 67 84 76 96 6 060 66 23 52 52 6066 0 61 65 20 823 61 0 81 26 752 65 81 0 58 752 20 26 58 0 8160 8 7 7 81 060 17 14 10 50 5717 0 95 4 91 9614 95 0 9 82 5210 4 9 0 20 5350 91 82 20 0 1157 96 52 53 11 060 4 24 89 89 74 0 58 97 79 3324 58 0 26 87 9289 97 26 0 95 1989 79 87 95 0 917 33 92 19 91 020 3737 0100 48 12 38 53 65 33 96 100 3348 0 2 17 83 47 37 1 15 5012 2 0 97 84 23 53 54 14 7138 17 97 0 15 29 9 57 60 853 83 84 15 0 80 50 15 97 8265 47 23 29 80 0 10 27 88 7233 37 53 9 50 10 0 53 51 6996 1 54 57 15 27 53 0 78 3100 15 14 60 97 88 51 78 0 6333 50 71 8 82 72 69 3 63 040 31 64 2831 0 53 6464 53 0 9528 64 95 020 5858 040 56 21 4856 0 44 7621 44 0 548 76 5 020 3232 020 2626 020 2828 080 10 58 72 25 51 29 6910 0 80 74 26 23 77 3058 80 0 23 23 71 82 8572 74 23 0 64 58 25 325 26 23 64 0 16 29 10051 23 71 58 16 0 61 3029 77 82 25 29 61 0 8169 30 85 3 100 30 81 080 52 22 64 59 64 92 8352 0 30 58 20 10 84 2322 30 0 93 99 40 17 4164 58 93 0 42 46 16 2959 20 99 42 0 33 64 9264 10 40 46 33 0 41 2092 84 17 16 64 41 0 1983 23 41 29 92 20 19 080 66 74 72 98 42 36 8166 0 10 48 65 91 96 10074 10 0 47 98 87 9 2172 48 47 0 23 2 29 8598 65 98 23 0 20 76 542 91 87 2 20 0 4 1236 96 9 29 76 4 0 3381 100 21 85 5 12 33 060 48 62 66 52 8148 0 36 16 41 2862 36 0 12 81 1166 16 12 0 19 8652 41 81 19 0 8481 28 11 86 84 020 6565 060 84 59 32 18 1384 0 77 4 19 7559 77 0 90 8 2832 4 90 0 20 3318 19 8 20 0 3413 75 28 33 34 040 14 51 3514 0 28 4051 28 0 7035 40 70 080 49 75 6 34 75 60 3949 0 32 47 32 14 7 4575 32 0 20 71 58 87 386 47 20 0 66 84 13 7234 32 71 66 0 16 57 8475 14 58 84 16 0 32 1660 7 87 13 57 32 0 839 45 38 72 84 16 8 0100 39 87 26 51 78 41 70 35 6139 0 17 5 95 98 39 84 100 2287 17 0 36 31 97 6 37 49 4526 5 36 0 77 20 18 72 60 1551 95 31 77 0 79 77 46 50 3278 98 97 20 79 0 38 52 48 3041

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论