QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#21264. ركض الأبقار

Statistics

John وBessie ابتكرا لعبة تمرين. نفس البداية بمضمار دائري $M$ ($2\le M\le1,000,000,000$)، $N$ جولات ($1\le N\le14$)، $8N$ بطاقات $X_i$ ($0\le X_i<M$).

كل جولة أعلى $8$ بكومة منفصلة، FJ أعلى $4$ أو أسفل $4$، Bessie منها أعلى $2$ أو أسفل $2$. ينادي FJ العلوية $X_{top}$، يركضن $R*X_{top}$ حيث $R$ إجمالي المسافة السابقة؛ هي السفلية $X_{bottom}$، يركضن $X_{bottom}$.

يخشى التعب والبعد. أكثر من $K$ من البداية ($0\le K\le\lfloor M/2\rfloor$) لا يعدن.

اللعب الصحيح يضمن FJ العودة مهما Bessie. كل جولة نصف يضمن ضد أي اختيارات مستقبلية. هي حسب الإدخال ثم التالية. رغم إعطاء اختياراتها يجب FJ ينجح لأي اختيار، كأنه لا يعرف المستقبل.

الإدخال

  • السطر 1: صحيحة $N,M,K$ بفراغات.
  • السطر 2: $N$ حروف، $i$ T هي أعلى $2$ بجولة $i$، وإلا B أسفل $2$.
  • الأسطر $3..2+N$: ثمانية صحيحة البطاقات أعلى لأسفل.

الإخراج

  • السطر 1: $N$ حروف، $i$ T FJ أعلى $4$، B أسفل $4$. متعدد: الأول معجميًا أي الأصغر أبجديًا.

أمثلة

الإدخال 1

2 2 0
TT
1 0 0 0 0 0 0 1
0 1 1 1 0 0 1 0

الإخراج 1

TB

ملاحظة

تنتهي تمام البداية. FJ لا يعلم اختياراتها سلفًا، وإلا يمكن النصف السفلي دائمًا.

نسبة المسألة: Mark Gordon، 2011

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.