#P11137. [APC001] B - Checker

[APC001] B - Checker

Background

Xiao K is preparing for an open contest. He has an idea, but he is worried that it might be a duplicate problem, so he needs to confirm whether this problem is a duplicate. However, he still has many other things to do, so he hands this task over to you.

Problem Description

There are nn problems in the problem set. The name of each problem is a string of length less than 1010. Let the length of a problem name be kk. We define two problems to be duplicate problems if and only if their names have at least k2\left\lceil\frac{k}{2} \right\rceil positions where the characters are the same.

Now Xiao K gives you his problem and hopes that you can help him check for duplicates (that is, compare his problem name with each of the other problem names one by one, and decide whether it is a duplicate problem).

Input Format

First, input a positive integer nn, which indicates the number of problems in the problem set. Then input a string ss, which is the name of Xiao K's problem.

After that, the next nn lines each contain a string, representing the names of these problems.

Each input string has the same length.

Output Format

Output two lines. On the first line, output the number of duplicate problems. If there are no duplicate problems, then output Good job! on the second line; otherwise, output Make persistent efforts..

3
chachong
abcabcat
chocolat
noiprp++
0
Good job!
10
apc001_b
apc001_b
apc001_b
apc001_b
apc001_b
apc001_b
apc001_b
apc001_b
apc001_b
apc001_b
apc001_b
10
Make persistent efforts.
25
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
0
Good job!

Hint

[Sample Explanation #1]

The problem name is chachong. It has 00 matching characters with the first problem, 33 matching characters with the second problem, and 00 matching characters with the third problem. Each name has 88 characters, and there is no problem that has at least 8×50%=48 \times 50\% = 4 matching characters with Xiao K's problem.

[Sample Explanation #2]

Please note that it is possible that there are also duplicate problems within the problem set.

[Constraints]

For 100%100\% of the testdata, it is guaranteed that 1n1041 \le n \le 10^4, 1k101 \le k \le 10, all strings have the same length, and they do not contain invisible characters.

Translated by ChatGPT 5