FPC25-019.Gambler's Dilemma
Easy · 1 s · 256 MB
- icpc
- fpc
- 2025
You are new to poker and want to know when to fold before the flop. The flop refers to the turning of the first three cards on the table, which happens after you have received two cards in your hand. After receiving your two cards, you need to decide whether you want to keep them and place a bet or to fold (which means to step out of the game without placing a bid).
There are complicated tables for this, which also depend on how many people are sitting between you and the dealer, but you have decided on the following heuristic. ( We deny any responsibility for using this heuristic in practice. ) You keep your two initial cards and place a bet if they have one of the following properties:
• They are a pair (two cards of the same rank), but not a pair of s or a pair of s.
• The two cards are of consecutive ranks, and each is or higher.
• The two cards are of the same suit, and at least one card is a Queen or higher.
• Each card is a Jack or higher.
If your two initial cards do not have any of these properties, you fold before the flop.
Note that the Ace ranks higher than the King, and not lower than the .
Giriş formatı
The input consists of:
• One line with two different cards, each of which consists of one character
(denoting the rank: a number, Ten, Jack, Queen, King, or Ace) and one character (denoting the suit: clubs, diamonds, hearts, or spades).
Çıxış formatı
Output “yes” if you keep your two initial cards, and “no” if you fold before the flop.
Qeyd
Source: Freshmen Programming Contest 2025 · License: CC BY-SA 4.0 · Original: https://fpc.wisv.ch · Statement adapted for AlgoLens and shared under the same license.
Nümunələr
Giriş #1
TD TS
Çıxış #1
yes
Giriş #2
8D 9D
Çıxış #2
no
Giriş #3
5H 3S
Çıxış #3
no