LeetCode338. Counting Bits

版权声明:本文为博主原创文章,欢迎转载!转载请保留原博客地址。 https://blog.csdn.net/grllery/article/details/85225322 338. Counting Bits Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representatio
分类: 其他 发布时间: 01-01 22:40 阅读次数: 0

LeetCode394. Decode String

394. Decode String Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly ktimes. Note that k is guaranteed to be a positive integer
分类: 其他 发布时间: 01-01 22:39 阅读次数: 0

LeetCode112. Path Sum

版权声明:本文为博主原创文章,欢迎转载!转载请保留原博客地址。 https://blog.csdn.net/grllery/article/details/85252888 112. Path Sum [Easy] Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the giv
分类: 其他 发布时间: 01-01 22:39 阅读次数: 0

LeetCode437. Path Sum III

版权声明:本文为博主原创文章,欢迎转载!转载请保留原博客地址。 https://blog.csdn.net/grllery/article/details/85254963 437. Path Sum III You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not
分类: 其他 发布时间: 01-01 22:39 阅读次数: 0

leetcode substring search problem solve template

https://leetcode.com/problems/find-all-anagrams-in-a-string/discuss/92007/Sliding-Window-algorithm-template-to-solve-all-the-Leetcode-substring-search-problem. Among all leetcode questions, I find that there are at least 5 substring search problem w
分类: 其他 发布时间: 01-01 22:38 阅读次数: 0

LeetCode438. Find All Anagrams in a String

版权声明:本文为博主原创文章,欢迎转载!转载请保留原博客地址。 https://blog.csdn.net/grllery/article/details/85269697 438. Find All Anagrams in a String Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase Engli
分类: 其他 发布时间: 01-01 22:38 阅读次数: 0

LeetCode461. Hamming Distance

461. Hamming Distance The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y < 231. Example: Input: x = 1, y = 4
分类: 其他 发布时间: 01-01 22:38 阅读次数: 0

LeetCode416. Partition Equal Subset Sum

版权声明:本文为博主原创文章,欢迎转载!转载请保留原博客地址。 https://blog.csdn.net/grllery/article/details/85311587 416. Partition Equal Subset Sum Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum
分类: 其他 发布时间: 01-01 22:37 阅读次数: 0

LeetCode581. Shortest Unsorted Continuous Subarray

581. Shortest Unsorted Continuous Subarray Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too. You need to find the sho
分类: 其他 发布时间: 01-01 22:37 阅读次数: 0

Spring Boot-配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kikajack/article/details/85542501 Spring Boot 采用的“默认大于配置”的原则,即使没有配置,也可以使用默认配置正常启动应用。 各种格式的配置文件 默认全局配置文件的文件名是 application,常见的有 application.properties、application.yml(YAML 格式)、application.xml(XML 格式), a
分类: 编程语言 发布时间: 01-01 22:36 阅读次数: 0

synchronized和volatile区别

synchronized和volatile区别 摘自《Java多线程编程核心技术》 关于synchronized和volatile的比较: 关键字volatile是线程同步的轻量级实现,所以volatile性能肯定比synchronized要好,并且只能修改变量,而synchronized可以修饰方法,以及代码块。 多线程访问volatile不会发生阻塞,而synchronized会出现阻塞 volatile能保证数据的可见性,但不能保证原子性;而synchronized可以保证原子性,也可以
分类: 编程语言 发布时间: 01-01 22:36 阅读次数: 0

Android openGl开发详解(二)

https://zhuanlan.zhihu.com/p/35192609 Android openGl开发详解(二)——通过SurfaceView,TextureView,GlSurfaceView显示相机预览(附Demo) aserbao 编程·生活·职场·思维 公众号「aserbao」 > 最近公司在做自定义相机这一块,之前使用的是第三方,后来需求变更,第三方不支持添加动态贴纸,所以只能自己扩展。当然网上有很多例子,但是关于添加动态贴纸的例子几乎找不到,反正我是没找到(欲哭无泪)。当然,
分类: 编程语言 发布时间: 01-01 22:35 阅读次数: 0

HDU 4489

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_40924940/article/details/85539988 有 n 个不同身高但是身高存在一定顺序的人 现在要排队 排成波浪形 即 高矮高矮。。这种 当然 矮高矮高也可以 那么 我们就用 dp[i][k]代表状态 k 为 0 或 1 代表 开始的人是 高还是矮 那么就有 dp[j][0]*dp[i-j-1][1]*c[i-1][j] 代表的就是 第 i 个人加入之后的可能排列数, 但
分类: 编程语言 发布时间: 01-01 22:35 阅读次数: 0

列表中的append,extend,+=,+的区别

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Jerry_1126/article/details/85538680 先来看列表中的append和extend的帮助文档 >>> help(list.append) # 往列表末尾添加对象 Help on method_descriptor: append(...) L.append(object) -> None -- append object to end >>
分类: 编程语言 发布时间: 01-01 22:35 阅读次数: 0

西南民族大学第十届校赛(同步赛)(K题——正方体)

版权声明:本人原创,转载请注明出处! https://blog.csdn.net/qq_29117927/article/details/85542532 题目描述 已知一个正方体,每个面上都有任意一个数(假设每一面的面积足够大来装下当前面上的数字),现被展开成了如下形式: 输入中保证第一行有一个面,第二行有四个面,第三行有一个面。请用代码检查这个正方体对立面上的数是否相同。 输入描述: 输入包含多个测试样例。第一行为一个整数T(1 <= T <= 1e4),接下来每个样例占3行,每行都包括4
分类: 编程语言 发布时间: 01-01 22:34 阅读次数: 0

Euler53

题意: 从五个数12345中选择三个恰好有十种方式,分别是: 123、124、125、134、135、145、234、235、245和345 在组合数学中,我们记作:5C3 = 10。 一般来说, nCr=n!r!(n−r)!n!r!(n−r)!,其中r ≤ n,n! = n×(n−1)×…×3×2×1,且0! = 1。 直到n = 23时,才出现了超出一百万的组合数:23C10 = 1144066。 若数值相等形式不同也视为不同,对于1 ≤ n ≤ 100,有多少个组合数nCr超过一百万?
分类: 编程语言 发布时间: 01-01 22:34 阅读次数: 0

Java设计模式 - 示例教程

Java设计模式 - 示例教程 设计模式在软件开发人员中非常流行。设计模式是针对常见软件问题的良好描述的解决方案。我已经写了很多关于java设计模式的文章。您可以订阅我们的时事通讯下载PDF电子书(130多页)。 Java设计模式 使用设计模式的一些好处是: 设计模式已经定义,并提供行业标准方法来解决重复出现的问题,因此如果我们明智地使用设计模式,它可以节省时间。我们可以在基于java的项目中使用许多java设计模式。 使用设计模式可以提高可重用性,从而实现更强大和高度可维护的代码。它有助于降
分类: 编程语言 发布时间: 01-01 22:34 阅读次数: 0

秒杀业务心路历程

一、第一代秒杀价构 在电商模块直接插入秒杀系统,MYSQL 核心逻辑(通过数据库updata 完成) 假设可以秒杀5台: “updata tbl set count = count+1 where id =101 and count+1 <= 5” 但数据库太慢。 核心逻辑优化: begin; 如果用户无法即可获得锁,则返回错误。从而这个事物回滚。 select 1 from tbl where id=pk updata nowait; updata tbl set count = count
分类: 编程语言 发布时间: 01-01 22:33 阅读次数: 0

Python Flask,数据库,SQLAlchemy,关联查询(多表查询),一对多关联

demo.py(定义模型类,一对多关联): # coding:utf-8 from flask import Flask from flask_sqlalchemy import SQLAlchemy # 导入 app = Flask(__name__) # 通过类对象加载配置。 (配置数据库) class Config(object): """配置参数""" # sqlalchemy的配置参数 SQLALCHEMY_DATABASE_URI = "mysq
分类: 编程语言 发布时间: 01-01 22:33 阅读次数: 0

Vue中ref属性使用的注意事项

Vue中ref属性使用的注意事项 1.在vue中为HTML标签设置ref属性,主要是为了一些需要进行操作DOM才能完成的功能而设置的。 2.ref属性相当于给标签设置了一个ID,可以使用该特殊标识来进行一些DOM的操作,但是使用的时候有如下几个注意事项: ref属性值绑定元素都是唯一的,如果一个ref属性绑定了多个dom节点,那么这个ref属性将会默认绑定到最后设置该ref属性值的DOM节点。 使用时不是直接this.ref值进行访问DOM节点,而是需要通过this.$refs.ref值 进行
分类: 编程语言 发布时间: 01-01 22:33 阅读次数: 0