QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 1024 MB

#23618. שלט צנוע

İstatistikler

אנחנו עומדים לצבוע שלט אבל אנחנו יכולים להרשות לעצמנו שבלונות רק עבור $k$ אותיות. עדכנו את הטקסט של השלט כך שישתמש רק ב-$k$ אותיות ייחודיות מבלי לשנות את האורך של אף אחת מהמילים, כדי שנוכל לתקן את השלט בעדינות מאוחר יותר.

problem_23618_b9a2f08858b6f3bc9138924a04eac634.png

איור A.1: המחשה של קלט לדוגמה 1. אתם יכולים לעשות את זה!

קלט

  • השורה הראשונה של הקלט מכילה את מספר המילים, $n$ ($1 \le n \le 1000$), ואת מספר האותיות, $k$ ($1 \le k \le 26$).
  • השורה השנייה של הקלט מכילה $n$ מילים. כל מילה מורכבת מבין $1$ ל-$20$ אותיות לטיניות קטנות.

פלט

הדפיסו ביטוי המשתמש בלכל היותר $k$ אותיות שונות, תוך החלפת כמה שפחות אותיות מהטקסט המקורי. אם ישנן מספר תשובות אפשריות, הדפיסו אחת מהן.

דוגמאות

קלט 1

2 3
good luck

פלט 1

lool lull

קלט 2

3 1
this is hard

פלט 2

ssss ss ssss

קלט 3

1 6
impossible

פלט 3

imbossibee

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.