原创 [Translate]CP-Algorithms:LowestCommonAncestor-BinaryLifting

一、原鏈接 翻譯原鏈接:CP-Algorithms:LowestCommonAncestorBinaryLifting 二、翻譯 最近公共祖先 - 二元提升 目錄 算法介紹 算法應用 簡介 假如G是一棵樹。對於每一次輸入爲(

原创 [PAT]1096 Consecutive Factors (20分)(樣例3、5、6未過原因)

一、題目 Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 c

原创 [PAT]1064 Complete Binary Search Tree (30 分)

一、題意 A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left su

原创 [leetcode]5175. Can Make Palindrome from Substring

一、題意 Given a string s, we make queries on substrings of s. For each query queries[i] = [left, right, k], we may rearran

原创 [PAT]1103 Integer Factorization (30分)

1103 Integer Factorization (30分) 一、題目 The K−P factorization of a positive integer N is to write N as the sum of the

原创 [PAT]1091 Acute Stroke (30分)(樣例5未過原因)

一、題目: 略 二、分析 使用BFS。 三、代碼 #include <iostream> #include <vector> #include <queue> using namespace std; int M, N, L,

原创 [dp]雙蛋問題&&李永樂老師視頻

一、背景 今天看李永樂老師的科普視頻,裏面提到的雙蛋問題很有意思。思考了下發現是動態規劃問題,特此記錄。李老師的視頻視頻點擊這裏裏講解的很清楚,在此寫下自己的理解。 二、題意 假設有一座大樓,共T層(T>=1),你有N個雞蛋(N>