CSS
Media query: https://developer.mozilla.org/en-US/docs/Web/CSS/@media CSS Box Alignment source first-child first-of-type <div class="parent"> <h1>Child</h1> <!--...
Media query: https://developer.mozilla.org/en-US/docs/Web/CSS/@media CSS Box Alignment source first-child first-of-type <div class="parent"> <h1>Child</h1> <!--...
Dan Saks. (2001). Lvalues and Rvalues Lvalue-ness is a compile-time property Every expression is either an lvalue or an rvalue An object is a manipulatable region of st...
前言 本文的主体内容取自于本人十年前在百度帖吧三国杀吧的一篇帖子:【理论】数学与三国杀——三国杀武将技能概率。现加以整理、改进和删增。 本文通过研究《三国杀》中部分武将技能所涉及的概率与期望,对这些技能的强度与收益进行定量刻画,从而为玩家在特定对局中的选将、技能发动时机及出牌顺序提供决策参考。 研究范围 卡牌 本文只考察军争篇卡牌。其点数、花色以及类型具体分布如下: (图片来...
Acyclic Graph flowchart LR A([Acyclic Graph]) --> B{Directed?} B -->|Yes| C[DAG] B -->|No| D{Forest} D --> E{Connected?} E -->|Yes| F{Tree} A topological sorti...
Non-Overlapping Segments Number of Sets of K Non-Overlapping Line Segments Reverse Pairs Examples: Count of Smaller Numbers After Self Reverse Pairs Number of Pairs Satisfying Inequality...
Number of Sets of K Non-Overlapping Line Segments private static final int MOD = (int)1e9 + 7; public int numberOfSets(int n, int k) { long[][] dp = new long[n][k + 1]; dp[0][0] = 1; ...
Fenwick tree (Binary indexed tree) A Fenwick tree or binary indexed tree is a data structure that can efficiently update elements and calculate prefix sums in a table of numbers. public class Fen...
Redis Redis (Remote Dictionary Server) Documentation Redis Cluster Interview questions In-memory key-value data store. Stores cache data into physical storage if needed. Executes ultra...
Check if There is a Valid Partition For The Array public boolean validPartition(int[] nums) { boolean[] dp = {true, false, nums[0] == nums[1], false}; int n = nums.length; for (int i =...
Minimum Amount of Time to Fill Cups public int fillCups(int[] amount) { int max = 0, sum = 0; for (int a : amount) { max = Math.max(max, a); sum += a; } // 1 cup of...