#P14603. [NWRRC 2025] Defense Distance
[NWRRC 2025] Defense Distance
题目描述
The NWRRC security server has a final access check for teams that try to submit their solutions to the secret hidden problem.
To pass the check, the team must enter three passwords , , and that the system will accept. Each password must be a non-empty string consisting of at most lowercase English letters.
The rules of the server are public:
- The distance between and should be equal to .
- The distance between and should be equal to .
- The distance between and should be equal to .
The between two strings and is the minimum number of single-character operations (insert one character, remove one character, or replace one character) needed to convert string into string . This metric is also known as the Levenshtein distance.
The server gives access to the hidden problem if and only if all described conditions are satisfied. Your goal is to construct a triple of passwords to unlock the hidden problem or determine that it is impossible.
输入格式
The only line contains three integers , , and , denoting the required distances between each pair of passwords ().
输出格式
If there are no three passwords with the required properties, print in the only line.
Otherwise, print in the first line. Then print passwords , , and in the following three lines. Each password should consist of at least and at most lowercase English letters.
If there are multiple triples of passwords that meet the requirements, print any of them.
4 3 5
Yes
icpc
nwrrc
itmo
2 2 2
Yes
aa
bb
cc
0 0 1
No
提示
In the first test case:
- The distance between and is : .
- The distance between and is : .
- The distance between and is : .
In the second test case, the distance between each pair of passwords is .
In the third test case, it can be shown that there are no three passwords with the required properties.
京公网安备 11011102002149号