QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100 Interactive

#14861. 垃圾进,垃圾出

Statistics

今天是 2525 年 7 月 25 日。如今,大型语言模型(LLM)的使用已无处不在,以至于在互联网上几乎不可能找到真正由人类撰写的文章,而不会迷失在 LLM 生成的各种胡言乱语中。

(不)幸的是,LLM 技术已经显著退化。神经网络主要是在由较旧的 LLM 生成的数据上进行训练的,而这些旧的 LLM 又是用更旧的回收数据训练出来的。因此,大多数 LLM 生成的输出都是一长串小写字母,每个字母都是独立且均匀随机地选择的。

同样地,在五百年后,人工生成的图像就会是这个样子。

你决定编写一个程序来搜寻互联网,寻找人类撰写的文章。你的程序必须确定给定的文本是人类撰写的,还是由 LLM 生成的。

给定的文本保证恰好是以下情况之一:

  • 人类撰写:在这种情况下,它是给定单词列表中单词的固定拼接(不含空格)。
  • 非人类撰写(因此是由 LLM 生成的):在这种情况下,每个字符都是独立且均匀随机地选择的。

输入格式

输入包含以下内容:

  • 第一行包含一个字符串 $s$,即待检测的给定文本。
  • 第二行包含一个整数 $n$,表示单词列表中的单词数量。
  • 接下来的 $n$ 行,每行包含一个字符串 $w$($6 \le |w| \le 10$),表示单词列表中的单词。单词列表中的单词互不相同,且在每个测试用例中是固定的。

所有输入字符串仅由英文小写字母(a-z)组成。

你的提交将在恰好 100 个测试用例上运行,所有测试用例均满足 $|s| = 3 \cdot 10^5$ 且 $n = 5000$。样例的规模较小,仅用于演示说明。

对于 $s$ 是人类撰写的每个测试用例,$s$ 是固定的,并且在你的每次提交之间不会改变。对于 $s$ 是由 LLM 生成的每个测试用例,你的每次提交都将收到一个新的字符串 $s$,该字符串是通过独立且均匀地随机选择英文小写字母(a-z)生成的。

输出格式

如果给定的字符串是人类撰写的,输出 yes。否则,如果它是由 LLM 生成的,输出 no

样例

输入样例 1

ballooncodingballoonacceptedchallengechallengecoding
5
accepted
balloon
challenge
coding
algorithms

输出样例 1

yes

输入样例 2

nlaiueakuyclocedxlwvxdbiifqjbinucjabzyaqakhohgympi
5
aaaaaaaaaa
bbbbbbbbbb
aababbb
aaabbbaaa
abaaba

输出样例 2

no

输入样例 3

aaaaaaaaaaabbbbbbbbbbaaaaaaaaaaaaaaabbbbbbbbbbbbbb
5
aaaaaaaaa
bbbbbbbbbb
aabbbbb
aaaaabbbb
bbbbba

输出样例 3

yes

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.