|
|
Only KS can be skipped but not KD KC KH The description to this problem is so long and so ambiguous, that very few people can understand it. I myself understood it with 2 hours and made a BIG mistake. Now, I will explain it to you all. We don't have to pay much attention to the exact rules, but only the card we can lay. According to the description, we can only lay skip-turn cards until the last one(of course, the last card can be any one), and make sure that all the continuous cards is connectable. What we must do is to find a card sequence to match this. BUT, there is some TRAPS here: 1. If the last-laid card is QUEEN, then is must be followed by a same-suit card, it means that, for example, we can't use a QC to cover a QD. 2. Jokers may be the most useful cards, but it is the hardest part to this problem(at least I think so). To use it, you can of course assign its value and suit arbitrary, but please make sure that it can match its previous and next card. For instance, you can't use joker here: 3C * JH, for * can't be a skip-turn card here. That's all. My solution is not very good, it got ACCEPTED in 0.156 sec. May all of you a better result than me. Edited by author 18.08.2008 11:03 I think we can use joker here: 3C * JH, when wei set * as 8QCH. (We can do this,see the sample input) Edited by author 08.02.2009 17:18 Edited by author 08.02.2009 17:18 Now I know I am wrong! You can only use 6,7,A and KS.(Except the last card). Thanks to 198808xc ! Now I got AC!! Edited by author 10.02.2009 12:50 Edited by author 10.02.2009 18:24 But skipping card may be any one, 9H , for example, if second player hasn't connectable card for it and upper card in desk also isn't connectable. Edited by author 14.06.2009 09:50 But skipping card may be any one, 9H , for example, if second player hasn't connectable card for it and upper card in desk also isn't connectable. Edited by author 14.06.2009 09:50 But, second player may has Joker. Hovewer, 9H - never skipping card. Am I right? AC~!!! 0.031 in tje first attempt Edited by author 16.02.2012 21:311. Can there be more than 2 jokers? 2. Can there be identical cards? I read the problem statement and it said that we are using a standard card deck. Hence, the two cases above shouldn't happen. However, I saw in the other thread that it can happen.. Apparently a queen cannot cover another queen except if it is the same color (i.e. one of them was created by a joker). Can the admins please point where in the problem statement is stated this? I lost plenty of time to figure it out and (as far as I see from the discussion board) other people have had the same problem. Please add it to the problem statement to reduce future confusion - the statement is confusing enough as it is... Edited by author 23.05.2011 13:38 Does anyone know what could be test #53? I Have WA on that one. I thought out plenty of tests, but they all were passed by my code. Now I am wandering what kind of test the fifth one might be). Do someone know something about it? And a few questions: 1) Could player has some idential cards? 2) Could player has more then 1 joker? 3) Could the Queen be laid by another Queen of suit, differ then announced by the first Queen? Test 5 is smth like * * AC 6S 7H AS 6D 7D AH 6C 7C KS AD QS 4D Now I have wa51 :P First 51 tests don't have idential cards and more then two jokers. You can't lay the Queen onto the Queen with differ announced suit. Edited by author 16.09.2008 12:06 what's test #35? I have found my mistakes. And I'd like to supply some test. TS * 3S YES *KS TS * QCD YES *6D New tests have been added. 16 authors have lost AC. I have no ideas. Can anyone help me? |
|
|