Universal Cup Judging System

Universal Cup

Limite de temps : 1.0 s Limite de mémoire : 256 MB Points totaux : 100 Hackable ✓
Statistiques

יחד עם גורל מפותל, ל-Nadeko יש מחרוזת $s$ המורכבת מאותיות קטנות. משאלתה העליונה היא לבנות מחרוזת $t$ שעבורה מתקיימים התנאים הבאים:

  • $t$ אינה מכילה את $s$ כתת-סדרה.
  • כל תת-סדרה של $s$ שאינה מתלכדת עם $s$ מוכלת ב-$t$ כתת-סדרה.

עזרו לה למצוא מחרוזת $t$ באורך המינימלי האפשרי. אם קיימות מספר מחרוזות כאלה, מותר להדפיס כל אחת מהן.

קלט

שורה בודדת של הקלט מכילה את המחרוזת $s$ ($2 \le |s| \le 10^6$) — המחרוזת של Nadeko. מובטח כי $s$ מכילה רק אותיות קטנות.

פלט

בשורה בודדת, הדפיסו מחרוזת כלשהי $t$ באורך מינימלי המקיימת את תנאי הבעיה.

דוגמאות

קלט 1

aaaa

פלט 1

aaa

קלט 2

bba

פלט 2

bab

הערה

בדוגמה השנייה, המחרוזת bab מכילה את bb, ba, a, b כתתי-סדרות אך אינה מכילה את bba. כמו כן ברור שאי אפשר לבנות סדרה חוקית באורך $2$, ולכן bab היא תשובה אפשרית.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#367EditorialOpen题解jianglyView

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.