<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="https://snp0301.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://snp0301.github.io/" rel="alternate" type="text/html" /><updated>2023-08-02T07:43:19+00:00</updated><id>https://snp0301.github.io/feed.xml</id><title type="html">Show and Prove</title><subtitle>Seung-Gi Kims Dev Blog</subtitle><author><name>Seung-Gi Kim (김승기)</name></author><entry><title type="html">[Daily Post] 230802</title><link href="https://snp0301.github.io/daily/230802Daily/" rel="alternate" type="text/html" title="[Daily Post] 230802" /><published>2023-08-02T00:00:00+00:00</published><updated>2023-08-02T00:00:00+00:00</updated><id>https://snp0301.github.io/daily/230802Daily</id><content type="html" xml:base="https://snp0301.github.io/daily/230802Daily/">&lt;p class=&quot;notice--success&quot;&gt;[Daily Post]는 매일매일 탐구한 내용을 간략하게 기록하는 포스트입니다.&lt;br /&gt; 따라서 정리되지 않은 내용과 추측을 포함하고 있을 수 있습니다.&lt;br /&gt;
더 체계적인 형식을 갖춘 글은 해당 카테고리의 포스트를 확인해주세요 :)&lt;/p&gt;

&lt;h2 id=&quot;my-study&quot;&gt;My Study&lt;/h2&gt;

&lt;h3 id=&quot;ps&quot;&gt;PS&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Code.Plus &lt;a href=&quot;https://snp0301.github.io/ps/230802PS/&quot;&gt;기초, 연습문제&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;cs&quot;&gt;CS&lt;/h3&gt;

&lt;h4 id=&quot;primary-key&quot;&gt;Primary Key&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;row를 unique하게 구분하는 column&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;구분을 위해 null, duplication을 허용하지 않는다&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Relation = Table&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;row = tuple = record&lt;/li&gt;
      &lt;li&gt;column = attribute&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Super key: 하나 혹은 복수의 속성 집합으로 이루어진 &lt;strong&gt;해당 key가 특정 row만을 찾을 수 있는 경우&lt;/strong&gt;가 super key다.&lt;/li&gt;
  &lt;li&gt;Candidate key: super key 중에서 더 이상 쪼개질 수 없는, 가장 작은 단위의 집합&lt;/li&gt;
  &lt;li&gt;Primary key: candidate key 중 선택한 key&lt;/li&gt;
  &lt;li&gt;Alternative key: candidate key - primary key. 즉, &lt;strong&gt;남은 키&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;rdb&quot;&gt;RDB&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;1:N: 나의 primary key는 다른 누군가의 foreign key: 배달 주문 내역&lt;/li&gt;
  &lt;li&gt;N:M: 책가방 목록처럼, mapping table을 중간에 두고 mapping이 된다&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;join&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;join&lt;/code&gt;&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;inner join&lt;/code&gt;: intersection&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;outer join&lt;/code&gt;: A outer join: A의 모든 데이터를 포함한 데이터를 join
    &lt;ul&gt;
      &lt;li&gt;보통 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;left join&lt;/code&gt;를 수행한다&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;web---portfolio&quot;&gt;Web - Portfolio&lt;/h3&gt;

&lt;h3 id=&quot;web--blockchain&quot;&gt;Web- Blockchain&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;CZ &lt;a href=&quot;https://snp0301.github.io/solidity/230802Solidity/&quot;&gt;How to Build an Oracle - Part 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="Daily" /><summary type="html">Advanced Solidity 종료</summary></entry><entry><title type="html">[PS] 230802 유형별 코테 준비</title><link href="https://snp0301.github.io/ps/230802PS/" rel="alternate" type="text/html" title="[PS] 230802 유형별 코테 준비" /><published>2023-08-02T00:00:00+00:00</published><updated>2023-08-02T00:00:00+00:00</updated><id>https://snp0301.github.io/ps/230802PS</id><content type="html" xml:base="https://snp0301.github.io/ps/230802PS/">&lt;p class=&quot;notice--success&quot;&gt;[PS]는 문제해결 및 알고리즘을 공부한 내용을 담고 있습니다. &lt;br /&gt;
문제는 백준 Online Judge, Leetcode에서 참고했으며, 본문에서는 문제 접근 방식과 새로 배운 내용을 담고 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;1929-소수-구하기&quot;&gt;1929. 소수 구하기&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;문제 티어가 뭐가 중요하겠냐마는, 그래도 내가 파이썬으로 처음 푼 &lt;strong&gt;골드 문제&lt;/strong&gt;였다!
    &lt;ul&gt;
      &lt;li&gt;채점이 1분 넘게 걸리는 것도 처음이었다!&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;‘조금 더 빠른 프로그램을 짤 수는 없을까’하는 고민을 처음으로 하게 된 의미 있는 문제였다.&lt;/li&gt;
  &lt;li&gt;앞으로 PS를 하다가 막히면 이 문제를 풀 때의 감정을 떠올리면서 풀면 동기부여가 될 것 같다.&lt;/li&gt;
  &lt;li&gt;해결 완료.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;9095-123-더하기&quot;&gt;9095. 1,2,3 더하기&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;로직이 어려워서 답안을 참조했다.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dp[i] = dp[i-1]+dp[i-2]+dp[i-3]&lt;/code&gt;을 어떻게 바로 떠올리지? 보니까 이해는 되는데 떠오르지는 않는 것을 보니 아직 내 것이라고 하기에는 부족한 것 같다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;14500-테트로미노&quot;&gt;14500. 테트로미노&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;문제 읽고 시간이 엄청 걸릴 것이라는 느낌이 딱 들었다.&lt;/li&gt;
  &lt;li&gt;오래 걸리기는 해도, 어떻게든 풀 수는 있을 것 같아서 &lt;strong&gt;로직에 따라서 먼저 답안을 작성하고&lt;/strong&gt;, 효율적인 답안으로 수정해나가는 것을 목표로 문제를 풀었다.&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;입출력은 다음과 같이 받았다&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;sys&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stdin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;readline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;arr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stdin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;readline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()])&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="PS" /><summary type="html">code plus: 수학 - 오답노트</summary></entry><entry><title type="html">[Solidity] 230802 study</title><link href="https://snp0301.github.io/solidity/230802Solidity/" rel="alternate" type="text/html" title="[Solidity] 230802 study" /><published>2023-08-02T00:00:00+00:00</published><updated>2023-08-02T00:00:00+00:00</updated><id>https://snp0301.github.io/solidity/230802Solidity</id><content type="html" xml:base="https://snp0301.github.io/solidity/230802Solidity/">&lt;h3 id=&quot;1-using-roles&quot;&gt;1. Using Roles&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;더 decentralized oracle을 위해, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;oracle&lt;/code&gt;과 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;owner&lt;/code&gt;의 access 권한을 분리할 필요가 있다. 따라서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;owner&lt;/code&gt; address에서만 실행할 수 있는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;add&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;remove&lt;/code&gt;와 같은 함수를 명시하기 위해 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Roles&lt;/code&gt;를 써야 한다.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Roles&lt;/code&gt;는 다음과 같이 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;import&lt;/code&gt;한다
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;import &quot;openzeppelin-solidity/contracts/access/Roles.sol&quot;;&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;2-using-constructor-to-set-the-owner&quot;&gt;2. Using Constructor to Set the Owner&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;constructor&lt;/code&gt;는 contract가 deploy 될 때, &lt;strong&gt;단 한번만&lt;/strong&gt; 실행된다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;3-setting-up-new-oracles&quot;&gt;3. Setting Up New Oracles&lt;/h3&gt;

&lt;h3 id=&quot;4-the-logical-not-operator&quot;&gt;4. The Logical NOT Operator&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;!&lt;/code&gt;로 negation하기&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;5-removing-an-oracle&quot;&gt;5. Removing an Oracle&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;add&lt;/code&gt;도, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;remove&lt;/code&gt;도 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_numOracles&lt;/code&gt;를 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;require&lt;/code&gt;로 체크하면서 실행해야 한다.
    &lt;ul&gt;
      &lt;li&gt;특히, 제거할 oracle이 없는데 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;remove&lt;/code&gt;를 실행하면 오류가 발생하기 때문에 더더욱 체크해야 한다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;6-keeping-track-of-responses&quot;&gt;6. Keeping Track of Responses&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;struct&lt;/code&gt;는 다음과 같이 정의한다.
    &lt;ul&gt;
      &lt;li&gt;
        &lt;div class=&quot;language-solidity highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;myStruct&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kt&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;callerAddress&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kt&quot;&gt;uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;keyNumber&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;위에서 정의한 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;struct&lt;/code&gt;는 다음과 같이 선언한다
    &lt;ul&gt;
      &lt;li&gt;
        &lt;div class=&quot;language-solidity highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;myStruct&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;memory&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;myInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;myInstance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;myStruct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;callerParam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;numberParam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;7-computing-the-eth-price&quot;&gt;7. Computing the ETH price&lt;/h3&gt;

&lt;h3 id=&quot;8-computing-the-eth-price---contd&quot;&gt;8. Computing the ETH price - cont’d&lt;/h3&gt;

&lt;h3 id=&quot;9-using-safemath&quot;&gt;9. Using SafeMath&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;target.add()&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;target.sub()&lt;/code&gt;와 같은 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SafeMath&lt;/code&gt;를 써야 overflow를 방지할 수 있다&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;10-using-safemath&quot;&gt;10. Using SafeMath&lt;/h3&gt;

&lt;h3 id=&quot;11-lesson-complete&quot;&gt;11. Lesson Complete!&lt;/h3&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="Solidity" /><summary type="html">How to Build an Oracle - Part 3</summary></entry><entry><title type="html">[Daily Post] 230801</title><link href="https://snp0301.github.io/daily/230801Daily/" rel="alternate" type="text/html" title="[Daily Post] 230801" /><published>2023-08-01T00:00:00+00:00</published><updated>2023-08-01T00:00:00+00:00</updated><id>https://snp0301.github.io/daily/230801Daily</id><content type="html" xml:base="https://snp0301.github.io/daily/230801Daily/">&lt;p class=&quot;notice--success&quot;&gt;[Daily Post]는 매일매일 탐구한 내용을 간략하게 기록하는 포스트입니다.&lt;br /&gt; 따라서 정리되지 않은 내용과 추측을 포함하고 있을 수 있습니다.&lt;br /&gt;
더 체계적인 형식을 갖춘 글은 해당 카테고리의 포스트를 확인해주세요 :)&lt;/p&gt;

&lt;h1 id=&quot;my-study&quot;&gt;My Study&lt;/h1&gt;

&lt;h2 id=&quot;ps&quot;&gt;PS&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;8월의 목표는 &lt;a href=&quot;https://www.acmicpc.net/workbook/codeplus&quot;&gt;code.plus&lt;/a&gt;에서 기초~연습 카테고리까지 끝내는 것이다.&lt;/li&gt;
  &lt;li&gt;하루에 최소 5문제는 풀어야하고, 시간으로는 120분을 잡도록 하자.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;cs&quot;&gt;CS&lt;/h2&gt;

&lt;h3 id=&quot;os-memory---paging&quot;&gt;OS Memory - Paging&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;process가 할당 받은 memory를 일정 단위로 나누어, 물리적으로 연속되지 않은 위치에서 메모리를 관리하는 기법&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;os-memory---segmentation&quot;&gt;OS Memory - Segmentation&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;page와 다르게 의미 단위로 나눈다. e.g., data, heap, code, stack&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;os-memory---virtul-memory&quot;&gt;OS Memory - Virtul Memory&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;실제 메모리와 논리 메모리를 분리해, 기능적으로 필요한 부분만 실제(물리) 메모리에 올려 프로그램을 작성하는 것&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;web---portfolio&quot;&gt;Web - Portfolio&lt;/h2&gt;

&lt;h2 id=&quot;web--blockchain&quot;&gt;Web- Blockchain&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;CZ &lt;a href=&quot;https://snp0301.github.io/solidity/230801Solidity/&quot;&gt;How to Build an Oracle - Part 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="Daily" /><summary type="html">8월의 시작</summary></entry><entry><title type="html">[PS] 230801 유형별 코테 준비</title><link href="https://snp0301.github.io/ps/230801PS/" rel="alternate" type="text/html" title="[PS] 230801 유형별 코테 준비" /><published>2023-08-01T00:00:00+00:00</published><updated>2023-08-01T00:00:00+00:00</updated><id>https://snp0301.github.io/ps/230801PS</id><content type="html" xml:base="https://snp0301.github.io/ps/230801PS/">&lt;p class=&quot;notice--success&quot;&gt;[PS]는 문제해결 및 알고리즘을 공부한 내용을 담고 있습니다. &lt;br /&gt;
문제는 백준 Online Judge, Leetcode에서 참고했으며, 본문에서는 문제 접근 방식과 새로 배운 내용을 담고 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;6588-골드바흐의-추측&quot;&gt;6588. 골드바흐의 추측&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;지속적인 &lt;strong&gt;IndexError&lt;/strong&gt;로 일단 Keep.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;17425-약수의-합&quot;&gt;17425. 약수의 합&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;TC는 맞는데 &lt;strong&gt;시간 초과&lt;/strong&gt;가 떠서 틀렸던 문제.&lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;sys&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stdin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;readline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stdin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;readline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;위와 같은 코드를 작성했는데 시간 초과가 나왔다.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;k*(n//k)for k in range(1,n+1)&lt;/code&gt;로 푸는 로직은 이해가 되는데, 이게 시간초과가 걸린다니..?&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O(nlgn)&lt;/code&gt;으로 풀 수 있었다.
    &lt;ul&gt;
      &lt;li&gt;i, j로 이루어진 반복문에 대해 i*j가 MAX보다 작으면 i를 array에 넣는다&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="PS" /><summary type="html">code plus: 수학 - 오답노트</summary></entry><entry><title type="html">[Solidity] 230801 study</title><link href="https://snp0301.github.io/solidity/230801Solidity/" rel="alternate" type="text/html" title="[Solidity] 230801 study" /><published>2023-08-01T00:00:00+00:00</published><updated>2023-08-01T00:00:00+00:00</updated><id>https://snp0301.github.io/solidity/230801Solidity</id><content type="html" xml:base="https://snp0301.github.io/solidity/230801Solidity/">&lt;h3 id=&quot;1-getting-set-up&quot;&gt;1. Getting Set up&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;deploy된 contract와 JS를 연동하기 위해서는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;web3.eth.Contract&lt;/code&gt;를 통해 interact 해야 한다.
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;const myContract = new web3js.eth.Contract(myCOntractJSON.abi, myContractJSON.networks[networkId].address)&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;networkId&lt;/code&gt;를 하드 코딩하는 것도 가능하기는 하지만, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;await web3js.eth.net.getId()&lt;/code&gt;와 같이 다룬다면 특별한 관리 없이 networkId를 얻을 수 있다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;2-listening-for-events&quot;&gt;2. Listening for Events&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;event를 async로 들어야 interaciton이 가능하다&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;3-adding-a-request-to-the-processing-queue&quot;&gt;3. Adding a Request to the Processing Queue&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;event가 다음과 같이 선언됐다고 가정하자: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;event TransferTokens(address from, address to, uint256 amount)&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;다음과 같이 event의 return value를 나눌 수 있다&lt;/li&gt;
      &lt;li&gt;
        &lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;parseEvent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;returnValues&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;returnValues&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;amount&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;returnValues&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;amount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;        &lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;arrName.push({key: value})&lt;/code&gt;로 push 할 수 있다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;4-looping-trough-the-processing-queue&quot;&gt;4. Looping Trough the Processing Queue&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;JS는 single-threaded&lt;/strong&gt;이기 떄문에 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pendingRequests&lt;/code&gt; array를 있는 그대로 처리하면 시간이 매우 오래 걸린다
    &lt;ul&gt;
      &lt;li&gt;따라서 array를 일정 크기로 잘라 수행해야 한다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;5-processing-the-queue&quot;&gt;5. Processing the Queue&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;array에 대해 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shift&lt;/code&gt; 함수는 다음과 같은 기능을 수행한다
    &lt;ol&gt;
      &lt;li&gt;인자로 주어진 element를 return한다.&lt;/li&gt;
      &lt;li&gt;1.에서 return한 인자를 array에서 지운다&lt;/li&gt;
      &lt;li&gt;array 길이를 1만큼 줄인다&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;6-the-retry-loop&quot;&gt;6. The Retry Loop&lt;/h3&gt;

&lt;h3 id=&quot;7-using-try-and-catch-in-javascript&quot;&gt;7. Using Try and Catch in JavaScript&lt;/h3&gt;

&lt;h3 id=&quot;8-using-try-and-catch-in-javascript---contd&quot;&gt;8. Using Try and Catch in JavaScript - Cont’d&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;try&lt;/code&gt;에 실행 내용이, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;catch&lt;/code&gt;에는 실행 내용에 대해 exception이 throw 됐을 때 실행할 내용이 적혀있어야 한다&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;9-working-with-numbers-in-ethereum-and-javascript&quot;&gt;9. Working with Numbers in Ethereum and JavaScript&lt;/h3&gt;

&lt;h3 id=&quot;10-returning-multiple-values-in-javascript&quot;&gt;10. Returning multiple values in JavaScript&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;const {one, two} = myAwesomeFuction()&lt;/code&gt;과 같이, 중괄호 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;{}&lt;/code&gt;)를 사용하여 multiple value를 뱉는 function의 결과값을 변수에 저장할 수 있다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;11-wrapping-up-the-oracle&quot;&gt;11. Wrapping Up the Oracle&lt;/h3&gt;

&lt;h3 id=&quot;12-returning-multiple-values-in-javascript&quot;&gt;12. Returning multiple values in JavaScript&lt;/h3&gt;

&lt;h3 id=&quot;13-deploy-the-contracts&quot;&gt;13. Deploy the Contracts&lt;/h3&gt;

&lt;h3 id=&quot;14-putting-everything-together&quot;&gt;14. Putting Everything together&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node Client.js&lt;/code&gt;를 터미널에서 실행하는 것으로 이번 실습 코드를 실행시킨다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;15-lesson-complete&quot;&gt;15. Lesson Complete!&lt;/h3&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="Solidity" /><summary type="html">How to Build an Oracle - Part 2</summary></entry><entry><title type="html">[Daily Post] 230728</title><link href="https://snp0301.github.io/daily/230728Daily/" rel="alternate" type="text/html" title="[Daily Post] 230728" /><published>2023-07-28T00:00:00+00:00</published><updated>2023-07-28T00:00:00+00:00</updated><id>https://snp0301.github.io/daily/230728Daily</id><content type="html" xml:base="https://snp0301.github.io/daily/230728Daily/">&lt;p class=&quot;notice--success&quot;&gt;[Daily Post]는 매일매일 탐구한 내용을 간략하게 기록하는 포스트입니다.&lt;br /&gt; 따라서 정리되지 않은 내용과 추측을 포함하고 있을 수 있습니다.&lt;br /&gt;
더 체계적인 형식을 갖춘 글은 해당 카테고리의 포스트를 확인해주세요 :)&lt;/p&gt;

&lt;h1 id=&quot;my-study&quot;&gt;My Study&lt;/h1&gt;

&lt;h2 id=&quot;ps&quot;&gt;PS&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://www.acmicpc.net/workbook/codeplus/1&quot;&gt;Code.plus 문제집&lt;/a&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;브루트포스&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;cs&quot;&gt;CS&lt;/h2&gt;

&lt;h2 id=&quot;web---portfolio&quot;&gt;Web - Portfolio&lt;/h2&gt;

&lt;h2 id=&quot;web--blockchain&quot;&gt;Web- Blockchain&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;CZ &lt;a href=&quot;https://snp0301.github.io/solidity/230728Solidity/&quot;&gt;How to Build an Oracle - Part 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="Daily" /><summary type="html">하루를 알차고 소중하게</summary></entry><entry><title type="html">[PS] 230728 유형별 코테 준비</title><link href="https://snp0301.github.io/ps/230728PS/" rel="alternate" type="text/html" title="[PS] 230728 유형별 코테 준비" /><published>2023-07-28T00:00:00+00:00</published><updated>2023-07-28T00:00:00+00:00</updated><id>https://snp0301.github.io/ps/230728PS</id><content type="html" xml:base="https://snp0301.github.io/ps/230728PS/">&lt;p class=&quot;notice--success&quot;&gt;[PS]는 문제해결 및 알고리즘을 공부한 내용을 담고 있습니다. &lt;br /&gt;
문제는 백준 Online Judge, Leetcode에서 참고했으며, 본문에서는 문제 접근 방식과 새로 배운 내용을 담고 있습니다.&lt;/p&gt;

&lt;p&gt;###&lt;/p&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="PS" /><summary type="html">code plus: 브루트 포스</summary></entry><entry><title type="html">[PS] 230726 유형별 코테 준비</title><link href="https://snp0301.github.io/ps/230726PS/" rel="alternate" type="text/html" title="[PS] 230726 유형별 코테 준비" /><published>2023-07-26T00:00:00+00:00</published><updated>2023-07-26T00:00:00+00:00</updated><id>https://snp0301.github.io/ps/230726PS</id><content type="html" xml:base="https://snp0301.github.io/ps/230726PS/">&lt;p class=&quot;notice--success&quot;&gt;[PS]는 문제해결 및 알고리즘을 공부한 내용을 담고 있습니다. &lt;br /&gt;
문제는 백준 Online Judge, Leetcode에서 참고했으며, 본문에서는 문제 접근 방식과 새로 배운 내용을 담고 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;6588-골드바흐의-추측&quot;&gt;6588. 골드바흐의 추측&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;로직은 완성인데, 8%에서 시간 초과가 난다&lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;math&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;isPrime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ceil&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sqrt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)):&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isPrime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;ow&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isPrime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)):&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;%d = %d + %d&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;이렇게 하지 말고, 주어진 n이 있으니까 n에 대해 모두 prime을 계산해 배열에 저장해보기로 했다. 그 방법은 다음과 같다.
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O(n)&lt;/code&gt;에 대해 실행&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;O(nlgn)&lt;/code&gt;에 대해 실행&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="PS" /><summary type="html">code plus: 수학 - 골드바흐의 추측</summary></entry><entry><title type="html">[PS] 230725 유형별 코테 준비</title><link href="https://snp0301.github.io/ps/230725PS/" rel="alternate" type="text/html" title="[PS] 230725 유형별 코테 준비" /><published>2023-07-25T00:00:00+00:00</published><updated>2023-07-25T00:00:00+00:00</updated><id>https://snp0301.github.io/ps/230725PS</id><content type="html" xml:base="https://snp0301.github.io/ps/230725PS/">&lt;p class=&quot;notice--success&quot;&gt;[PS]는 문제해결 및 알고리즘을 공부한 내용을 담고 있습니다. &lt;br /&gt;
문제는 백준 Online Judge, Leetcode에서 참고했으며, 본문에서는 문제 접근 방식과 새로 배운 내용을 담고 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;1476-날짜-계산&quot;&gt;1476. 날짜 계산&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;이걸 어떻게 다 하지..? 할 때는 메모리랑 시간을 확인하고, 브루트 포스로 풀어야겠다는 생각을 하면 될 것 같다&lt;/li&gt;
  &lt;li&gt;해결 완료&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;9095-123-더하기&quot;&gt;9095. 1,2,3 더하기&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;어려운 문제가 많다.. 로직 자체가 이해 되지 않아서 패스&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;1748-수-이어-쓰기-1&quot;&gt;1748. 수 이어 쓰기 1&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;C였으면 한참 더 걸렸을 것이 확실한 문제&lt;/li&gt;
  &lt;li&gt;해결 완료&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Seung-Gi Kim (김승기)</name></author><category term="PS" /><summary type="html">code plus: 브루트 포스</summary></entry></feed>