The wordings with this problem were terrible. I could not understand half of it the first time I read it....
But I managed to get AC. This is a simulation problem, there's not much logic involved, so I'll give out detailed steps on how to get AC.
1. There are 52 cards, the score of the cards = {A, K, Q, J, T} = 10, rest are their independent numbers. There's a comment lurking here that misguides you about this, what I've mentioned in this point is the right way to score individual cards.
2. The cards are indexed backwards. first element in the array is the 52th card (bottom of the pile).
3. Indexing starts from 1 in the problem, you should account for it while using zero indexes.
Simulation: Remove the top 25 cards, and keep them somewhere safe. So your pile will the 26th card on the top. Perform the iteration specified (Find the score of the card which is at the top, remove it. Depending on the score remove [10  X] more cards from the top of the pile[can be zero]). Once the iteration is done, put back those those original 25 cards which you removed initially.
While performing the three iterations, do remember to keep track of the sum of the scores (a.k.a Y in our problem) of each card which was on the top when that iteration started.
The solution is to find the Yth card from the bottom accounting for all the removed cards from the deck.
10646  What is the Card?
Moderator: Board moderators
Re: 10646  What is the Card?
Agreed Zapster. Some of the problems are very simple, but worded very confusingly that most of the time is spent trying to decipher the wording alone.
To simplify (for those still confused by the wording), In the example:
This is the top 25 cards.
Or put more visually
To simplify (for those still confused by the wording), In the example:
Code: Select all
1
2D TC TS 2C 9H 8S AH QC JC 9S 7H 2S 3C 4H AC 8C 3S 5D 7C 6C KC AS QS 5H 9D TD 7D 6S JD JS 3H QD 5S 6D 3D TH KH 2H 4D QH KD 4S 8H 9C 8D 6H JH 5C 7S AD KS 4C
Code: Select all
6S JD JS 3H QD 5S 6D 3D TH KH 2H 4D QH KD 4S 8H 9C 8D 6H JH 5C 7S AD KS 4C
Code: Select all
This is the bottom > 2D TC TS 2C 9H 8S AH QC JC 9S 7H 2S 3C 4H AC 8C 3S 5D 7C 6C KC AS QS 5H 9D TD 7D 6S JD JS 3H QD 5S 6D 3D TH KH 2H 4D QH KD 4S 8H 9C 8D 6H JH 5C 7S AD KS 4C < and this is the top.

 Experienced poster
 Posts: 128
 Joined: Wed May 18, 2011 3:04 pm
Re: 10646  What is the Card?
Bad problem statement!
metaphysis: http://uhunt.onlinejudge.org/id/95895
My solutions for UVa problems: https://github.com/metaphysis/Code.
My solutions for UVa problems: https://github.com/metaphysis/Code.