-
자료구조 - 큐(queue) in C++
이 글은 c++의 <queue>를 중점으로 다룹니다. 개념 큐(queue)는 먼저 입력한 데이터가 먼저 빠져나오는 자료구조입니다. (FirstInFirstOut) 선언 #include <queue> std::queue<DataType> QueueName; //queue<int> q; -> int형 데이터를 담는 큐 'q' 과 같은 방식으로 큐를 선언합니다. 주요 기능 아래 method들을 사용하려면 선언한 큐의 이름이 q라고 할때 q.pop(); 처럼 사용할 수 있습니다. 그럼 method들을 소개하겠습니다. void push(T dat... Read More
-
BOJ 9370번 - 미확인 도착지 [C/C++]
문제 바로가기 문제 예술가가 도시의 거리들을 이동하고 있고, 목적지의 후보가 여러개 있다. 예술가는 목적지로 갈때 최단 경로로 이동한다. 이때 예술가가 지나간 거리 하나를 알 때(냄새를 맡은 길) 목적지 후보들 중 가능한 지점을 출력한다. ex) 아래 그림과 같을때 (1번에서 출발) 3번으로의 최단거리에는 초록색 길이 없으므로 x 4번으로의 최단거리에는 초록색 길이 포함되므로 o 5번으로의 최단거리는 초록 길이 없는, 있는 두가지인데 이때도 가능하다고 본다. 조건 2 ≤ 교차로(정점) ≤ 2000 1 ≤ 도로(간선) ≤ 50000 1 ≤ 목적지 후보 ≤ 100 두개의 정점 사... Read More
-
알고리즘 & 자료구조 - 그래프, DFS&BFS
개념 그래프는 1개 이상의 정점 (vertex / node)들과 0개 이상의 간선 (edge)들로 이루어진 자료구조입니다. 정점: A, B, C 간선: 2개 (A와 B를 잇는 간선, A와 A를 잇는 간선) 그래프의 종류 Undirected Graph (무방향 그래프): 방향이 없는 간선들로 이루어진 그래프 (1) Directed Graph (방향 그래프): 간선에 방향이 존재하는 그래프 (2) Weighted Graph (가중 그래프): 간선에 가중치가 존재하는 그래프 (Undirected Graph도 Weighted Graph가 될 수 있음) (3) ... Read More
-
BOJ 2579번 - 계단 오르기
문제 바로가기 문제 각각의 계단을 밟으면 그 계단에 쓰여있는 점수를 얻는다. 계단은 한번에 한개, 또는 두개씩 오를 수 있고 연속되는 세개의 계단을 밟을 수 없다. 마지막 계단은 항상 밟아야 할 때 얻은 점수의 최댓값을 구하는 문제. 조건 각각의 계단을 밟으면 그 계단에 쓰여있는 점수를 얻는다 계단은 한번에 한계단, 또는 두계단 오를수 있다 연속된 세개의 계단을 밟을 수 없다 마지막 계단은 항상 밟을 것 총 점수의 최댓값 구하기 설계 다이나믹 프로그래밍(DP)를 이용한 풀이법을 생각해볼 수 있다. i번째 계단을 밟았을 때의 가능한 최대 점수를 dp[i], i번째 계단의 점수를... Read More
-
BOJ 1065번 - 한수
문제 바로가기 문제 한수 : 각 자리의 수가 등차수열을 이루는 수 (951, 14, 2, …) 일때 양의 정수 N을 입력받고 1 이상 N 이하의 한수의 개수를 출력하는 문제 조건 N: 1 <= N <= 1000인 자연수 설계 N이 최대 1000이고, 1000은 한수가 아니므로 3자리 숫자까지만 한수인지 알면 된다 100부터 최대999까지만 한수인지 판별하면 되기 때문에 브루트포스로 해결할 수 있다 이때 한자리수, 두자리수는 모두 등차수열 세자리수가 한수인지 구할때 (100의자리수 + 1의자리수) = 2*(10의자리수) 인지만 검사하면 된다 (등차수열) 구현... Read More
-
블로그 개설
BOJ문제풀이, 알고리즘 설명 등을 적을 예정입니다. Read More
-
Welcome to Jekyll!
You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the _posts dire... Read More
-
An exhibit of Markdown
This note demonstrates some of what Markdown is capable of doing. An exhibit of Markdown Note: Feel free to play with this page. Unlike regular notes, this doesn’t automatically save itself. Basic formatting Paragraphs can be written like so. A paragraph is the basic block of Markdown. A paragraph is what text will turn into when there is no... Read More
-
Mathjax Test
A safe integer is an integer that can be exactly represented as an IEEE-754 double precision number, and whose IEEE-75 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation For example, $ 2 ^ {53} - 1 $ is a safe integer, it can be exactly represented Read More
-
Video example
Canon in D (Pachelbel’s Canon) - Cello & Piano [BEST WEDDING VERSION] Some of you know that we occasionally play for weddings. As you can imagine, we get a LOT of requests for Canon in D, and we discovered that there were no good arrangements available anywhere for piano and cello! Hard to believe given its popularity. So we decided to make ... Read More
-
Table example
Table example as below For now, these extended features are provided: Cells spanning multiple columns Cells spanning multiple rows Cells text align separately Table header not required Grouped table header rows or data rows Rowspan and Colspan ^^ in a cell indicates it should be merged with the cell above. This feature is contribu... Read More
-
Mermaid example
1. Pie chart pie title Pets adopted by volunteers "Dogs" : 386 "Cats" : 85 "Rats" : 35 2. sequence diagram @startmermaid sequenceDiagram Alice -» Bob: Hello Bob, how are you? Bob–»John: How about you John? Bob–x Alice: I am good thanks! Bob-x John: I am good thanks! Note right of John: Bob thinks a longlong time, so longthat ... Read More
-
Plantuml example
My First PlantUML PlantUML Block-1 @startuml Bob -> Alice : hello @enduml PlantUML Block-2 Bob -> Alice : hello world PlantUML Block-3 @startuml (*) –> “Initialization” if “Some Test” then –>[true] “Some Activity” –> “Another activity” -right-> () else ->[false] “Something else” –>[Ending process] () endif ... Read More
-
Quick markdown example
Paragraphs are separated by a blank line. 2nd paragraph. Italic, bold, and monospace. Itemized lists look like: this one that one the other one Note that — not considering the asterisk — the actual text content starts at 4-columns in. Block quotes are written like so. They can span multiple paragraphs, if you like. Use 3 dash... Read More
-
This post demonstrates post content styles
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum neque eget nunc mattis eu sollicitudin enim tincidunt. Vestibulum lacus tortor, ultricies id dignissim ac, bibendum in velit. Some great heading (h2) Proin convallis mi ac felis pharetra aliquam. Curabitur dignissim accumsan rutrum. In arcu magna, aliquet vel pretium et, m... Read More
-
My Example Post
Eos eu docendi tractatos sapientem, brute option menandri in vix, quando vivendo accommodare te ius. Nec melius fastidii constituam id, viderer theophrastus ad sit, hinc semper periculis cum id. Noluisse postulant assentior est in, no choro sadipscing repudiandae vix. Vis in euismod delenit dignissim. Ex quod nostrum sit, suas decore animal id i... Read More
-
Some articles are just so long they deserve a really long title to see if things will break well
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum neque eget nunc mattis eu sollicitudin enim tincidunt. Vestibulum lacus tortor, ultricies id dignissim ac, bibendum in velit. Proin convallis mi ac felis pharetra aliquam. Curabitur dignissim accumsan rutrum. In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lo... Read More
-
Some articles are just so short that we have to make the footer stick
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur s... Read More
-
Another test markdown
Put the math expression within $…$: \(\LaTeX{}\) $\Pi$ $ a * b = c ^ b $ $ 2^{\frac{n-1}{3}} $ $ \int_a^b f(x)\,dx. $ \( \int_a^b f(x)\,dx. \) $ \rho {\rm{FOD}} = \sum\limits{\sigma ,i} {(\delta _1 - \delta _2 n_i^\sigma ) \phi _i^\sigma ({\bf{r}}) ^2} $ \[\rho {\rm{FOD}} = \sum\limits{\sigma ,i} {(\de... Read More
-
Test markdown
You can write regular markdown here and Jekyll will automatically convert it to a nice webpage. I strongly encourage you to take 5 minutes to learn how to write in markdown - it’ll teach you how to transform regular text into bold/italics/headings/tables/etc. Here is some bold text Here is a secondary heading Here’s a useless table: ... Read More
