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-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

  • NNN과 MMM이 작으므로, 아이템을 배열에 넣고 살 아이템마다 이름으로 찾아도 됩니다.
  • dict, std::map, HashMap 등을 써도 됩니다.
  • 가격의 합은 2×10182 \times 10^{18}2×1018까지 커지므로 64비트 정수를 써야 합니다.