본문 바로가기

뇌세포덩어리""/알고리즘

(18)
백준 플래티넘5 기념샷 요건 골드1 마지막 지점 샷 (플레5까지 -1점 ㅋ)  짜잔! 목표는 한달이였지만 두달 넘게 걸렸다. (꽤나 어려웠다..)사실 골드2문제부터는 거의 못풀다 싶히 했다. 이렇게 어려운걸 사람들은 어떻게 푸는거지???지금도 나의 실력은 골드3~4사이라 생각한다.코테 준비하느라 시작했지만, 새로운 문제를 발견할때마다 재미있긴하다. 못풀어서 그렇지..ㅎㅎ푸는게 중요한게 아닌 재미를 잊지 않았으면 한다.
BM25(Okapi BM25) 바쁘신 분들을 위한 결론 BM25는 단어의 빈도수가 같을 경우 문서의 길이가 길수록 낮은 score를 가진다. 다른 문서에 잘 등장하지 않는 단어 a를 포함한 문서는 a의 빈도수가 높지 않아도 높은 score를 가진다. 같은 단어가 너무 많이 등장하면 낮은 score를 가진다. BM25 : 키워드 기반의 랭킹 알고리즘 BM25(a.k.a Okapi BM25)는 주어진 쿼리에 대해 문서와의 연관성을 평가하는 랭킹 알고리즘으로, TF-IDF 계열의 검색 알고리즘 중 SOTA(State-of-the-art) 엘라스틱서치에서도 ElasticSearch 5.0서부터 기본(default) 유사도 알고리즘으로 BM25 알고리즘을 채택 BM25 살펴보기 BM25는 Bag-of-words 개념을 사용하여 쿼리에 있는 용..
[baekjoon] dfs / bfs https://www.acmicpc.net/problem/4963 4963번: 섬의 개수입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스의 첫째 줄에는 지도의 너비 w와 높이 h가 주어진다. w와 h는 50보다 작거나 같은 양의 정수이다. 둘째 줄부터 h개 줄에는 지도www.acmicpc.net https://www.acmicpc.net/problem/2468
[baekjoon] union-find https://www.acmicpc.net/problem/1717 1717번: 집합의 표현초기에 $n+1$개의 집합 $\{0\}, \{1\}, \{2\}, \dots , \{n\}$이 있다. 여기에 합집합 연산과, 두 원소가 같은 집합에 포함되어 있는지를 확인하는 연산을 수행하려고 한다. 집합을 표현하는 프로그램을 작www.acmicpc.net
[baekjoon] dijkstra 문제들 https://www.acmicpc.net/problem/1261 1261번: 알고스팟 첫째 줄에 미로의 크기를 나타내는 가로 크기 M, 세로 크기 N (1 ≤ N, M ≤ 100)이 주어진다. 다음 N개의 줄에는 미로의 상태를 나타내는 숫자 0과 1이 주어진다. 0은 빈 방을 의미하고, 1은 벽을 의미 www.acmicpc.net https://www.acmicpc.net/problem/2665 2665번: 미로만들기 첫 줄에는 한 줄에 들어가는 방의 수 n(1 ≤ n ≤ 50)이 주어지고, 다음 n개의 줄의 각 줄마다 0과 1이 이루어진 길이가 n인 수열이 주어진다. 0은 검은 방, 1은 흰 방을 나타낸다. www.acmicpc.net https://www.acmicpc.net/problem/1835..
[leetcode] dijkstra https://leetcode.com/problems/network-delay-time/description/ Network Delay Time - LeetCode Network Delay Time - You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), where ui is the source node, vi is the target node, and wi is the time it takes for a leetcode.com https://leetcode.com/problems/path-wi..
[leetcode] union find 문제들 https://leetcode.com/problems/find-if-path-exists-in-graph/description/ Find if Path Exists in Graph - LeetCodeFind if Path Exists in Graph - There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1 (inclusive). The edges in the graph are represented as a 2D integer array edges, where each edges[i] = [ui, vi] denotes a bi-directleetcode.com https://leetcode.c..
[leetcode] dfs / bfs 재밌는 문제들 https://leetcode.com/problems/surrounded-regions/ Surrounded Regions - LeetCode Surrounded Regions - Given an m x n matrix board containing 'X' and 'O', capture all regions that are 4-directionally surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. Example 1: [https://assets.leetcode. leetcode.com https://leetcode.com/problems/count-servers-that-com..