| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 353 | 315 | 300 | 89.552% |
You are the host of a street experiment show called TOPC (Take Or Pass Challenge). In the show, you approach people one by one and offer them some money. Each person can either:
The game starts with $x$ dollars. You go down the street and meet a random person. You would like to predict in advance what each of them will say — either “take” or “double”.
You have a limited budget of $d$ dollars in your pocket. If, at any point, a person’s decision could result in an amount strictly greater than your available funds $d,ドル you must force the person to say “take it”, regardless of what they wanted to say. Taiwanese people are very kind-hearted, so whenever they have a choice, they would always say “double it” and pass the opportunity to others — unless they are forced to take the money.
Your task is to simulate the game and determine if the person you meet will take the money or double it and give it to the next person.
The input contains two integers $x$ and $d$.
Output a string “take it” or “double it”.
123 246
double it
345 678
take it
789 101112
double it
ICPC > Regionals > Asia Pacific > Taiwan > Taiwan Online Programming Contest > TOPC 2025 A번