QOJ.ac

QOJ

时间限制: 2.0 s 内存限制: 256 MB 总分: 100

#12742. 哈希码黑客

统计

根据 Java 标准库文档,字符串的哈希码计算方式如下:

$s[0] \cdot 31^{n-1} + s[1] \cdot 31^{n-2} + \dots + s[n-1]$

其中 $s[i]$ 是字符串的第 $i$ 个字符,$n$ 是字符串的长度,符号 $^$ 表示幂运算。计算过程使用补码形式的 32 位有符号整数。

Heather 准备攻击“Not Entirely Evil Recording Company (NEERC)”的服务器。为了实施攻击,她需要 $k$ 个具有相同哈希码的互不相同的查询字符串。遗憾的是,NEERC 的服务器仅接受包含大小写英文字母的查询字符串。

Heather 雇佣你编写一个程序,为她生成这些查询字符串。

输入格式

输入文件的唯一一行包含一个整数 $k$ —— 需要生成的查询字符串的数量 ($2 \le k \le 1000$)。

输出格式

输出 $k$ 行。每行应包含一个查询字符串。每个查询字符串不能为空,且长度不得超过 $1000$ 个字符。查询字符串应仅包含大小写英文字母。所有查询字符串必须互不相同,且必须具有相同的哈希码。

样例

输入 1

4

输出 1

edHs
mENAGeS
fEHs
edIT

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.