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

거북이의 증명사진

Back to problem

Editorial

각 사진을 확인하면서 머리가 보이고 발이 하나도 보이지 않는 사진을 센다. 즉, Hi=1H_i=1Hi​=1이고 Fi=0F_i=0Fi​=0인 사진의 수를 구하면 된다.

사진을 입력받을 때마다 조건을 확인하면 시간 복잡도는 O(N)O(N)O(N), 입력을 저장하는 공간을 제외한 추가 공간 복잡도는 O(1)O(1)O(1)이다.

Solution written by GPT6