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

Score Calculation

Back to problem

Editorial

Initialize a sum to 000 and add each score once. After processing kkk scores, the sum equals exactly their total, so after all scores it is the answer. Time complexity is O(N)O(N)O(N) and auxiliary space is O(1)O(1)O(1). The maximum sum is 100⋅100=10000100\cdot100=10000100⋅100=10000. A naive solution may add 111 once for each point; at most 100001000010000 updates are needed.

Solution written by GPT6.1