일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Netflix
- 넷플릭스
- usaco
- 추천
- kakao
- coding
- 리뷰
- BOJ
- 영어
- 알고리즘
- Algorithm
- review
- silver
- 완전탐색
- BFS
- 해설
- 카카오
- parametric search
- 코딩 테스트
- 나는솔로
- 2020
- Greedy
- 영화
- Recursive
- Movie
- benefits
- 백준
- health
- 수능
- array
- Today
- Total
목록Algorithm (26)
Young
https://stackoverflow.com/questions/9444714/how-is-quicksort-is-related-to-cache/9444866#9444866 How is quicksort is related to cache? I have seen many places say quicksort is good because it fits to cache-related stuff, such as said in wiki Additionally, quicksort's sequential and localized memory references work well with a ... stackoverflow.com 퀵 정렬은 in-place 정렬 입니다. in-place란 추가적인 공간을 요구하지 않..
https://www.acmicpc.net/problem/14172 14172번: Moocast Write a single line of output containing the maximum number of cows a broadcast from a single cow can reach. The originating cow is included in this number. www.acmicpc.net 소들이 메시지 전달할 수 있는지는 O(N^2)으로 모두 조사합니다. 문제에도 나와있지만, 한 가지만 주의하면 됩니다. (A -> B로 갈 수 있다) != (B - > A로 갈 수 있다) 두 소의 워키토키의 power에 따라 메시지를 보낼 수 있는지를 조사해봐야 합니다. 모두 조사를 한 다음, 모든 소들을 ..
https://www.acmicpc.net/problem/14464 14464번: 소가 길을 건너간 이유 4 문제 농부 존의 소들은 효율적으로 길을 건너는 방법을 터득하고 있다. 그들은 길 건너기의 달인인 닭의 도움을 받기로 했다. 안타깝게도 닭은 매우 바쁜 동물이라, 소를 도와줄 시간이 별로 없다. 농장에 C마리(1 ≤ C ≤ 20,000)의 닭이 있고, 1번부터 C번까지 번호가 붙어 있다. i번 닭은 정확히 Ti초에만 소를 도와줄 수 있다. 하지만 닭은 길 건너기의 달인이므로 소를 데리고도 순식간에 길을 건널 수 있다. 소는 할 일이 없어서 여유롭게 길을 건 www.acmicpc.net 1. 처음 시도했던 틀린 풀이 - '대체제(도와줄 수 있는 닭의 수)가 적은 소들을 우선적으로 처리해주자' (gre..
https://www.acmicpc.net/problem/11975 11975번: Build Gates The first line of input contains \(N\) (\(1 \leq N \leq 1000\)). The next line contains a string of length \(N\) describing FJ's path. Each character is either N (north), E (east), S (south), or W (west). www.acmicpc.net 이번 문제는 문제는 참 이해하기 쉽고, 직관적인데 반해 이걸 구현하려니 불편한 점이 한가지가 있습니다. 보통은 정점을 타고 들어가면서 flood fill을 수행해야 하는데 정점 사이를 이어서 fence를 놓는다는 ..
https://www.acmicpc.net/problem/11973 11973번: Angry Cows (Silver) The first line of input contains \(N\) (\(1 \leq N \leq 50,000\)) and \(K\) (\(1 \leq K \leq 10\)). The remaining \(N\) lines all contain integers \(x_1 \ldots x_N\) (each in the range \(0 \ldots 1,000,000,000\)). www.acmicpc.net 이 문제는 parametric search + greedy 문제입니다. greedy는 증명이 대체로 어렵습니다. 그냥 감으로 이러면 되겠군.. 이 문제의 경우 greedy 증명이 크게..
https://www.acmicpc.net/problem/11974 11974번: Subsequences Summing to Sevens Farmer John's \(N\) cows are standing in a row, as they have a tendency to do from time to time. Each cow is labeled with a distinct integer ID number so FJ can tell them apart. FJ would like to take a photo of a contiguous group of cows but, due to a trau www.acmicpc.net 이 문제는 기본 pre-sum을 구한다는 건 쉽게 알 수 있으나, 그것을 조금만 응용하..
https://codeforces.com/contest/1136/problem/D Problem - D - Codeforces codeforces.com 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 #include // 중요 포인트 // 1. 주인공이 앞에 있는 사람 a와 교체를 못하면, a는 주인공 앞에 계속 남아있음. // 2. 주인공과 사람 a와 교체할 수 있다면, a는 영원히 무시해도 됨. // (증명) 가정 : a를 무시했는데, 주인공이 앞으로 갈 수 있는 기회가 상실됨 -> a가 앞에 있는 b에게 단독으로 영향을 줌 -> // a가 있어서 b를 주인공 앞으로 데려올 있음. ..
1. what stable sort ? [출처 : https://www.geeksforgeeks.org/stability-in-sorting-algorithms/ ] stable sort란 무엇일까요? 아래 공들은 정렬이 된 상태입니다. 정렬되기 전과 비교했을 때 특징이 있습니다.그것은 공의 숫자는 정렬되었지만, 같은 숫자를 가진 공 사이에 색깔은 들어온 순서를 유지한다는 것입니다.이것이 바로 stable sort 의 개념! 입니다. (unstable sort 는? 그 반대겠죠. 그냥 막 섞입니다.) 2. why stable sort ? 그럼 이 stable sort가 왜 중요할까요? 예 ) 데이터가 들어온 순서는 유지하면서, 특정 key 값을 기준으로 sorting하고 싶을 때 그냥 아무생각 없이 so..