首页 > TAG信息列表 > getVal

闭包测试

(function() {     // -- 基础数据类型     {         function func (val = 0) {             return {                 decrease() {                     val--                 },                 increase() {      

Go select 死锁引发的思考

Go select 死锁引发的思考 https://mp.weixin.qq.com/s/Ov1FvLsLfSaY8GNzfjfMbg一文引发的延续思考 上文总结 总结一 package main import ( "fmt" ) func main() { ch := make(chan int) go func() { select { case ch <- getVal(1): fmt.Println("in first case&qu

TCAX 时间计算及文字定位(英文+谷歌机翻中文)

Introduction To a subtitle effect, the positioning and timing are the most two fundamental yet important aspects. The basic function of TCAX is to provide the required information for the user to deal with these two problems. Time Calculation The basic t

二叉搜索树的绝对最小值

二叉搜索树的最小绝对差 给定一个所有节点为非负值的二叉搜索树,求树中任意两节点的差的绝对值的最小值。 1.采用非递归遍历二叉搜索树 1 public void midOrderTree(Node node){ 2 if (node == null) { 3 return; 4 } 5 Stack<Node> st

CF1293B - JOE is on TV! DP 序列DP 单调性优化

如果f[x]表示有x个对手时候的最大获益。不难看出f[x] = max(f[i] + 1 - i / x)。i表示这次答题后剩下几个队首。 不难看出,随着x的增加,最大转移的i也是单调的,然后单调性优化下就可以了。 1 #include <cstdio> 2 using namespace std; 3 int n,l; 4 double f[110000]; 5 doubl