QOJ.ac

QOJ

时间限制: 2 s 内存限制: 1024 MB

#23618. Papan Nama Sederhana

统计

Kita akan mengecat sebuah papan nama tetapi kita hanya mampu membeli stensil untuk $k$ huruf. Perbarui teks pada papan nama tersebut agar hanya menggunakan $k$ huruf unik tanpa mengubah panjang kata apa pun, sehingga kita dapat memperbaiki papan nama itu secara halus nanti.

problem_23618_b9a2f08858b6f3bc9138924a04eac634.png

Gambar A.1: Ilustrasi Masukan Contoh 1. Kamu pasti bisa!

Masukan

  • Baris pertama masukan berisi jumlah kata, $n$ ($1 \le n \le 1000$), dan jumlah huruf, $k$ ($1 \le k \le 26$).
  • Baris kedua masukan berisi $n$ kata. Setiap kata terdiri dari antara $1$ hingga $20$ huruf Latin kecil.

Keluaran

Keluarkan sebuah frasa yang menggunakan paling banyak $k$ huruf berbeda, dengan mengganti sesedikit mungkin huruf dari teks asli. Jika terdapat beberapa kemungkinan jawaban, keluarkan yang mana saja.

Contoh

Masukan 1

2 3
good luck

Keluaran 1

lool lull

Masukan 2

3 1
this is hard

Keluaran 2

ssss ss ssss

Masukan 3

1 6
impossible

Keluaran 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.