#P6529. [COCI 2015/2016 #1] KARTE
[COCI 2015/2016 #1] KARTE
Description
Here is a pile of cards, but unfortunately it seems they are not complete.
You need to find how many cards are missing for each suit.
If there are duplicate playing cards, output GRESKA.
Input Format
You will read a string , where every three characters represent one playing card.
For each playing card:
- The first character is the suit, represented by
P,K,H,T, and the output order is also this order. - The next two characters are the rank of the card. A one-digit rank will be padded with a leading zero.
Output Format
If there are duplicate playing cards, output GRESKA.
Otherwise, in the order P, K, H, T, output how many cards are missing in that suit.
P01K02H03H04
12 12 11 13
H02H10P11H02
GRESKA
P10K10H10T01
12 12 12 12
Hint
Sample Explanation
Sample 1 Explanation
There is one card of suit P, one card of suit K, and two cards of suit H.
Sample 2 Explanation
There are two H02, so output GRESKA.
Constraints
For of the testdata, it is guaranteed that , and contains only digits and P, K, H, T. The rank of each card satisfies .
Notes
This problem is worth points in total.
This problem is translated from Croatian Open Competition in Informatics 2015/2016 Contest #1 T1 KARTE。
Translated by ChatGPT 5
京公网安备 11011102002149号