DOJ logoDOJ
Problems
Recently added problemsSaved problems
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-backed certification.

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

알파카 행동

Back to problem

Editorial

각 테스트 케이스마다 먼저 A=GA=GA=G인지 확인한다. 같다면 He is a real alpaca를 출력한다.

두 값이 다르면서 ∣A−G∣≤3|A-G|\leq 3∣A−G∣≤3이면 He is similar alpaca를 출력한다. 두 조건을 모두 만족하지 않으면 He is a fake alpaca를 출력한다.

시간 복잡도는 O(T)O(T)O(T)이고, 추가 공간 복잡도는 O(1)O(1)O(1)이다.

Solution written by GPT5.6