<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Kim's Programming</title>
    <link>https://robodream.tistory.com/</link>
    <description>https://github.com/kiheyunkim</description>
    <language>ko</language>
    <pubDate>Sat, 23 May 2026 06:33:00 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>Programmer.</managingEditor>
    <image>
      <title>Kim's Programming</title>
      <url>https://t1.daumcdn.net/cfile/tistory/246AB1445591B27033</url>
      <link>https://robodream.tistory.com</link>
    </image>
    <item>
      <title>Python - 숫자형 변수</title>
      <link>https://robodream.tistory.com/615</link>
      <description>&lt;h1&gt;여러가지 숫자의 형태와 출력&lt;/h1&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h5&gt;파이썬은 다양한 변수형을 지원합니다. 또 다른 언어와는 다르게 변수의 형태를 지정하지 않습니다.&lt;/h5&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;숫자형&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;num1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;123&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;실수형&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;num2&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;num3&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;4.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;24E10&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;8진수&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;num4&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0o177&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;16진수&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;num5&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0xABC&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#출력&amp;nbsp;:&amp;nbsp;123&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#출력&amp;nbsp;:&amp;nbsp;1.2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#출력&amp;nbsp;:&amp;nbsp;42400000000.0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#출력&amp;nbsp;:&amp;nbsp;127&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#출력&amp;nbsp;:&amp;nbsp;274&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;기본적으로 입력된 모든 숫자들은 10진수 형태로 표현이 됩니다.
&lt;ul&gt;
&lt;li&gt;8진수는 0o를 16진수를 0x를 이용해서 표현합니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;숫자의 사칙연산과 그 외의 연산&lt;/h1&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h5&gt;파이썬은 숫자들에 대해서 사칙연산을 지원합니다.&lt;/h5&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;사칙연산&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;num1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;num2&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;num2)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;num2)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;-&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;*&lt;/span&gt;&amp;nbsp;num2)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;num2)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;/&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;정수와 정수 연산에서 표현에 필요하다면 실수형으로 바뀝니다.
&lt;ul&gt;
&lt;li&gt;num1 / num2의 계산은 5/7로 정수/정수로 되어 다른언어 처럼 정수값이 나와 0이 되어야 할 것 같지만 실수형태인 0.7142857142857143의 값을 출력하게 됩니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;&amp;nbsp;&lt;/h5&gt;
&lt;h5&gt;추가적으로 다음의 연산자도 지원합니다.&lt;/h5&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;제곱&amp;nbsp;연산&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;*&lt;/span&gt;&amp;nbsp;num2)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;나머지&amp;nbsp;연산&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num1&amp;nbsp;%&amp;nbsp;num2)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;몫&amp;nbsp;반환&amp;nbsp;연산자&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(num1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;num2)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;소스코드: &lt;a href=&quot;https://github.com/kiheyunkim/pythonStudy/blob/master/numberType.py&quot;&gt;https://github.com/kiheyunkim/pythonStudy/blob/master/numberType.py&lt;/a&gt;&lt;/p&gt;</description>
      <category>Python</category>
      <category>Python</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/615</guid>
      <comments>https://robodream.tistory.com/615#entry615comment</comments>
      <pubDate>Mon, 24 Aug 2020 02:54:52 +0900</pubDate>
    </item>
    <item>
      <title>1859. 백만 장자 프로젝트</title>
      <link>https://robodream.tistory.com/613</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1859. 백만 장자 프로젝트&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5LrsUaDxcDFAXc&amp;amp;categoryId=AV5LrsUaDxcDFAXc&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5LrsUaDxcDFAXc&amp;amp;categoryId=AV5LrsUaDxcDFAXc&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;가장 어려웠던 문제였다 첨엔 DFS를 이용하여 풀어서 시간초과가 떴다. 하지만 뒤에서부터 하나씩 잡아 팔았을때 가장 비싼 경우를 찾는다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; dataArray;
&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; answer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
	ios_base&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	cin.tie(&lt;span style=&quot;color: #007020&quot;&gt;NULL&lt;/span&gt;);
	cout.tie(&lt;span style=&quot;color: #007020&quot;&gt;NULL&lt;/span&gt;);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;

	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T; 

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n;

		dataArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[n];
		answer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; n; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; dataArray[i];

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; checker &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; n &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; n &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;--&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (dataArray[checker] &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; dataArray[i])
				answer &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; (dataArray[checker] &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; dataArray[i]);
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
				checker &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; i;
		}

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[] dataArray;

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; answer &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/613</guid>
      <comments>https://robodream.tistory.com/613#entry613comment</comments>
      <pubDate>Sat, 1 Dec 2018 16:23:45 +0900</pubDate>
    </item>
    <item>
      <title>1926. 간단한 369게임</title>
      <link>https://robodream.tistory.com/612</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1926. 간단한 369게임&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PTeo6AHUDFAUq&amp;amp;categoryId=AV5PTeo6AHUDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PTeo6AHUDFAUq&amp;amp;categoryId=AV5PTeo6AHUDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;check369&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; number)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; retval{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; value &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; number;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;while&lt;/span&gt; (value &lt;span style=&quot;color: #333333&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; value &lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (test &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt; test &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt; test &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;)
			retval&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
		value &lt;span style=&quot;color: #333333&quot;&gt;/=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;
	}
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; retval;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; nValue{};
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; nValue;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; nValue; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count{};
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; ((count &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; check369(i)) &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; count; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;-&quot;&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
	}
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/612</guid>
      <comments>https://robodream.tistory.com/612#entry612comment</comments>
      <pubDate>Sat, 1 Dec 2018 16:11:32 +0900</pubDate>
    </item>
    <item>
      <title>2007. 패턴 마디의 길이</title>
      <link>https://robodream.tistory.com/611</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2007. 패턴 마디의 길이&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5P1kNKAl8DFAUq&amp;amp;categoryId=AV5P1kNKAl8DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5P1kNKAl8DFAUq&amp;amp;categoryId=AV5P1kNKAl8DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;패턴이 반드시 존재하기 때문에 한자리부터&amp;nbsp;부터 일일이 비교해준다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cmath&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; input[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;30&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; input;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; ok{ &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt; };
			
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;30&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; i)
			{
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;!=&lt;/span&gt; strncmp(input &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j, input &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; i, i))
					&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
					ok &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
			}
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (ok)
			{
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			}
		}
	}
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/611</guid>
      <comments>https://robodream.tistory.com/611#entry611comment</comments>
      <pubDate>Sat, 1 Dec 2018 16:07:11 +0900</pubDate>
    </item>
    <item>
      <title>2005. 파스칼의 삼각형</title>
      <link>https://robodream.tistory.com/610</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2005. 파스칼의 삼각형&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5P0-h6Ak4DFAUq&amp;amp;categoryId=AV5P0-h6Ak4DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5P0-h6Ak4DFAUq&amp;amp;categoryId=AV5P0-h6Ak4DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;

&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cmath&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;


&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	ios_base&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	cin.tie(&lt;span style=&quot;color: #007020&quot;&gt;NULL&lt;/span&gt;);
	cout.tie(&lt;span style=&quot;color: #007020&quot;&gt;NULL&lt;/span&gt;);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; numL{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; }, numR{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; N{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; N;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; size{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; N; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			size &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; i;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; dataArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[size] {&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; stack{ &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; };
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; N; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (stack &lt;span style=&quot;color: #333333&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)	&lt;span style=&quot;color: #888888&quot;&gt;//끝에 0채우기&lt;/span&gt;
				dataArray[stack &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; dataArray[stack &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; i] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
				dataArray[stack &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;

			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;)
				stack &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; i;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
			{
				stack&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				{
					dataArray[stack &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; dataArray[stack &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; i] &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; dataArray[stack &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;];
					stack&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
				}
				stack&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
			}
		}


		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; N; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; i; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; dataArray[count] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt;;
				count&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
			}
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		}

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[] dataArray;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/610</guid>
      <comments>https://robodream.tistory.com/610#entry610comment</comments>
      <pubDate>Sat, 1 Dec 2018 15:40:01 +0900</pubDate>
    </item>
    <item>
      <title>2001. 파리 퇴치</title>
      <link>https://robodream.tistory.com/609</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2001. 파리 퇴치&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PzOCKAigDFAUq&amp;amp;categoryId=AV5PzOCKAigDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PzOCKAigDFAUq&amp;amp;categoryId=AV5PzOCKAigDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;CheckTotal&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; pointer, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; nSize, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; mSize)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; sum{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; mSize; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; mSize; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			sum &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;(pointer &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; (nSize &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; i) &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j);

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; sum;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; nValue{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; }, mValue{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; nValue &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; mValue;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; dataArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[nValue&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;nValue];
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; dataArray[i&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;nValue &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j];

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; max{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; mValue &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; mValue &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; sum &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; CheckTotal(&lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&lt;/span&gt;dataArray[i&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;nValue &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j], nValue, mValue);
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (max &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; sum)
					max &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; sum;
			}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; max &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[] dataArray;
	}
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/609</guid>
      <comments>https://robodream.tistory.com/609#entry609comment</comments>
      <pubDate>Sat, 1 Dec 2018 15:36:18 +0900</pubDate>
    </item>
    <item>
      <title>1989. 초심자의 회문 검사</title>
      <link>https://robodream.tistory.com/608</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1989. 초심자의 회문 검사&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PyTLqAf4DFAUq&amp;amp;categoryId=AV5PyTLqAf4DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PyTLqAf4DFAUq&amp;amp;categoryId=AV5PyTLqAf4DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;문자열의 길이를 계산 하여 양쪽 끝을 비교한다. 길이가 홀수인 경우에 가운데 있는 것은 어떤것이 오더라도 상관없기 때문에 나머지만 비교해준다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; input[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;];
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; input;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; length &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; strlen(input);

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; resultOK{ &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt; };
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; length &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;(input[i] &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; input[length &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; i]))
			{
				resultOK &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; (resultOK &lt;span style=&quot;color: #333333&quot;&gt;?&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/608</guid>
      <comments>https://robodream.tistory.com/608#entry608comment</comments>
      <pubDate>Sat, 1 Dec 2018 15:27:54 +0900</pubDate>
    </item>
    <item>
      <title>1986. 지그재그 숫자</title>
      <link>https://robodream.tistory.com/607</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1986. 지그재그 숫자&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PxmBqAe8DFAUq&amp;amp;categoryId=AV5PxmBqAe8DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PxmBqAe8DFAUq&amp;amp;categoryId=AV5PxmBqAe8DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; nValue{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; }, answer{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; nValue;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; nValue; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			answer &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; (i &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; (i &lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;?&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;));

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; answer &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/607</guid>
      <comments>https://robodream.tistory.com/607#entry607comment</comments>
      <pubDate>Sat, 1 Dec 2018 15:17:19 +0900</pubDate>
    </item>
    <item>
      <title>1984. 중간 평균값 구하기</title>
      <link>https://robodream.tistory.com/606</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1984. 중간 평균값 구하기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Pw_-KAdcDFAUq&amp;amp;categoryId=AV5Pw_-KAdcDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Pw_-KAdcDFAUq&amp;amp;categoryId=AV5Pw_-KAdcDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;climits&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;algorithm&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;];
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; max &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; INT_MIN;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; min &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; INT_MAX;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;float&lt;/span&gt; sum &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
		
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; dataArray[i];

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			sum &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; dataArray[i];
			max &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;max(dataArray[i], max);
			min &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;min(dataArray[i], min);
		}

		sum &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; sum &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; min &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; max;

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;static_cast&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;((floor(((sum &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;8&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #6600EE; font-weight: bold&quot;&gt;0.5f&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;)) &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/606</guid>
      <comments>https://robodream.tistory.com/606#entry606comment</comments>
      <pubDate>Sat, 1 Dec 2018 15:14:29 +0900</pubDate>
    </item>
    <item>
      <title>1983. 조교의 성적 매기기</title>
      <link>https://robodream.tistory.com/605</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1983. 조교의 성적 매기기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PwGK6AcIDFAUq&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PwGK6AcIDFAUq&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;algorithm&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;vector&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;struct&lt;/span&gt; Data
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; number;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;float&lt;/span&gt; score;
};

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;Compare&lt;/span&gt;(&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;const&lt;/span&gt; Data&lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&lt;/span&gt; left, &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;const&lt;/span&gt; Data&lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&lt;/span&gt; right)
{
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; left.score &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; right.score;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;


	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n, k;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; k;

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;vector&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;Data&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; inputs(n);
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; n; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; mid, final, homework;
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; mid &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; final &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; homework;

			inputs[i].number &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
			inputs[i].score &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; mid &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #6600EE; font-weight: bold&quot;&gt;0.35f&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; final &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #6600EE; font-weight: bold&quot;&gt;0.45f&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; homework &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #6600EE; font-weight: bold&quot;&gt;0.2f&lt;/span&gt;;
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sort(inputs.begin(), inputs.end(), Compare);

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; answer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; n; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (inputs[i].number &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; k)
				answer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; i;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;switch&lt;/span&gt; ((answer &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; (n &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;)) &lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;)
		{
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; D0&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; C-&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; C0&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; C+&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; B-+&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; B0&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;6&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; B+&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;7&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; A-&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;8&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; A0&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;:
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; A+&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		}
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/605</guid>
      <comments>https://robodream.tistory.com/605#entry605comment</comments>
      <pubDate>Sat, 1 Dec 2018 14:59:47 +0900</pubDate>
    </item>
    <item>
      <title>1979. 어디에 단어가 들어갈 수 있을까</title>
      <link>https://robodream.tistory.com/604</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1979. 어디에 단어가 들어갈 수 있을까&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PuPq6AaQDFAUq&amp;amp;categoryId=AV5PuPq6AaQDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PuPq6AaQDFAUq&amp;amp;categoryId=AV5PuPq6AaQDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;

&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; nValue{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; }, wordLength{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; nValue &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; wordLength;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; dataArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[nValue&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;nValue]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; dataArray[nValue&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;i &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j];

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; answer{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)		&lt;span style=&quot;color: #888888&quot;&gt;//Row&lt;/span&gt;
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; checker{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; prevState &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;

			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;(dataArray &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; (nValue &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; i) &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j) &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
				{
					prevState &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
					checker&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
				}
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
					prevState &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;

				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;prevState &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; nValue &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
				{
					&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (checker &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; wordLength)
						answer&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
					checker &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
				}
			}
		}

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)		&lt;span style=&quot;color: #888888&quot;&gt;//Col&lt;/span&gt;
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; checker{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; prevState &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;

			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; nValue; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;(dataArray &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; (j&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;nValue)) &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
				{
					prevState &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
					checker&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
				}
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
					prevState &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;

				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;prevState &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; nValue &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
				{
					&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (checker &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; wordLength)
						answer&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
					checker &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
				}
			}
		}

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[] dataArray;

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; answer &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/604</guid>
      <comments>https://robodream.tistory.com/604#entry604comment</comments>
      <pubDate>Sat, 1 Dec 2018 02:37:00 +0900</pubDate>
    </item>
    <item>
      <title>1976. 시각 덧셈</title>
      <link>https://robodream.tistory.com/603</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1976. 시각 덧셈&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PttaaAZIDFAUq&amp;amp;categoryId=AV5PttaaAZIDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PttaaAZIDFAUq&amp;amp;categoryId=AV5PttaaAZIDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);
    
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; h1{}, m1{}, h2{}, m2{};

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; h1 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; m1 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; h2 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; m2;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; resulth &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; h1 &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; h2;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; resultm &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; m1 &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; m2;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; temp &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; resultm &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;60&lt;/span&gt;;
		resulth &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; temp;
		resultm &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; resultm &lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;60&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (resulth &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;12&lt;/span&gt;) resulth &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;12&lt;/span&gt;;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; resulth &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; resultm &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/603</guid>
      <comments>https://robodream.tistory.com/603#entry603comment</comments>
      <pubDate>Sat, 1 Dec 2018 02:13:29 +0900</pubDate>
    </item>
    <item>
      <title>1974. 스도쿠 검증</title>
      <link>https://robodream.tistory.com/602</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1974. 스도쿠 검증&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Psz16AYEDFAUq&amp;amp;categoryId=AV5Psz16AYEDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Psz16AYEDFAUq&amp;amp;categoryId=AV5Psz16AYEDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;가로 줄 체크, 세로 줄 체크, 정사각형 체크를 하되 하나라도 실패할 경우 바로 실패로 처리한다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cmath&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;climits&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;vector&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; board[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;][&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;];

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;checkerSquare&lt;/span&gt;(std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;pair&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; startPos)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; checker[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;];
	memset(checker, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;sizeof&lt;/span&gt;(checker));

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			checker[board[startPos.first &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j][startPos.second &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; i]] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;checker[i])
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;checkerRow&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; startPosY)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; checker[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;];
	memset(checker, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;sizeof&lt;/span&gt;(checker));

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		checker[board[i][startPosY]] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;checker[i])
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;checkerCol&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; startPosX)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; checker[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;];
	memset(checker, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;sizeof&lt;/span&gt;(checker));

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		checker[board[startPosX][i]] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;checker[i])
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
}


&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
	ios_base&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	cin.tie(&lt;span style=&quot;color: #007020&quot;&gt;NULL&lt;/span&gt;);
	cout.tie(&lt;span style=&quot;color: #007020&quot;&gt;NULL&lt;/span&gt;);
	&lt;span style=&quot;color: #888888&quot;&gt;//freopen(&quot;input.txt&quot;, &quot;r&quot;, stdin);&lt;/span&gt;

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;
	
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; board[j][i];

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; isOk &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;)
			{
				isOk &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; checkerSquare(std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;make_pair(j, i));
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;isOk) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			}
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;isOk) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
		}

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (isOk)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				isOk &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; checkerRow(i);
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;isOk) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			}
		}

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (isOk)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				isOk &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; checkerCol(i);
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333&quot;&gt;!&lt;/span&gt;isOk) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			}
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; isOk &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/602</guid>
      <comments>https://robodream.tistory.com/602#entry602comment</comments>
      <pubDate>Sat, 1 Dec 2018 02:10:40 +0900</pubDate>
    </item>
    <item>
      <title>1970. 쉬운 거스름돈</title>
      <link>https://robodream.tistory.com/601</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1970. 쉬운 거스름돈&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PsIl6AXIDFAUq&amp;amp;categoryId=AV5PsIl6AXIDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PsIl6AXIDFAUq&amp;amp;categoryId=AV5PsIl6AXIDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;그리디 알고리즘에 따라 큰 화폐로 먼져 나눠&amp;nbsp; 주고 그 다음 작은 화폐노 나눠주는것을 반복한다. 처음엔 막 썼지만 조금 더 깔끔하게 두 번쨰로 짜봤다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;첫 번째&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;unsigned&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; data{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; data;
		
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count50000{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count10000{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count5000{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count1000{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count500{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count100{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count50{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count10{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

		count50000 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; data &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;50000&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (count50000 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) data &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; count50000 &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;50000&lt;/span&gt;;
		
		count10000 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; data &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10000&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (count10000 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) data &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; count10000 &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10000&lt;/span&gt;;

		count5000 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; data &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5000&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (count5000 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) data &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; count5000 &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5000&lt;/span&gt;;

		count1000 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; data &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1000&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (count1000 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) data &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; count1000 &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1000&lt;/span&gt;;

		count500 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; data &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;500&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (count1000 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) data &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; count500 &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;500&lt;/span&gt;;

		count100 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; data &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (count100 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) data &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; count100 &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100&lt;/span&gt;;

		count50 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; data &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;50&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (count50 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) data &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; count50 &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;50&lt;/span&gt;;

		count10 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; data &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (count10 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) data &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; count10 &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; count50000 &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; count10000 
			&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; count5000 &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; count1000 &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; count500 &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; count100 &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; count50 &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; count10 &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;

	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;두 번째&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; money[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;8&lt;/span&gt;]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;50000&lt;/span&gt;,&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10000&lt;/span&gt;,&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5000&lt;/span&gt;,&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1000&lt;/span&gt;,&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;500&lt;/span&gt;,&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100&lt;/span&gt;,&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;50&lt;/span&gt;,&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt; };

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);
	
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case, T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; result[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;8&lt;/span&gt;];
		memset(result, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;sizeof&lt;/span&gt;(result));

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; input;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;8&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (input &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (money[i] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; input)
			{
				result[i] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; money[i];
				input &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt; money[i];
			}

		}
	
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;8&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; result[i] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/601</guid>
      <comments>https://robodream.tistory.com/601#entry601comment</comments>
      <pubDate>Sat, 1 Dec 2018 02:04:04 +0900</pubDate>
    </item>
    <item>
      <title>1966. 숫자를 정렬하자</title>
      <link>https://robodream.tistory.com/600</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1966. 숫자를 정렬하자&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PrmyKAWEDFAUq&amp;amp;categoryId=AV5PrmyKAWEDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PrmyKAWEDFAUq&amp;amp;categoryId=AV5PrmyKAWEDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;버블 소트를 직접 구현하여 풀었다. 하지만 사실 std::sort를 사용하는것이 제일 빠르다 버블소트는 O(n^2)인데 std::sort는 O(nlongn)이다. 하지만 Container를 사용하는 것&amp;nbsp;보다는 배열이 더 빠른경우가 많다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;첫 번째&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;Swap&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;left, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;right)			
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; temp;
	temp &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;right;
	&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;right &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;left;
	&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;left &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; temp;
}


&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;BubbleSort&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;targetArray, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; length)					
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; change &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;										
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; pass &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; pass &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; length &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; pass&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)				
	{
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; length &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; pass &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)				
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (targetArray[i] &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; targetArray[i &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;])
			{
				Swap(&lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&lt;/span&gt;targetArray[i], &lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&lt;/span&gt;targetArray[i &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;]);
				change &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
			}
		}
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (change &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt;;
	}
}
&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; length;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; length;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; dataArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[length] {&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; length; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;) std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; dataArray[i];
		
		BubbleSort(dataArray, length);


		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; length; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; dataArray[i] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;

	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;두 번째&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;algorithm&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;vector&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;ios&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sync_with_stdio(&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin.tie(nullptr);
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.tie(nullptr);

	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;vector&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; vec(n);

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; n; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; vec[i];

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;sort(vec.begin(), vec.end());
		
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; n; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; vec[i] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;

	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/600</guid>
      <comments>https://robodream.tistory.com/600#entry600comment</comments>
      <pubDate>Sat, 1 Dec 2018 01:30:27 +0900</pubDate>
    </item>
    <item>
      <title>1961. 숫자 배열 회전</title>
      <link>https://robodream.tistory.com/599</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1961. 숫자 배열 회전&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Pq-OKAVYDFAUq&amp;amp;categoryId=AV5Pq-OKAVYDFAUq&amp;amp;categoryType=CODE&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; input;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; original &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; original[i&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j];

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; degree90 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)			&lt;span style=&quot;color: #888888&quot;&gt;//90deg&lt;/span&gt;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				degree90[input &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; j] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; original[i&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j];
		
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; degree180 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };
		
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)	&lt;span style=&quot;color: #888888&quot;&gt;//180deg&lt;/span&gt;
			degree180[i] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; original[input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; i];
		
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; degree270 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)			&lt;span style=&quot;color: #888888&quot;&gt;//270deg&lt;/span&gt;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;input; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				degree270[input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;(input&lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)&lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt;i &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;j] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; original[i&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j];

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; degree90[j &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; i];
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; degree180[j &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; i];
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; degree270[j &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; i];
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		}
			

	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/599</guid>
      <comments>https://robodream.tistory.com/599#entry599comment</comments>
      <pubDate>Sat, 1 Dec 2018 01:23:38 +0900</pubDate>
    </item>
    <item>
      <title>1959. 두 개의 숫자열</title>
      <link>https://robodream.tistory.com/598</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1959. 두 개의 숫자열&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PpoFaAS4DFAUq&amp;amp;categoryId=AV5PpoFaAS4DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PpoFaAS4DFAUq&amp;amp;categoryId=AV5PpoFaAS4DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;길이가 더 긴 배열을 고정시키고 짧은 배열을 움직여가면서 곱을 구해 그중에 최대 값을 구한다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; firstSize{};
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; secondSize{};

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; firstSize &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; secondSize;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; firstArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[firstSize] {&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; secondArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[secondSize] {&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; firstSize; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; firstArray[i];
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; secondSize; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;) std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; secondArray[i];

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; shortArray{ nullptr };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; longArray{ nullptr };

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; shortSize{};
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; longSize{};

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (firstSize &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; secondSize)
		{
			shortArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; secondArray;
			longArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; firstArray;
			shortSize &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; secondSize;
			longSize &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; firstSize;
		}
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
		{
			longArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; secondArray;
			shortArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; firstArray;
			shortSize &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; firstSize;
			longSize &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; secondSize;
		}

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; max{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; longSize &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; shortSize &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; sum{};
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; shortSize; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				sum &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; longArray[j] &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; shortArray[j];
			
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (sum &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; max)
				max &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; sum;
			longArray&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; max &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[] firstArray;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[] secondArray;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/598</guid>
      <comments>https://robodream.tistory.com/598#entry598comment</comments>
      <pubDate>Sat, 1 Dec 2018 01:20:01 +0900</pubDate>
    </item>
    <item>
      <title>1954. 달팽이 숫자</title>
      <link>https://robodream.tistory.com/597</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1954. 달팽이 숫자&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PobmqAPoDFAUq&amp;amp;categoryId=AV5PobmqAPoDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PobmqAPoDFAUq&amp;amp;categoryId=AV5PobmqAPoDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;배열 크기를 지정해두고 왼쪽 위에서 부터 오른쪽으로 시작하여 끝에 도달하면 시계 방향 90도로 꺽어 진행하도록 하였다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;
&lt;span style=&quot;color: #888888&quot;&gt;//north :0 East :1 south :2 West :3&lt;/span&gt;
&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;moveTo&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; current, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; size, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; direction)
{
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;switch&lt;/span&gt; (direction)
	{
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;:
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; current &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; size;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;:
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; current &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;:
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; current &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; size;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;:
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; current &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
	}
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; nullptr;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; input;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; direction &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; dataArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[input&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; pointer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&lt;/span&gt;dataArray[input &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;];
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; inputData &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			dataArray[i] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;--&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; i; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				pointer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; moveTo(pointer, input, direction);
				&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;pointer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; inputData;
				inputData&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
			}

			direction &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; direction &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;?&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;:&lt;/span&gt; direction &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;

			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; i; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				pointer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; moveTo(pointer, input, direction);
				&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;pointer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; inputData;
				inputData&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
			}

			direction &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; direction &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;?&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;:&lt;/span&gt; direction &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; input; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; dataArray[i &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		}

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[] dataArray;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/597</guid>
      <comments>https://robodream.tistory.com/597#entry597comment</comments>
      <pubDate>Sat, 1 Dec 2018 01:13:03 +0900</pubDate>
    </item>
    <item>
      <title>1948. 날짜 계산기</title>
      <link>https://robodream.tistory.com/596</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1948. 날짜 계산기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PnnU6AOsDFAUq&amp;amp;categoryId=AV5PnnU6AOsDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PnnU6AOsDFAUq&amp;amp;categoryId=AV5PnnU6AOsDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;MonthDay&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; month)
{
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;switch&lt;/span&gt; (month)
	{
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;7&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;8&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;12&lt;/span&gt;:
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;31&lt;/span&gt;;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;6&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;:
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;11&lt;/span&gt;:
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;30&lt;/span&gt;;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;:
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;28&lt;/span&gt;;
	}
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; month1{}, day1{}, month2{}, day2{};
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; result{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; month1 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; day1 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; month2 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; day2;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (month1 &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; month2)
			result &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; day2 &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; day1 &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
		{
			result &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; MonthDay(month1) &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; day1 &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; month1 &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; month2; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				result &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; MonthDay(i);
			result &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; day2;
		}


		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;result &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;

	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/596</guid>
      <comments>https://robodream.tistory.com/596#entry596comment</comments>
      <pubDate>Sat, 1 Dec 2018 00:58:03 +0900</pubDate>
    </item>
    <item>
      <title>1946. 간단한 압축 풀기</title>
      <link>https://robodream.tistory.com/595</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1946. 간단한 압축 풀기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PmkDKAOMDFAUq&amp;amp;categoryId=AV5PmkDKAOMDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PmkDKAOMDFAUq&amp;amp;categoryId=AV5PmkDKAOMDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; count{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; index{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; count;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; result &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;[(count &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; count; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; str;
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; strCount;
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; str &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; strCount;

			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; strCount; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			{
				result[index] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; str;
				index&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
			}
		}
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;// &amp;lt;&amp;lt; a &amp;lt;&amp;lt; &quot; &quot; &amp;lt;&amp;lt; b &amp;lt;&amp;lt; &quot; &quot; &amp;lt;&amp;lt; c &amp;lt;&amp;lt; &quot; &quot; &amp;lt;&amp;lt; d &amp;lt;&amp;lt; &quot; &quot; &amp;lt;&amp;lt; e &amp;lt;&amp;lt; &quot;\n&quot;;&lt;/span&gt;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; index &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;; j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; result[i &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; j];
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
		}

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; (index &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;)); i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; index; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; result[i];
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/595</guid>
      <comments>https://robodream.tistory.com/595#entry595comment</comments>
      <pubDate>Sat, 1 Dec 2018 00:49:36 +0900</pubDate>
    </item>
    <item>
      <title>1945. 간단한 소인수분해</title>
      <link>https://robodream.tistory.com/594</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1945. 간단한 소인수분해&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Pl0Q6ANQDFAUq&amp;amp;categoryId=AV5Pl0Q6ANQDFAUq&amp;amp;categoryType=CODE&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;주어진 숫자를 큰 숫자부터 나눠본다 나눠지지 않으면 그 다음 숫자를 이용하여 나눠준다&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;returnValue&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&lt;/span&gt;origin, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; target)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; retval{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };&lt;span style=&quot;color: #888888&quot;&gt;// = origin / target;    50  5&lt;/span&gt;
	
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;while&lt;/span&gt; (origin &lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt; target &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;)
	{
		origin &lt;span style=&quot;color: #333333&quot;&gt;/=&lt;/span&gt; target;
		retval&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; retval;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; input;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; a, b, c, d, e;

		e &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; returnValue(input, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;11&lt;/span&gt;);
		d &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; returnValue(input, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;7&lt;/span&gt;);
		c &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; returnValue(input, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5&lt;/span&gt;);
		b &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; returnValue(input, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;);
		a &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; returnValue(input, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;);

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; a &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; b &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; d &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; e &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/594</guid>
      <comments>https://robodream.tistory.com/594#entry594comment</comments>
      <pubDate>Sat, 1 Dec 2018 00:38:01 +0900</pubDate>
    </item>
    <item>
      <title>1940. 가랏! RC카!</title>
      <link>https://robodream.tistory.com/593</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;1940. 가랏! RC카!&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PjMgaALgDFAUq&amp;amp;categoryId=AV5PjMgaALgDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PjMgaALgDFAUq&amp;amp;categoryId=AV5PjMgaALgDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; command{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; command;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; commandType{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; value{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; currentVecocity{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; distance{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; command; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; commandType;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (commandType &lt;span style=&quot;color: #333333&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;)
				std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; value;

			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;switch&lt;/span&gt; (commandType)
			{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;:
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;:
					currentVecocity &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; value;
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;:
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (currentVecocity &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; value &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;)
					currentVecocity &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
					currentVecocity &lt;span style=&quot;color: #333333&quot;&gt;-=&lt;/span&gt; value;
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			}

			distance &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; currentVecocity;
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; distance &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/593</guid>
      <comments>https://robodream.tistory.com/593#entry593comment</comments>
      <pubDate>Sat, 1 Dec 2018 00:33:46 +0900</pubDate>
    </item>
    <item>
      <title>1928. Base64 Decoder</title>
      <link>https://robodream.tistory.com/592</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1928. Base64 Decoder&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PR4DKAG0DFAUq&amp;amp;categoryId=AV5PR4DKAG0DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PR4DKAG0DFAUq&amp;amp;categoryId=AV5PR4DKAG0DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;SixbitConverterCharToInt&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; c)
{
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;57&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;;		&lt;span style=&quot;color: #888888&quot;&gt;//1&lt;/span&gt;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;90&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;65&lt;/span&gt;;		&lt;span style=&quot;color: #888888&quot;&gt;//A&lt;/span&gt;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;97&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;122&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; c &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;71&lt;/span&gt;;		&lt;span style=&quot;color: #888888&quot;&gt;//a&lt;/span&gt;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (c &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;47&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;62&lt;/span&gt;;						&lt;span style=&quot;color: #888888&quot;&gt;// +&lt;/span&gt;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (c &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;43&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;63&lt;/span&gt;;						&lt;span style=&quot;color: #888888&quot;&gt;// / &lt;/span&gt;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
}


&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;Convert&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; encoded, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; decoded)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		dataArray[i] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; SixbitConverterCharToInt(encoded[i]);

	decoded[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;)((dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; (dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;));
	decoded[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;)((dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; (dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;));
	decoded[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;)((dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;6&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; (dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;]));
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; string[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100000&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;];
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; string;
	
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; pointer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; string;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; length &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; strlen(string);

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; length &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; read[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;]{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, };
			Convert(pointer, read);
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; read;
			pointer &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;;
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/592</guid>
      <comments>https://robodream.tistory.com/592#entry592comment</comments>
      <pubDate>Sat, 1 Dec 2018 00:24:57 +0900</pubDate>
    </item>
    <item>
      <title>1288. 새로운 불면증 치료법</title>
      <link>https://robodream.tistory.com/591</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1288. 새로운 불면증 치료법&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV18_yw6I9MCFAZN&amp;amp;categoryId=AV18_yw6I9MCFAZN&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV18_yw6I9MCFAZN&amp;amp;categoryId=AV18_yw6I9MCFAZN&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;처음 입력된 숫자로 부터 각 자리의 숫자들을 result 배열을 이용하여 true 체크를 하고 0~9까지 모두 true일때에 답을 구한다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;isAllExist&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; result)
{
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (result[i] &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;**&lt;/span&gt; argv)
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; test_case;
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; T;
	cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; T;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (test_case &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; T; &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;test_case)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; nValue;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; nValue;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; result[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;];
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; iterator{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; answer{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;) result[i] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;while&lt;/span&gt; (&lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; number &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; nValue &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; iterator;
			answer&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;while&lt;/span&gt; (number &lt;span style=&quot;color: #333333&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;)
			{
				result[number &lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;] &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
				number &lt;span style=&quot;color: #333333&quot;&gt;/=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;
			}

			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (isAllExist(result))
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
				iterator&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; test_case &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; nValue &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; iterator &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}
	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;&lt;span style=&quot;color: #888888&quot;&gt;//정상종료시 반드시 0을 리턴해야합니다.&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/591</guid>
      <comments>https://robodream.tistory.com/591#entry591comment</comments>
      <pubDate>Sat, 1 Dec 2018 00:10:06 +0900</pubDate>
    </item>
    <item>
      <title>1285. 아름이의 돌 던지기</title>
      <link>https://robodream.tistory.com/590</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1285. 아름이의 돌 던지기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV18-stqI8oCFAZN&amp;amp;categoryId=AV18-stqI8oCFAZN&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV18-stqI8oCFAZN&amp;amp;categoryId=AV18-stqI8oCFAZN&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;처음엔 절대값이 가장 작은 값을 찾은 다음 그 값의 개수를 세어 답을 구했다 하지만&amp;nbsp; 전체를 다시 훑어 보는 것 보단 배열 하나를 두어 저장을 하고 인덱스를 증가 시키면서 가장 먼져 만나는 0이 아닌 값을 찾는 것이&amp;nbsp;나은거 같다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;첫 번째&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cmath&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; n; testCase&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; peopleCount;
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;peopleCount;
        
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; dataArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[peopleCount];
        
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; min{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100000&lt;/span&gt;};
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;peopleCount ;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        {
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;dataArray[i];
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(abs(dataArray[i]) &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;min)
                min &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; abs(dataArray[i]);
        }
            
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; answer{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;peopleCount ;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(abs(dataArray[i]) &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;min)
                answer&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; min&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;answer &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[]  dataArray;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;두 번쨰&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cmath&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;cstring&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; n; testCase&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; peopleCount;
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; peopleCount;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100000&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;];
		memset(dataArray, &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;sizeof&lt;/span&gt;(dataArray));
		
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; peopleCount; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input;
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; input;
			dataArray[abs(input)]&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;;
		}

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; answer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;, min &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100000&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (dataArray[i] &lt;span style=&quot;color: #333333&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;)
			{
				answer &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; dataArray[i];
				min &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; i;
				&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
			}
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; min &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; answer &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/590</guid>
      <comments>https://robodream.tistory.com/590#entry590comment</comments>
      <pubDate>Fri, 30 Nov 2018 23:58:40 +0900</pubDate>
    </item>
    <item>
      <title>1284. 수도 요금 경쟁</title>
      <link>https://robodream.tistory.com/589</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1284. 수도 요금 경쟁&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV189xUaI8UCFAZN&amp;amp;categoryId=AV189xUaI8UCFAZN&amp;amp;categoryType=CODE&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; n; testCase&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; p,q,r,s,w;
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;p&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;q&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;r&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;s&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;w;
        
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; value1 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; p &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; w;
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; value2;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(w&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;r)
            value2 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; q;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
            value2 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; q &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; s&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;(w&lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;r);
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; (value1&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;value2 &lt;span style=&quot;color: #333333&quot;&gt;?&lt;/span&gt; value1 &lt;span style=&quot;color: #333333&quot;&gt;:&lt;/span&gt; value2)&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/589</guid>
      <comments>https://robodream.tistory.com/589#entry589comment</comments>
      <pubDate>Fri, 30 Nov 2018 23:04:23 +0900</pubDate>
    </item>
    <item>
      <title>1204. [S/W 문제해결 기본] 1일차 - 최빈수 구하기</title>
      <link>https://robodream.tistory.com/588</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1204. [S/W 문제해결 기본] 1일차 - 최빈수 구하기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV13zo1KAAACFAYh&amp;amp;categoryId=AV13zo1KAAACFAYh&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV13zo1KAAACFAYh&amp;amp;categoryId=AV13zo1KAAACFAYh&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;각 케이스마다 점수가 등장할 때 마다 그 점수에 해당하는 배열칸에 숫자를 증가시킨 뒤에 배열 중에서 가장 큰 숫자를 찾아내어 답을 구한다.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n;

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;; testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt; n; testCase&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
	{
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; caseNumber{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; caseNumber;
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; dataArray[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;];
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;101&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;) dataArray[i] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input;
		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1000&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; input;
			dataArray[input] &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;
		}

		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; maxValue{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };
		&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; maxIndex{ &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; };

		&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;101&lt;/span&gt;; i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
		{
			&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (dataArray[i] &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;=&lt;/span&gt; maxValue)
			{
				maxIndex &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; i;
				maxValue &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; dataArray[i];
			}
		}

		std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; maxIndex &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
	}

	&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D2</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/588</guid>
      <comments>https://robodream.tistory.com/588#entry588comment</comments>
      <pubDate>Fri, 30 Nov 2018 22:59:01 +0900</pubDate>
    </item>
    <item>
      <title>2072. 홀수만 더하기</title>
      <link>https://robodream.tistory.com/587</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2072. 홀수만 더하기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QSEhaA5sDFAUq&amp;amp;categoryId=AV5QSEhaA5sDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QSEhaA5sDFAUq&amp;amp;categoryId=AV5QSEhaA5sDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;math.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;
     
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt;n;testCase &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;float&lt;/span&gt; sum{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        {
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(input&lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;) sum&lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt;input;
        }
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;testCase&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sum &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    }
     
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/587</guid>
      <comments>https://robodream.tistory.com/587#entry587comment</comments>
      <pubDate>Fri, 30 Nov 2018 22:34:09 +0900</pubDate>
    </item>
    <item>
      <title>2071. 평균값 구하기</title>
      <link>https://robodream.tistory.com/586</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;2071. 평균값 구하기&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QRnJqA5cDFAUq&amp;amp;categoryId=AV5QRnJqA5cDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QRnJqA5cDFAUq&amp;amp;categoryId=AV5QRnJqA5cDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;math.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;
     
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt;n;testCase &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;float&lt;/span&gt; sum{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        {
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
            sum &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt;input;
        }
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;testCase&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; floor((sum&lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #6600EE; font-weight: bold&quot;&gt;0.5&lt;/span&gt;) &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    }
     
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/586</guid>
      <comments>https://robodream.tistory.com/586#entry586comment</comments>
      <pubDate>Fri, 30 Nov 2018 22:32:56 +0900</pubDate>
    </item>
    <item>
      <title>2070. 큰 놈, 작은 놈, 같은 놈</title>
      <link>https://robodream.tistory.com/585</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;h3 class=&quot;problem_title&quot; style=&quot;box-sizing: inherit; padding: 0px; margin: 0px; font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; line-height: 17px; color: rgb(51, 51, 51); font-size: 23px; border: 0px; outline: 0px; list-style-type: none; text-align: left;&quot;&gt;2070. 큰 놈, 작은 놈, 같은 놈&lt;/h3&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QQ6qqA40DFAUq&amp;amp;categoryId=AV5QQ6qqA40DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QQ6qqA40DFAUq&amp;amp;categoryId=AV5QQ6qqA40DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt;n;testCase &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
       	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input1{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;},input2{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input2;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(input1&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;input2)
	        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;testCase&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&amp;gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(input1&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;input2)
	        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;testCase&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&amp;lt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt; 
	        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;testCase&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;=&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/585</guid>
      <comments>https://robodream.tistory.com/585#entry585comment</comments>
      <pubDate>Fri, 30 Nov 2018 22:28:13 +0900</pubDate>
    </item>
    <item>
      <title>2068. 최대수 구하기</title>
      <link>https://robodream.tistory.com/584</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2068. 최대수 구하기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QQhbqA4QDFAUq&amp;amp;categoryId=AV5QQhbqA4QDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QQhbqA4QDFAUq&amp;amp;categoryId=AV5QQhbqA4QDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;testCase &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt;n;testCase &lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; max{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;) 
        {
            &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(max&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;input)
                max &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input;
        }
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;testCase&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;max&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/584</guid>
      <comments>https://robodream.tistory.com/584#entry584comment</comments>
      <pubDate>Fri, 30 Nov 2018 22:25:32 +0900</pubDate>
    </item>
    <item>
      <title>2063. 중간값 찾기</title>
      <link>https://robodream.tistory.com/583</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2063. 중간값 찾기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QPsXKA2UDFAUq&amp;amp;categoryId=AV5QPsXKA2UDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QPsXKA2UDFAUq&amp;amp;categoryId=AV5QPsXKA2UDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;보통은 std::sort를 활용하여 정렬을 하지만 qsort를 활용하여 풀어보았다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;compare&lt;/span&gt;(&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;a, &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;b)    &lt;span style=&quot;color: #888888&quot;&gt;// 오름차순 비교 함수 구현&lt;/span&gt;
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; num1 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;)a;    &lt;span style=&quot;color: #888888&quot;&gt;// void 포인터를 int 포인터로 변환한 뒤 역참조하여 값을 가져옴&lt;/span&gt;
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; num2 &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;)b;    &lt;span style=&quot;color: #888888&quot;&gt;// void 포인터를 int 포인터로 변환한 뒤 역참조하여 값을 가져옴&lt;/span&gt;

    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (num1 &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; num2)    &lt;span style=&quot;color: #888888&quot;&gt;// a가 b보다 작을 때는&lt;/span&gt;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;      &lt;span style=&quot;color: #888888&quot;&gt;// -1 반환&lt;/span&gt;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt; (num1 &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; num2)    &lt;span style=&quot;color: #888888&quot;&gt;// a가 b보다 클 때는&lt;/span&gt;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;       &lt;span style=&quot;color: #888888&quot;&gt;// 1 반환&lt;/span&gt;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;    &lt;span style=&quot;color: #888888&quot;&gt;// a와 b가 같을 때는 0 반환&lt;/span&gt;
}

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input {&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
    
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; dataArray &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;[input];
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;input;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;dataArray[i];
    
    qsort(dataArray, input, &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;sizeof&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;), compare);
    
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;dataArray[input&lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;]&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;input;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;dataArray[i]&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0044DD&quot;&gt;' '&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;delete&lt;/span&gt;[] dataArray;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/583</guid>
      <comments>https://robodream.tistory.com/583#entry583comment</comments>
      <pubDate>Fri, 30 Nov 2018 22:10:45 +0900</pubDate>
    </item>
    <item>
      <title>2058. 자릿수 더하기</title>
      <link>https://robodream.tistory.com/582</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2058. 자릿수 더하기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QPRjqA10DFAUq&amp;amp;categoryId=AV5QPRjqA10DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QPRjqA10DFAUq&amp;amp;categoryId=AV5QPRjqA10DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; sum{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
        sum &lt;span style=&quot;color: #333333&quot;&gt;+=&lt;/span&gt; (input&lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;);
        input &lt;span style=&quot;color: #333333&quot;&gt;/=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;;
    }
    
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;sum&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/582</guid>
      <comments>https://robodream.tistory.com/582#entry582comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:52:57 +0900</pubDate>
    </item>
    <item>
      <title>2056. 연월일 달력</title>
      <link>https://robodream.tistory.com/581</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2056. 연월일 달력&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QLkdKAz4DFAUq&amp;amp;categoryId=AV5QLkdKAz4DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QLkdKAz4DFAUq&amp;amp;categoryId=AV5QLkdKAz4DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; testCase &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; ; testCase&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt;n ; testCase&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;bool&lt;/span&gt; isValid &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;true&lt;/span&gt;;
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
        
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; year &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10000&lt;/span&gt;;
        input &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; (year &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10000&lt;/span&gt;);
        
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; month &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input &lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100&lt;/span&gt;;
        input &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; input&lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;100&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(month &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt; month &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;12&lt;/span&gt;) 
            isValid &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;
        
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;switch&lt;/span&gt;(month)
        {
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;7&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;8&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;10&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;12&lt;/span&gt;:
                &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(input&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;31&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt; input&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
                    isValid &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;
                &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;6&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;9&lt;/span&gt;:
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;11&lt;/span&gt;:
                &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(input&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;30&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt; input&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
                    isValid &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;
                &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;:
                &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(input&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;28&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt; input&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
                    isValid &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020&quot;&gt;false&lt;/span&gt;;
                &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;break&lt;/span&gt;;
        }
        
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;testCase&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(isValid)
        {
            &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(year&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1000&lt;/span&gt;)
            {
                std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.width(&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;4&lt;/span&gt;);
                std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.fill(&lt;span style=&quot;color: #0044DD&quot;&gt;'0'&lt;/span&gt;);
            }
        	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;year&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0044DD&quot;&gt;'/'&lt;/span&gt;;
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.width(&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;);
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.fill(&lt;span style=&quot;color: #0044DD&quot;&gt;'0'&lt;/span&gt;);
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;month&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0044DD&quot;&gt;'/'&lt;/span&gt;;
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.width(&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;);
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout.fill(&lt;span style=&quot;color: #0044DD&quot;&gt;'0'&lt;/span&gt;);
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
        }
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt;
           	std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/581</guid>
      <comments>https://robodream.tistory.com/581#entry581comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:52:02 +0900</pubDate>
    </item>
    <item>
      <title>2050. 알파벳을 숫자로 변환</title>
      <link>https://robodream.tistory.com/580</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2050. 알파벳을 숫자로 변환&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QLGxKAzQDFAUq&amp;amp;categoryId=AV5QLGxKAzQDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QLGxKAzQDFAUq&amp;amp;categoryId=AV5QLGxKAzQDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;

&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; input[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;200&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;];
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
    
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; length &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; strlen(input);
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;length;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;static_cast&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;(input[i] &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;64&lt;/span&gt;)&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/580</guid>
      <comments>https://robodream.tistory.com/580#entry580comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:48:02 +0900</pubDate>
    </item>
    <item>
      <title>2047. 신문 헤드라인</title>
      <link>https://robodream.tistory.com/579</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2047. 신문 헤드라인&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QKsLaAy0DFAUq&amp;amp;categoryId=AV5QKsLaAy0DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QKsLaAy0DFAUq&amp;amp;categoryId=AV5QKsLaAy0DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;toupper 함수를 사용하여 직접 올려도 상관없으나 직접 구현을 해보았다&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;checker&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; c)
{
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;static_cast&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;(c) &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;97&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;static_cast&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt;(c) &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;122&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; c;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; c&lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;32&lt;/span&gt;;
}
&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
	&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;char&lt;/span&gt; input[&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;80&lt;/span&gt; &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;];
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
    
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; length &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; strlen(input);

    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;length;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        input[i] &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; checker(input[i]);
    
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/579</guid>
      <comments>https://robodream.tistory.com/579#entry579comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:44:00 +0900</pubDate>
    </item>
    <item>
      <title>2046. 스탬프 찍기</title>
      <link>https://robodream.tistory.com/578</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2046. 스탬프 찍기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QKdT6AyYDFAUq&amp;amp;categoryId=AV5QKdT6AyYDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QKdT6AyYDFAUq&amp;amp;categoryId=AV5QKdT6AyYDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;input;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;) std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;;
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/578</guid>
      <comments>https://robodream.tistory.com/578#entry578comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:39:53 +0900</pubDate>
    </item>
    <item>
      <title>2043. 서랍의 비밀번호</title>
      <link>https://robodream.tistory.com/577</link>
      <description>&lt;p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2043. 서랍의 비밀번호&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QJ_8KAx8DFAUq&amp;amp;categoryId=AV5QJ_8KAx8DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QJ_8KAx8DFAUq&amp;amp;categoryId=AV5QJ_8KAx8DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; inputK{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;},inputP{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;inputK&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;inputP;
    
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;inputK &lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt; inputP &lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;endl;
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/577</guid>
      <comments>https://robodream.tistory.com/577#entry577comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:37:17 +0900</pubDate>
    </item>
    <item>
      <title>2029. 몫과 나머지 출력하기</title>
      <link>https://robodream.tistory.com/576</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2029. 몫과 나머지 출력하기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QGNvKAtEDFAUq&amp;amp;categoryId=AV5QGNvKAtEDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QGNvKAtEDFAUq&amp;amp;categoryId=AV5QGNvKAtEDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; inputCase {&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;inputCase;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt;inputCase;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input1{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;},input2{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input2;
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;i &lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt;input2&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt;input2&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/576</guid>
      <comments>https://robodream.tistory.com/576#entry576comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:35:08 +0900</pubDate>
    </item>
    <item>
      <title>2027. 대각선 출력하기</title>
      <link>https://robodream.tistory.com/575</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#333333&quot; face=&quot;Malgun Gothic, ���� ���, Helvetica Neue, Helvetica, Arial, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 23px;&quot;&gt;&lt;b&gt;2027. 대각선 출력하기&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;문제출처:&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QFuZ6As0DFAUq&amp;amp;categoryId=AV5QFuZ6As0DFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QFuZ6As0DFAUq&amp;amp;categoryId=AV5QFuZ6As0DFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;j&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;i;j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;) std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;+&quot;&lt;/span&gt;;
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;#&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; j&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;i&lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;j&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;5&lt;/span&gt;;j&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;) std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;+&quot;&lt;/span&gt;;
         std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/575</guid>
      <comments>https://robodream.tistory.com/575#entry575comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:14:20 +0900</pubDate>
    </item>
    <item>
      <title>2025. N줄덧셈</title>
      <link>https://robodream.tistory.com/574</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;2025. N줄덧셈&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QFZtaAscDFAUq&amp;amp;categoryId=AV5QFZtaAscDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QFZtaAscDFAUq&amp;amp;categoryId=AV5QFZtaAscDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;가우스 합 사용&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
    
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input &lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;(input&lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)&lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/574</guid>
      <comments>https://robodream.tistory.com/574#entry574comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:12:20 +0900</pubDate>
    </item>
    <item>
      <title>1938. 아주 간단한 계산기</title>
      <link>https://robodream.tistory.com/573</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1545. 거꾸로 출력해 보아요&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PjsYKAMIDFAUq&amp;amp;categoryId=AV5PjsYKAMIDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PjsYKAMIDFAUq&amp;amp;categoryId=AV5PjsYKAMIDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input1{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;},input2{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input2;
    
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt;input2&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;-&lt;/span&gt;input2&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;*&lt;/span&gt;input2&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;input1&lt;span style=&quot;color: #333333&quot;&gt;/&lt;/span&gt;input2&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/573</guid>
      <comments>https://robodream.tistory.com/573#entry573comment</comments>
      <pubDate>Fri, 30 Nov 2018 21:01:36 +0900</pubDate>
    </item>
    <item>
      <title>1933. 간단한 N 의 약수</title>
      <link>https://robodream.tistory.com/572</link>
      <description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#333333&quot; face=&quot;Malgun Gothic, ���� ���, Helvetica Neue, Helvetica, Arial, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 23px;&quot;&gt;&lt;b&gt;1933. 간단한 N 의 약수&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PhcWaAKIDFAUq&amp;amp;categoryId=AV5PhcWaAKIDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PhcWaAKIDFAUq&amp;amp;categoryId=AV5PhcWaAKIDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;=&lt;/span&gt;input;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(input &lt;span style=&quot;color: #333333&quot;&gt;%&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;)
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/572</guid>
      <comments>https://robodream.tistory.com/572#entry572comment</comments>
      <pubDate>Fri, 30 Nov 2018 20:59:25 +0900</pubDate>
    </item>
    <item>
      <title>1936. 1대1 가위바위보</title>
      <link>https://robodream.tistory.com/571</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#333333&quot; face=&quot;Malgun Gothic, ���� ���, Helvetica Neue, Helvetica, Arial, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 23px;&quot;&gt;&lt;b&gt;1936. 1대1 가위바위보&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PjKXKALcDFAUq&amp;amp;categoryId=AV5PjKXKALcDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PjKXKALcDFAUq&amp;amp;categoryId=AV5PjKXKALcDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; inputA{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;}, inputB{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;inputA&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;inputB;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputA&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputB&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;)
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;B&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputB&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;)
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;A&quot;&lt;/span&gt;;
    }
     &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputA&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;)&lt;span style=&quot;color: #888888&quot;&gt;//가위 1 바위 2 보 3&lt;/span&gt;
    {
          &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputB&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;A&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputB&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;)
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;B&quot;&lt;/span&gt;;
    }
     &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputA&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;3&lt;/span&gt;)
    {
          &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputB&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;)
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;B&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;if&lt;/span&gt;(inputB&lt;span style=&quot;color: #333333&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;)
            std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;A&quot;&lt;/span&gt;;
    }
    
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-weight: bold; background-color: #fff0f0&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot;&lt;/span&gt;;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/571</guid>
      <comments>https://robodream.tistory.com/571#entry571comment</comments>
      <pubDate>Fri, 30 Nov 2018 20:49:41 +0900</pubDate>
    </item>
    <item>
      <title>2019. 더블더블</title>
      <link>https://robodream.tistory.com/570</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#333333&quot; face=&quot;Malgun Gothic, ���� ���, Helvetica Neue, Helvetica, Arial, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 23px;&quot;&gt;&lt;b&gt;2019. 더블더블&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;문제출처:&amp;nbsp;&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QDEX6AqwDFAUq&amp;amp;categoryId=AV5QDEX6AqwDFAUq&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QDEX6AqwDFAUq&amp;amp;categoryId=AV5QDEX6AqwDFAUq&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; first{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;};
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; input{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;input;
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;span style=&quot;color: #333333&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #333333&quot;&gt;++&lt;/span&gt;)
    {
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;first&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
        first &lt;span style=&quot;color: #333333&quot;&gt;*=&lt;/span&gt;&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;2&lt;/span&gt;;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/570</guid>
      <comments>https://robodream.tistory.com/570#entry570comment</comments>
      <pubDate>Fri, 30 Nov 2018 20:47:23 +0900</pubDate>
    </item>
    <item>
      <title>1545. 거꾸로 출력해 보아요</title>
      <link>https://robodream.tistory.com/569</link>
      <description>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;1545. 거꾸로 출력해 보아요&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;���� ���&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 23px; text-align: center;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;문제출처:&lt;a href=&quot;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV2gbY0qAAQBBAS0&amp;amp;categoryId=AV2gbY0qAAQBBAS0&amp;amp;categoryType=CODE&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV2gbY0qAAQBBAS0&amp;amp;categoryId=AV2gbY0qAAQBBAS0&amp;amp;categoryType=CODE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;풀이 방법&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;lt;코드&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;

&lt;!-- HTML generated using hilite.me --&gt;&lt;div style=&quot;background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;&quot;&gt;&lt;pre style=&quot;margin: 0; line-height: 125%&quot;&gt;&lt;span style=&quot;color: #557799&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066BB; font-weight: bold&quot;&gt;main&lt;/span&gt;()
{
    &lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; n{&lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;};
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cin&lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333&quot;&gt;=&lt;/span&gt; n ; i &lt;span style=&quot;color: #333333&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt; ; i&lt;span style=&quot;color: #333333&quot;&gt;--&lt;/span&gt;)
        std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;i&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0&quot;&gt;&quot; &quot;&lt;/span&gt;;
    std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;cout&lt;span style=&quot;color: #333333&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;std&lt;span style=&quot;color: #333333&quot;&gt;::&lt;/span&gt;endl;
    
    &lt;span style=&quot;color: #008800; font-weight: bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000DD; font-weight: bold&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;&lt;/div&gt;</description>
      <category>SW ExpertAcademy/D1</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/569</guid>
      <comments>https://robodream.tistory.com/569#entry569comment</comments>
      <pubDate>Fri, 30 Nov 2018 20:44:14 +0900</pubDate>
    </item>
    <item>
      <title>파이선 종료처리</title>
      <link>https://robodream.tistory.com/567</link>
      <description>&lt;p&gt;단독으로 스크립트에 sys.exit()를 했을때는 종료가 되지 않는다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이유는 모르겠는데 if문을 이용하여&amp;nbsp;&lt;/p&gt;&lt;p&gt;if file.closed:&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;sys.exit()&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;같은 방식으로 처리를 하니 종료가 된다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;(일반적인 곳에서는 상관없지만 python을 exe파일로 만들어서 C++언어상에서 createprocess 함수를 통하여 실행을 시켰을 때는 위와 같은 방법으로 했을때만 처리가 된다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;--추가&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;한 스크립트에서 인스턴스가 남아있는 경우 종료가 되지 않는거 같다. 각 인스턴스의 close 매소드들을 이용하여 열어준것들을 닫아 주면 자연스레 종료가 된다&lt;/p&gt;</description>
      <category>기억할것</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/567</guid>
      <comments>https://robodream.tistory.com/567#entry567comment</comments>
      <pubDate>Mon, 6 Aug 2018 16:14:07 +0900</pubDate>
    </item>
    <item>
      <title>파이선의 종료 처리시의 리턴값</title>
      <link>https://robodream.tistory.com/566</link>
      <description>&lt;p&gt;sys.exit()를 이용할때는 양수값을 리턴하게 된다. 음수를 리턴시키면 오버플로가 일어남.&lt;/p&gt;</description>
      <category>기억할것</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/566</guid>
      <comments>https://robodream.tistory.com/566#entry566comment</comments>
      <pubDate>Mon, 6 Aug 2018 16:10:28 +0900</pubDate>
    </item>
    <item>
      <title>C++에서의 다양한 Casting 방법들</title>
      <link>https://robodream.tistory.com/565</link>
      <description>&lt;p&gt;C에서는 일반적으로 사용하는 캐스팅 방법은 괄호를 이용하여 (int*)&amp;nbsp;와 같은 것을 활용하여 형변환을 실행합니다. 일반적으로 C에서 이용할때 강제로 형변환을 하도록 하였지만 C++에서는 다양한 변환을 이용하여 Casting을 합니다. 이렇게 Casting을 하는 방법은 dynamic_cast, static_cast, const_cast, reinterpret_cast 4가지가 있습니다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;&lt;b&gt;dynamic_cast&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;dynamic_cast는 상속관계에 있는 부모 자식의 클래스사이에서 다운케스팅을 할때 이용하게 됩니다. 반드시 소멸자를 virtual로 되어있어야 이용가능합니다.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;const_cast&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;const 형으로 보호되어있는 것에 접근 할 떄 이용합니다. const 형이 없는 것 처럼 이용하기 위하여&amp;nbsp;변환할 떄 이용합니다.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;static_cast&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;명시적으로 변환 가능한 관계에서 캐스팅을 할때 사용합니다.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;reinterpret_cast&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;bit by bit로 캐스팅할 때 사용합니다. C언어에서 괄호를 이용하여 변환한 것과 동일한 캐스티을 합니다.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Programming/Cplusplus</category>
      <category>c++</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/565</guid>
      <comments>https://robodream.tistory.com/565#entry565comment</comments>
      <pubDate>Thu, 1 Feb 2018 23:31:38 +0900</pubDate>
    </item>
    <item>
      <title>Algorithm - find_end()</title>
      <link>https://robodream.tistory.com/441</link>
      <description>&lt;p&gt;&lt;span style=&quot;font-size:11pt;&quot;&gt;&lt;b&gt;원형)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#010101; font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#fafafa; border-radius:4px; line-height:140%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #e5e5e5&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#666; font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace !important&quot;&gt;&lt;div&gt;1&lt;/div&gt;&lt;div&gt;2&lt;/div&gt;&lt;div&gt;3&lt;/div&gt;&lt;div&gt;4&lt;/div&gt;&lt;div&gt;5&lt;/div&gt;&lt;div&gt;6&lt;/div&gt;&lt;div&gt;7&lt;/div&gt;&lt;div&gt;8&lt;/div&gt;&lt;div&gt;9&lt;/div&gt;&lt;div&gt;10&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#010101; font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace !important&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;//기본형&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;template&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;class&lt;/span&gt;&amp;nbsp;ForwardIterator1,&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;class&lt;/span&gt;&amp;nbsp;ForwardIterator2&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ForwardIterator1&amp;nbsp;find_end&amp;nbsp;(ForwardIterator1&amp;nbsp;first1,&amp;nbsp;ForwardIterator1&amp;nbsp;last1,&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ForwardIterator2&amp;nbsp;first2,&amp;nbsp;ForwardIterator2&amp;nbsp;last2);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#999999&quot;&gt;//사용자&amp;nbsp;정의형&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;template&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;class&lt;/span&gt;&amp;nbsp;ForwardIterator1,&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;class&lt;/span&gt;&amp;nbsp;ForwardIterator2,&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;class&lt;/span&gt;&amp;nbsp;BinaryPredicate&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ForwardIterator1&amp;nbsp;find_end&amp;nbsp;(ForwardIterator1&amp;nbsp;first1,&amp;nbsp;ForwardIterator1&amp;nbsp;last1,&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ForwardIterator2&amp;nbsp;first2,&amp;nbsp;ForwardIterator2&amp;nbsp;last2,&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BinaryPredicate&amp;nbsp;pred);&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a style=&quot;text-decoration:none&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size:9px; word-break:normal; background-color:#e5e5e5; color:white; border-radius:10px; padding:1px&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:11pt;&quot;&gt;&lt;b&gt;의미)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;ㅇ[Iterator first, Iterator last)사이 범위에서 [Iterator first, Iterator last)사이의 연속된 데이터가 있는지 확인을 하고 연속된 데이터의 가장 앞을 가리키는 Iterator를 리턴합니다.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;소스)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;div class=&quot;colorscripter-code&quot; style=&quot;color:#010101; font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position:relative !important; overflow:auto&quot;&gt;&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin:0; padding:0; border:none; background-color:#fafafa; border-radius:4px; line-height:140%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;padding:6px; border-right:2px solid #e5e5e5&quot;&gt;&lt;div style=&quot;margin:0; padding:0; word-break:normal; text-align:right; color:#666; font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace !important&quot;&gt;&lt;div&gt;1&lt;/div&gt;&lt;div&gt;2&lt;/div&gt;&lt;div&gt;3&lt;/div&gt;&lt;div&gt;4&lt;/div&gt;&lt;div&gt;5&lt;/div&gt;&lt;div&gt;6&lt;/div&gt;&lt;div&gt;7&lt;/div&gt;&lt;div&gt;8&lt;/div&gt;&lt;div&gt;9&lt;/div&gt;&lt;div&gt;10&lt;/div&gt;&lt;div&gt;11&lt;/div&gt;&lt;div&gt;12&lt;/div&gt;&lt;div&gt;13&lt;/div&gt;&lt;div&gt;14&lt;/div&gt;&lt;div&gt;15&lt;/div&gt;&lt;div&gt;16&lt;/div&gt;&lt;div&gt;17&lt;/div&gt;&lt;div&gt;18&lt;/div&gt;&lt;div&gt;19&lt;/div&gt;&lt;div&gt;20&lt;/div&gt;&lt;div&gt;21&lt;/div&gt;&lt;div&gt;22&lt;/div&gt;&lt;div&gt;23&lt;/div&gt;&lt;div&gt;24&lt;/div&gt;&lt;div&gt;25&lt;/div&gt;&lt;div&gt;26&lt;/div&gt;&lt;div&gt;27&lt;/div&gt;&lt;div&gt;28&lt;/div&gt;&lt;div&gt;29&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;padding:6px 0&quot;&gt;&lt;div style=&quot;margin:0; padding:0; color:#010101; font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace !important&quot;&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;iostream&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;algorithm&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#0086b3&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;vector&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#066de2&quot;&gt;bool&lt;/span&gt;&amp;nbsp;findEnd(&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&amp;nbsp;i,&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&amp;nbsp;j)&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;return&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;j;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;void&lt;/span&gt;&amp;nbsp;main()&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::vector&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;vector&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;4&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;6&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;8&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;10&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;4&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;6&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;8&amp;nbsp;&lt;/span&gt;};&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::vector&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;::iterator&amp;nbsp;iter;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::vector&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;vectorCopy&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;4&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;10&amp;nbsp;&lt;/span&gt;};&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iter&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::find_end(vector.begin(),&amp;nbsp;vector.end(),&amp;nbsp;vectorCopy.begin(),&amp;nbsp;vectorCopy.end());&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;if&lt;/span&gt;&amp;nbsp;(iter&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;vector.end())&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::&lt;span style=&quot;color:#066de2&quot;&gt;cout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#63a35c&quot;&gt;&quot;-&amp;gt;&amp;nbsp;&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;*&lt;/span&gt;iter&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::endl;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;else&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::&lt;span style=&quot;color:#066de2&quot;&gt;cout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#63a35c&quot;&gt;&quot;No&amp;nbsp;data&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::endl;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::vector&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#066de2&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;vector2&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&lt;span style=&quot;color:#0099cc&quot;&gt;10&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color:#0099cc&quot;&gt;4&amp;nbsp;&lt;/span&gt;};&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iter&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::find_end(vector.begin(),&amp;nbsp;vector.end(),&amp;nbsp;vector2.begin(),&amp;nbsp;vector2.end(),&amp;nbsp;findEnd);&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;if&lt;/span&gt;&amp;nbsp;(iter&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;=&lt;/span&gt;&amp;nbsp;vector.end())&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::&lt;span style=&quot;color:#066de2&quot;&gt;cout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#63a35c&quot;&gt;&quot;-&amp;gt;&amp;nbsp;&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;*&lt;/span&gt;iter&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::endl;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#a71d5d&quot;&gt;else&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::&lt;span style=&quot;color:#066de2&quot;&gt;cout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#63a35c&quot;&gt;&quot;No&amp;nbsp;data&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#010101&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a71d5d&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:#066de2&quot;&gt;std&lt;/span&gt;::endl;&lt;/div&gt;&lt;div style=&quot;padding:0 6px; white-space:pre&quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:right; margin-top:-13px; margin-right:5px; font-size:9px; font-style:italic&quot;&gt;&lt;a style=&quot;color:#e5e5e5; text-decoration:none&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;vertical-align:bottom; padding:0 2px 4px 0&quot;&gt;&lt;a style=&quot;text-decoration:none&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size:9px; word-break:normal; background-color:#e5e5e5; color:white; border-radius:10px; padding:1px&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/span&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;리턴값)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;[Iterator first, Iterator last)사이가 비어있으면 Iterator last1를 리턴합니다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;결과)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 345px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/275C6B4A56B623EF2F&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F275C6B4A56B623EF2F&quot; width=&quot;345&quot; height=&quot;112&quot; filename=&quot;find_end().jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>STL - Algorithm/Algorithm - Non-Modifying</category>
      <category>Algorithm</category>
      <author>Programmer.</author>
      <guid isPermaLink="true">https://robodream.tistory.com/441</guid>
      <comments>https://robodream.tistory.com/441#entry441comment</comments>
      <pubDate>Fri, 14 Jul 2017 08:51:07 +0900</pubDate>
    </item>
  </channel>
</rss>