{"id":904,"date":"2019-03-30T18:12:48","date_gmt":"2019-03-30T09:12:48","guid":{"rendered":"https:\/\/dong1lkim.oboki.net\/?p=904"},"modified":"2019-09-01T22:23:15","modified_gmt":"2019-09-01T13:23:15","slug":"13458-%ec%8b%9c%ed%97%98-%ea%b0%90%eb%8f%85","status":"publish","type":"post","link":"https:\/\/oboki.net\/workspace\/python\/13458-%ec%8b%9c%ed%97%98-%ea%b0%90%eb%8f%85\/","title":{"rendered":"[BaekJoon Online Judge] 13458 &#8211; \uc2dc\ud5d8 \uac10\ub3c5"},"content":{"rendered":"<h1>[BaekJoon Online Judge] 13458 &#8211; \uc2dc\ud5d8 \uac10\ub3c5<\/h1>\n<h2>\ubb38\uc81c<\/h2>\n<p><a href=\"https:\/\/www.acmicpc.net\/problem\/13458\"><a href=\"https:\/\/www.acmicpc.net\/problem\/13458\">https:\/\/www.acmicpc.net\/problem\/13458<\/a><\/a><\/p>\n<h2>\uc18c\uc2a4\ucf54\ub4dc<\/h2>\n<p>\ucd1d \uac10\ub3c5\uad00\uc740 \uc624\uc9c1 1\uba85\ub9cc \uc788\uc5b4\uc57c \ud558\ubbc0\ub85c, \ucd1d \uac10\ub3c5\uad00 \ud55c \uba85\uc774 \uac10\ub2f9\ud560 \uc218 \uc788\ub294 \uc778\uc6d0\uc744 \ucd08\uacfc\ud55c \uc778\uc6d0\uc5d0 \ub300\ud574\uc11c \ud544\uc694\ud55c \ubd80\uac10\ub3c5\uad00 \uc218\ub97c \uc0b0\uc815\ud558\uba74 \ub418\ub294\ub370 <code>if - else<\/code> \ub9cc\uc73c\ub85c \uad6c\ud604\ud558\ub2c8 \uc2dc\uac04\ucd08\uacfc\uac00 \ub098\uc11c, <code>elif<\/code> \uc870\uac74\uc744 \ud558\ub098 \ub354 \ucd94\uac00\ud574\uc11c, <code>d[]<\/code> \ubc30\uc5f4\uc5d0 \uba54\ubaa8\uc774\uc81c\uc774\uc158 \ud55c \uacb0\uacfc\ub97c \ub9ac\ud134\ud560 \uc218 \uc788\ub3c4\ub85d \ud588\ub2e4.<\/p>\n<pre><code class=\"py\">N = int(input())\nA = list(map(int,input().split()))\nB,C = map(int,input().split())\n\nd = [0] * (max(A)+1)\n\ncnt = 0\nfor i in range(N):\n    if A[i]&lt;=B:\n        cnt += 1\n        continue\n    elif d[A[i]] != 0:\n        cnt += d[A[i]]\n    else:\n        ref,tmp = B,1\n        while A[i]&gt;ref: tmp,ref = tmp+1,ref+C\n        d[A[i]] = tmp\n        cnt += tmp\nprint(cnt)\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>[BaekJoon Online Judge] 13458 &#8211; \uc2dc\ud5d8 \uac10\ub3c5 \ubb38\uc81c https:\/\/www.acmicpc.net\/problem\/13458 \uc18c\uc2a4\ucf54\ub4dc \ucd1d \uac10\ub3c5\uad00\uc740 \uc624\uc9c1 1\uba85\ub9cc \uc788\uc5b4\uc57c \ud558\ubbc0\ub85c, \ucd1d \uac10\ub3c5\uad00 \ud55c \uba85\uc774 \uac10\ub2f9\ud560 \uc218 \uc788\ub294 \uc778\uc6d0\uc744 \ucd08\uacfc\ud55c \uc778\uc6d0\uc5d0 \ub300\ud574\uc11c \ud544\uc694\ud55c \ubd80\uac10\ub3c5\uad00 \uc218\ub97c \uc0b0\uc815\ud558\uba74 \ub418\ub294\ub370 if &#8211; else \ub9cc\uc73c\ub85c \uad6c\ud604\ud558\ub2c8 \uc2dc\uac04\ucd08\uacfc\uac00 \ub098\uc11c, elif \uc870\uac74\uc744 \ud558\ub098 \ub354 \ucd94\uac00\ud574\uc11c, d[] \ubc30\uc5f4\uc5d0 \uba54\ubaa8\uc774\uc81c\uc774\uc158 \ud55c \uacb0\uacfc\ub97c \ub9ac\ud134\ud560 \uc218 \uc788\ub3c4\ub85d \ud588\ub2e4. N = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,10],"tags":[34,95],"class_list":["post-904","post","type-post","status-publish","format-standard","hentry","category-baekjoon-online-judge","category-python","tag-python","tag-95"],"_links":{"self":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/comments?post=904"}],"version-history":[{"count":2,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/904\/revisions"}],"predecessor-version":[{"id":1349,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/904\/revisions\/1349"}],"wp:attachment":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/media?parent=904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/categories?post=904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/tags?post=904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}