Skip to content

Commit

Permalink
rebuilding site 2023년 11월 9일 목요일 21시 48분 27초 KST
Browse files Browse the repository at this point in the history
  • Loading branch information
heozeop committed Nov 9, 2023
1 parent 89d0db3 commit ffbcbd0
Show file tree
Hide file tree
Showing 26 changed files with 200 additions and 57 deletions.
5 changes: 4 additions & 1 deletion categories/algorithm/index.html

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion categories/algorithm/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@
<link>https://heozeop.github.io/static/%ED%94%84%EB%A1%9C%ED%95%84%20%EC%9D%B4%EB%AF%B8%EC%A7%80.jpeg</link>
</image>
<generator>Hugo -- gohugo.io</generator>
<lastBuildDate>Wed, 08 Nov 2023 08:27:40 +0900</lastBuildDate><atom:link href="https://heozeop.github.io/categories/algorithm/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Thu, 09 Nov 2023 21:05:23 +0900</lastBuildDate><atom:link href="https://heozeop.github.io/categories/algorithm/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Algorithm Boj 11660</title>
<link>https://heozeop.github.io/post/algorithm-boj-11660/</link>
<pubDate>Thu, 09 Nov 2023 21:05:23 +0900</pubDate>

<guid>https://heozeop.github.io/post/algorithm-boj-11660/</guid>
<description>문제 구간 합 구하기5 문제 풀이 핵심
구간합 사각으로 덧셈하기 V_i_j = V_i-1_j + V_i_j-1 - V_i-1_j-1 Sum_x2_y2 - sum_x1_y2 - sum_x2_y1 + sum_x2_y2 자세히
변수 n, m, table_map, sum_map 코드
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import sys input = sys.</description>
</item>

<item>
<title>Algorithm Boj 16437</title>
<link>https://heozeop.github.io/post/algorithm-boj-16437/</link>
Expand Down
4 changes: 2 additions & 2 deletions categories/algorithm/page/2/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html><html lang=en dir=auto><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>algorithm | Crispy bLog</title><meta name=keywords content><meta name=description content="바삭한 삶을 살아 가는 이야기"><meta name=author content="Crispy"><link rel=canonical href=https://heozeop.github.io/categories/algorithm/><link crossorigin=anonymous href=/assets/css/stylesheet.d7fb4cbf980fe688a21621b06a795933c4e6bb2d4070ec940667af1715d84af2.css integrity="sha256-1/tMv5gP5oiiFiGwanlZM8Tmuy1AcOyUBmevFxXYSvI=" rel="preload stylesheet" as=style><link rel=icon href=https://heozeop.github.io/favicon.ico><link rel=icon type=image/png sizes=16x16 href=https://heozeop.github.io/favicon-16x16.png><link rel=icon type=image/png sizes=32x32 href=https://heozeop.github.io/favicon-32x32.png><link rel=apple-touch-icon href=https://heozeop.github.io/apple-touch-icon.png><link rel=mask-icon href=https://heozeop.github.io/safari-pinned-tab.svg><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate type=application/rss+xml href=https://heozeop.github.io/categories/algorithm/index.xml><noscript><style>#theme-toggle,.top-link{display:none}</style><style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--hljs-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style></noscript><meta property="og:title" content="algorithm"><meta property="og:description" content="바삭한 삶을 살아 가는 이야기"><meta property="og:type" content="website"><meta property="og:url" content="https://heozeop.github.io/categories/algorithm/"><meta property="og:image" content="https://heozeop.github.io/static/%ED%94%84%EB%A1%9C%ED%95%84%20%EC%9D%B4%EB%AF%B8%EC%A7%80.jpeg"><meta property="og:site_name" content="Crispy bLog"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://heozeop.github.io/static/%ED%94%84%EB%A1%9C%ED%95%84%20%EC%9D%B4%EB%AF%B8%EC%A7%80.jpeg"><meta name=twitter:title content="algorithm"><meta name=twitter:description content="바삭한 삶을 살아 가는 이야기"></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add("dark"):localStorage.getItem("pref-theme")==="light"?document.body.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://heozeop.github.io/ accesskey=h title="Crispy bLog (Alt + H)">Crispy bLog</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://heozeop.github.io/categories/ title=categories><span>categories</span></a></li><li><a href=https://heozeop.github.io/tags/ title=tags><span>tags</span></a></li></ul></nav></header><main class=main><header class=page-header><div class=breadcrumbs><a href=https://heozeop.github.io/>Home</a>&nbsp;»&nbsp;<a href=https://heozeop.github.io/categories/>Categories</a></div><h1>algorithm
<a href=index.xml title=RSS aria-label=RSS><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23"><path d="M4 11a9 9 0 019 9"/><path d="M4 4a16 16 0 0116 16"/><circle cx="5" cy="19" r="1"/></svg></a></h1></header><article class="post-entry tag-entry"><header class=entry-header><h2>Algorithm Boj 2146</h2></header><div class=entry-content><p>문제 다리 만들기 문제를 생각해 보자. 1. 생각나는 대로: 대강 대륙은 갈 수 없는 곳 대륙 옆이 길이 1로 설정 bfs로 모두 돌면서 다른 대륙 도달하기 자세히 대륙 별로 대륙 가를 1자로 한다. visit을 나타낼때 출발지, 거리를 나타낸다. 만난 곳이라면 거리를 더해서 min에 저장한다. min을 출력한다. 시간 복잡도 N^2 0인 곳 + 상하좌우에 대륙있는 곳 n^2 탐색 같은 대륙 출발 대륙 통과 바다 짧은 데 다른 대륙 계산 시도 1 문제 대륙이 통과하면 만나지를 못한다....</p></div><footer class=entry-footer><span title='2023-10-26 20:23:08 +0900 KST'>October 26, 2023</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;89 words&nbsp;·&nbsp;Crispy</footer><a class=entry-link aria-label="post link to Algorithm Boj 2146" href=https://heozeop.github.io/post/algorithm-boj-2146/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Algorithm Boj 16236</h2></header><div class=entry-content><p>문제 아기 상어 해결 방법을 생각해 보자. 방법 1: 생각 나는 대로: 기본 로직
<a href=index.xml title=RSS aria-label=RSS><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23"><path d="M4 11a9 9 0 019 9"/><path d="M4 4a16 16 0 0116 16"/><circle cx="5" cy="19" r="1"/></svg></a></h1></header><article class="post-entry tag-entry"><header class=entry-header><h2>Algorithm Boj 2638</h2></header><div class=entry-content><p>문제 치즈 문제 풀이 하기 방법 1 생각 가볍게 녹을 치즈 찾기 녹이기 1,2번 반복 녹을 치즈 찾기 bfs로 치즈 아닌 부분 찾기 윤곽중 2면 이상 치즈 아닌 부분 맡닿은거 마크 지우기 필요한 상수 direction 필요한 변수 치즈 아닌 부분 저장할 list 치즈 아닌 부분 탐색할 queue 마크 저장할 list 맵 저장할 list 시간 복잡도 bfs N^2 N일듯 => N^3 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 from collections import deque n, m = list(map(int, input()....</p></div><footer class=entry-footer><span title='2023-10-29 18:30:34 +0900 KST'>October 29, 2023</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;370 words&nbsp;·&nbsp;Crispy</footer><a class=entry-link aria-label="post link to Algorithm Boj 2638" href=https://heozeop.github.io/post/algorithm-boj-2638/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Algorithm Boj 2146</h2></header><div class=entry-content><p>문제 다리 만들기 문제를 생각해 보자. 1. 생각나는 대로: 대강 대륙은 갈 수 없는 곳 대륙 옆이 길이 1로 설정 bfs로 모두 돌면서 다른 대륙 도달하기 자세히 대륙 별로 대륙 가를 1자로 한다. visit을 나타낼때 출발지, 거리를 나타낸다. 만난 곳이라면 거리를 더해서 min에 저장한다. min을 출력한다. 시간 복잡도 N^2 0인 곳 + 상하좌우에 대륙있는 곳 n^2 탐색 같은 대륙 출발 대륙 통과 바다 짧은 데 다른 대륙 계산 시도 1 문제 대륙이 통과하면 만나지를 못한다....</p></div><footer class=entry-footer><span title='2023-10-26 20:23:08 +0900 KST'>October 26, 2023</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;89 words&nbsp;·&nbsp;Crispy</footer><a class=entry-link aria-label="post link to Algorithm Boj 2146" href=https://heozeop.github.io/post/algorithm-boj-2146/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Algorithm Boj 16236</h2></header><div class=entry-content><p>문제 아기 상어 해결 방법을 생각해 보자. 방법 1: 생각 나는 대로: 기본 로직
물고기 크기/위치를 기준으로 정렬한다. 먹을 수 있는 물고기만 담는다. 거리를 계산한다. 가장 짧은 거리의 물고기만 먹는다. 먹은 수대로 상어 크기를 올린다. 핵심 로직
상어의 성장 여부 확인 먹을 수 있는 물고기만 담기 거리 계산하기 bfs로 탐색하기 글로벌 변수
먹은 물고기 수 상어 성장 여부 판단 상어 크기 상어 위치 시간 순차 로직
Expand All @@ -8,7 +8,7 @@
빈칸 nC3 으로 위치뽑기
바이러스 위치 기준으로 돌면서 dfs로 맵 채우기 전체 - 바이러스 - 벽수로 빈값 구하기 빈값 크기 비교 하기 (n * m)C3 * (n * m) => 약 266만
구현
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 directions = [ [0,1], [0,-1], [1,0], [-1, 0] ] def dfs(x,y, visited): global n,m, lab_map; for i in range(4): nx = x + directions[i][0] ny = y + directions[i][1] if nx &lt; 0 or ny &lt; 0 or nx >= n or ny >= m: continue if lab_map[nx][ny] !...</p></div><footer class=entry-footer><span title='2023-10-23 22:07:43 +0900 KST'>October 23, 2023</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;315 words&nbsp;·&nbsp;Crispy</footer><a class=entry-link aria-label="post link to Algorithm Boj 14502" href=https://heozeop.github.io/post/algorithm-boj-14502/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Algorithm Boj 2178</h2></header><div class=entry-content><p>문제 미로탐색 해법을 생각해보자. 방법 1: 그냥 떠오르는 대로 bfs로 0,0부터 탐색 가장 먼저 N,M 도착하면 출력하기 n^2 구현 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 from collections import deque directions = [ [0,1], [0,-1], [1,0], [-1,0], ] VISITED = -1 TARGET = '1' queue = deque() queue....</p></div><footer class=entry-footer><span title='2023-10-23 21:43:03 +0900 KST'>October 23, 2023</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;143 words&nbsp;·&nbsp;Crispy</footer><a class=entry-link aria-label="post link to Algorithm Boj 2178" href=https://heozeop.github.io/post/algorithm-boj-2178/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Algorithm Boj 2667</h2></header><div class=entry-content><p>문제 단지 번호 붙이기 주요 로직을 생각해보자. 1번: 막생각 나는 대로 | O(n^3) 2차원 배열을 입력 받는다. 방문 여부를 const로 설정한다. 2차원 배열을 순회한다. 1이 아니면 통과한다. 상하좌우 탐색한다. dfs로 집 수를 찾는다. 집수 list에 저장한다. 집수 list를 정렬한다. 집수를 출력한다. 구현 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 TARGET = '1' VISITED = -1 cost_list = [] directions = [ [0, 1], [0, -1], [1,0], [-1,0] ] def dfs(x,y): global n map_list[x][y] = VISITED localCount = 1 for i in range(4): nx = x + directions[i][0] ny = y + directions[i][1] if nx &lt; 0 or ny &lt; 0 or nx >= n or ny >= n: continue if map_list[nx][ny] !...</p></div><footer class=entry-footer><span title='2023-10-23 20:59:09 +0900 KST'>October 23, 2023</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;179 words&nbsp;·&nbsp;Crispy</footer><a class=entry-link aria-label="post link to Algorithm Boj 2667" href=https://heozeop.github.io/post/algorithm-boj-2667/></a></article><footer class=page-footer><nav class=pagination><a class=prev href=https://heozeop.github.io/categories/algorithm/>« Prev</a>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 directions = [ [0,1], [0,-1], [1,0], [-1, 0] ] def dfs(x,y, visited): global n,m, lab_map; for i in range(4): nx = x + directions[i][0] ny = y + directions[i][1] if nx &lt; 0 or ny &lt; 0 or nx >= n or ny >= m: continue if lab_map[nx][ny] !...</p></div><footer class=entry-footer><span title='2023-10-23 22:07:43 +0900 KST'>October 23, 2023</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;315 words&nbsp;·&nbsp;Crispy</footer><a class=entry-link aria-label="post link to Algorithm Boj 14502" href=https://heozeop.github.io/post/algorithm-boj-14502/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Algorithm Boj 2178</h2></header><div class=entry-content><p>문제 미로탐색 해법을 생각해보자. 방법 1: 그냥 떠오르는 대로 bfs로 0,0부터 탐색 가장 먼저 N,M 도착하면 출력하기 n^2 구현 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 from collections import deque directions = [ [0,1], [0,-1], [1,0], [-1,0], ] VISITED = -1 TARGET = '1' queue = deque() queue....</p></div><footer class=entry-footer><span title='2023-10-23 21:43:03 +0900 KST'>October 23, 2023</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;143 words&nbsp;·&nbsp;Crispy</footer><a class=entry-link aria-label="post link to Algorithm Boj 2178" href=https://heozeop.github.io/post/algorithm-boj-2178/></a></article><footer class=page-footer><nav class=pagination><a class=prev href=https://heozeop.github.io/categories/algorithm/>« Prev</a>
<a class=next href=https://heozeop.github.io/categories/algorithm/page/3/>Next »</a></nav></footer></main><footer class=footer><span>&copy; 2023 <a href=https://heozeop.github.io/>Crispy bLog</a></span>
<span>Powered by
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
Expand Down
Loading

0 comments on commit ffbcbd0

Please sign in to comment.