luogu#P7055. [NWRRC2015] Hash Code Hacker

[NWRRC2015] Hash Code Hacker

题目描述

According to Java standard library documentation, the hash code of String is computed as

$s[0] \times 31 ^ {n -1} + s[1] \times 31 ^ {n -2} + \cdots + s[n -1]$

Here s[i]s[i] is the i-th character of the string, nn is the length of the string, and ^ indicates exponentiation. Computation uses signed 32bit32-bit integers in two's complement form.

Heather is going to hack the servers of Not Entirely Evil Recording Company (NEERC).(NEERC). To perform an attack she needs kk distinct query strings that have equal hash codes. Unfortunately, NEERC servers accept query string containing lower- and uppercase English letters only.

Heather hired you to write a program that generates such query strings for her.

输入格式

The single line of the input file contains integer kk -- the number of required query strings to generate (2k1000)(2 \le k \le 1000) .

输出格式

Output kk lines. Each line should contain a single query string. Each query string should be non-empty and its length should not exceed 10001000 characters. Query string should contain only lower- and uppercase English letters. All query strings should be distinct and should have equal hash codes.

题目大意

根据JavaJava的标准库文件,字符串的哈希代码是这么计算的:

s[0]×31(n1)+s[1]×31(n2)++s[n1]s[0]×31 ^{(n−1)}+s[1]×31^{(n−2)}+⋯+s[n−1]

在这里,s[i]指的是字符串中的第i位,n是字符串的长度。

这个计算过程用的是有符号的3232位整数的二进制补码形式。

有一个人叫作 阖锕仄 (Heather)(Heather)。他想要hackhack掉“不全是恶魔录音公司”(NEERC)(NEERC)。为了进行

一次攻击,阖锕仄需要kk个有相同哈希代码的不同的询问字符串。不幸的是,NEERCNEERC的服务器

只接受只包含大小写字母的字符串。

阖锕仄请你帮忙写一个程序,以生成他需要的询问字符串。


输入一个正整数kk,代表需要的字符串的数量。


输出有kk行,每行的询问字符串都不应该为空,并且每行的字符串的长度应该小于等于1000个字符。

询问字符串的具体要求请看上文。


时间限制:2s2s

空间限制:256MB256MB

翻译提供:@Trexmao

4

edHs
mENAGeS
fEHs
edIT

提示

Time limit: 2 s, Memory limit: 256 MB.