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.