题目 题目链接:http://codeforces.com/problemset/problem/1511/D 定义一个字符串 \(s\) 的花费为满足 \(s_i=s_j\) 且 \(s_{i+1}=s_{j+1}\) 的数对 \((i,j)\) 的数量(\(0 \leq i<j<|s|-1\)) ...
分类:
其他好文 时间:
2021-04-30 12:45:53
阅读次数:
0
https://leetcode-cn.com/problems/frog-jump/ 思路: 待补充 class Solution { private Boolean[][] rec; public boolean canCross(int[] stones) { int n = stones.l ...
分类:
其他好文 时间:
2021-04-30 12:33:41
阅读次数:
0
problem 892. Surface Area of 3D Shapes solution#1: code 注意,不是简单的投影面积的2倍; 参考 1. leetcode_easy_math_892. Surface Area of 3D Shapes; 2. Grandyang; 完 ...
分类:
其他好文 时间:
2021-04-29 11:47:25
阅读次数:
0
package com.example.leetcode; import java.util.*; /** * @description: 40. 组合总和 II * 给定一个数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的 ...
分类:
其他好文 时间:
2021-04-28 12:01:50
阅读次数:
0
\(\text{Problem}:\)Sky Full of Stars \(\text{Solution}:\) 答案即总方案数减去没有一行或一列是同种颜色的方案数。 设 \(f_{i,j}\) 表示恰好有 \(i\) 行 \(j\) 列是同种颜色的方案数,\(g_{i,j}\) 表示钦定有 \( ...
分类:
其他好文 时间:
2021-04-28 11:55:09
阅读次数:
0
给定二叉搜索树的根结点 root,返回值位于范围 [low, high] 之间的所有结点的值的和。 示例 1: 输入:root = [10,5,15,3,7,null,18], low = 7, high = 15输出:32示例 2: 输入:root = [10,5,15,3,7,13,18,1,n ...
分类:
其他好文 时间:
2021-04-27 15:25:18
阅读次数:
0
P1972 [SDOI2009]HH的项链 莫队模板题,但是有点点卡常,需要用一些技巧进行优化 (1)奇偶优化 (2)快读快写 (3)把块的大小开大一点取$n^{0.5+}$效果会好一些 (4)把 add 和 del 函数展开,不以函数的形式,会块一点点,但并不会快太多 // Created by ...
分类:
其他好文 时间:
2021-04-27 14:37:58
阅读次数:
0
在Ubuntu平台安装QT时,遇到Could not load the Qt platform plugin "xcb" ...
分类:
系统相关 时间:
2021-04-26 13:57:35
阅读次数:
0
First reader and writers problem (读者优先) no reader be kept waiting unless a writer has obtain permission to write semaphore rw=1, readcnt_m=1; int read ...
分类:
其他好文 时间:
2021-04-26 13:39:39
阅读次数:
0
二叉树——113. 路径总和 II 题目: 思路: 前序遍历+回溯 代码参考:https://leetcode-cn.com/problems/path-sum-ii/solution/cqian-xu-bian-li-jia-hui-su-by-qing-feng-seve/ 代码: class ...
分类:
其他好文 时间:
2021-04-26 13:26:18
阅读次数:
0