[Kick Start 2022 Round B] Infinity AreaRead more
[LeetCode] Count Pairs Of Nodes

1782. Count Pairs Of Nodes

You are given an undirected graph defined by an integer n, the number of nodes, and a 2D integer array edges, the edges in the graph, where edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi. You are also given an integer array queries.

Let incident(a, b) be defined as the number of edges that are connected to either node a or b.

The answer to the jth query is the number of pairs of nodes (a, b) that satisfy both of the following conditions:

  • a < b
  • incident(a, b) > queries[j]

Return an array answers such that answers.length == queries.length and answers[j] is the answer of the jth query.

Note that there can be multiple edges between the same two nodes.

Read more
[LeetCode] Maximum Length of Pair Chain

646. Maximum Length of Pair Chain

You are given an array of n pairs pairs where pairs[i] = [lefti, righti] and lefti < righti.

A pair p2 = [c, d] follows a pair p1 = [a, b] if b < c. A chain of pairs can be formed in this fashion.

Return the length longest chain which can be formed.

You do not need to use up all the given intervals. You can select pairs in any order.

Read more
[LeetCode] Largest Divisible Subset

368. Largest Divisible Subset

Given a set of distinct positive integers nums, return the largest subset answer such that every pair (answer[i], answer[j]) of elements in this subset satisfies:

  • answer[i] % answer[j] == 0, or
  • answer[j] % answer[i] == 0

If there are multiple solutions, return any of them.

Read more
[BOJ] 17414 Sebin Loves Euler CircuitRead more
[BOJ] 1178 간선 추가Read more
[BOJ] 1199 오일러 회로Read more
[BOJ] 16168 퍼레이드Read more
[BOJ] 3648 아이돌Read more
[BOJ] 3747 완벽한 선거!Read more