Garbage In, Garbage Out
문제
It is the 25th of July, 2525. Now that the usage of Large Language Models (LLMs) is so ubiquitous, it has become nearly impossible to find actual human-made articles on the internet and not get lost in all the gibberish produced by LLMs.
(Un)fortunately, LLM technology has regressed significantly. Neural networks have been trained on data that is mostly generated by older LLMs, which in turn were trained on even older recycled data. As a result, the output produced by most LLMs is a long string of lowercase letters, each chosen uniformly at random and independently of the others.
You decided to make a program to scavenge the internet in search of human-made articles. Your program must determine whether a given text is human-made or generated by an LLM.
A given text is guaranteed to be exactly one of the following:
- Human-made, in which case it is a fixed concatenation (without spaces) of words from a given word list.
- Not human-made and, therefore, generated by an LLM, in which case each character is chosen independently and uniformly at random.
입력
The input consists of:
- One line with a string , the given text to check.
- One line with an integer , the number of words in the word list.
- lines, each with a string (), the words in the word list. The words in the word list are distinct and fixed per test case.
All input strings only consist of English lowercase letters (a-z).
Your submission will be run on exactly test cases, all of which will have and . The samples are smaller and for illustration only.
For each test case where is human-made, is fixed and does not change between each of your submissions. For each test case where is generated by an LLM, each of your submissions will receive a new string , generated from independently and uniformly picking random English lowercase letters (a-z).
출력
If the given string was human-made, output "yes". Otherwise, if it was generated by an LLM, output "no".
예제
예제 1
ballooncodingballoonacceptedchallengechallengecoding 5 accepted balloon challenge coding algorithms
yes
예제 2
nlaiueakuyclocedxlwvxdbiifqjbinucjabzyaqakhohgympi 5 aaaaaaaaaa bbbbbbbbbb aababbb aaabbbaaa abaaba
no
예제 3
aaaaaaaaaaabbbbbbbbbbaaaaaaaaaaaaaaabbbbbbbbbbbbbb 5 aaaaaaaaa bbbbbbbbbb aabbbbb aaaaabbbb bbbbba
yes