QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB

#23618. Biển hiệu tối giản

Statistics

Chúng tôi dự định sơn một tấm biển hiệu nhưng chỉ đủ khả năng mua khuôn tô cho $k$ chữ cái. Hãy cập nhật văn bản trên biển hiệu để chỉ sử dụng $k$ chữ cái phân biệt mà không làm thay đổi độ dài của bất kỳ từ nào, để sau này chúng tôi có thể khéo léo sửa lại tấm biển.

problem_23618_b9a2f08858b6f3bc9138924a04eac634.png

Hình A.1: Minh họa cho Dữ liệu vào mẫu 1. Bạn làm được mà!

Dữ liệu vào

  • Dòng đầu tiên của dữ liệu vào chứa số lượng từ $n$ ($1 \le n \le 1000$) và số lượng chữ cái $k$ ($1 \le k \le 26$).
  • Dòng thứ hai của dữ liệu vào chứa $n$ từ. Mỗi từ bao gồm từ $1$ đến $20$ chữ cái Latinh thường.

Dữ liệu ra

In ra một cụm từ sử dụng tối đa $k$ chữ cái phân biệt, thay thế ít chữ cái nhất có thể so với văn bản gốc. Nếu có nhiều đáp án thỏa mãn, hãy in ra một đáp án bất kỳ.

Ví dụ

Dữ liệu vào 1

2 3
good luck

Dữ liệu ra 1

lool lull

Dữ liệu vào 2

3 1
this is hard

Dữ liệu ra 2

ssss ss ssss

Dữ liệu vào 3

1 6
impossible

Dữ liệu ra 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.