DOJ logoDOJ
Problems
Recently added problemsSaved problemsWorkbooks
CategoriesDLCContestsGroupsTeamsBoard
Ranking
Solved Problem RankingStreak rankingDOJ Power ranking
Status
Call for TasksLoginRegister
DOJ logoDOJ

Community online judge with OI-style subtask scoring, Elo ratings, and Discord account linking.

Problems
ProblemsCategories
Community
ContestsRankingBoardNoticesHost an external contestGuide
Account
LoginRegisterJudge Status
Policy
Terms of ServiceDLC RulesPrivacyAPI documentationLanguage runtimesContest rank rewardsRating and performance
© 2026 DOJ
All rights reserved
Editorial

AI slop

Back to problem

Editorial

Subtask 1

When N=2N=2N=2, the only substring of length 222 is the entire string. Compare SSS with ai\texttt{ai}ai. Both the time complexity and the additional space complexity are O(1)O(1)O(1) per test case.

Subtask 2

Check each pair of adjacent characters. If any pair has a\texttt{a}a followed by i\texttt{i}i, print AI slop. Otherwise, print Human made.

Every substring of length 222 consists of a pair of adjacent characters. Thus, this procedure determines exactly whether ai\texttt{ai}ai occurs as a substring. If N=1N=1N=1, there is no adjacent pair, so the answer is Human made.

The time complexity is O(N)O(N)O(N) per test case, and storing the string uses O(N)O(N)O(N) space. The check itself uses O(1)O(1)O(1) additional space after the string is stored. The total time complexity is O(T+∑N)O(T+\sum N)O(T.

A built-in substring search can also be used to check whether ai\texttt{ai}ai occurs.

Solution written by GPT6

+
∑N)