Problem : Given an array, rotate the array to the right by k steps, where k is non negative. Example 1: Example 2: Note: Try to come up as many soluti ...
分类:
其他好文 时间:
2020-04-06 18:59:35
阅读次数:
67
Problem : Reverse bits of a given 32 bits unsigned integer. Example 1: Example 2: Note: 思路 : Solution (C++) : 性能 : Runtime: 4 ms Memory Usage: 6.7 MB ...
分类:
其他好文 时间:
2020-04-06 17:33:56
阅读次数:
69
Problem : A peak element is an element that is greater than its neighbors. Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element a ...
分类:
其他好文 时间:
2020-04-05 23:55:14
阅读次数:
129
package LeetCode_1137 /** * 1137. N-th Tribonacci Number * https://leetcode.com/problems/n-th-tribonacci-number/description/ * * The Tribonacci sequen ...
分类:
其他好文 时间:
2020-04-05 09:52:07
阅读次数:
53
为了计算时间更加精确,可以用这个函数去掉LR自身的检查点所浪费的时间。如text check and image time Action() { double time_elapsed, duration, waste; merc_timer_handle_t timer; int m,n; lr_ ...
分类:
其他好文 时间:
2020-04-03 11:50:06
阅读次数:
91
1 完整代码下载 https://pan.baidu.com/s/1JJyVcP2KqXsd5G6eaYpgHQ 提取码 3fzt (压缩包名: 2020-3-24-demo.zip) 2 图片展示 3 主要代码 1 "use strict" 2 3 ;(function (){ 4 5 //是否支 ...
分类:
编程语言 时间:
2020-04-01 01:12:43
阅读次数:
108
Class也是Object 在理解metaclass之前,我们需要先理解Python中的class。从某种程度上来说,Python中的class的定位比较特殊。 对于大部分面向对象语言来说,class是一段定义了如何产生object的代码块。在Python中这一定义也成立: >>> class ex ...
分类:
编程语言 时间:
2020-03-30 16:26:27
阅读次数:
73
https://www.luogu.com.cn/problem/P1879 题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) squar ...
分类:
其他好文 时间:
2020-03-29 09:13:01
阅读次数:
68
"$\color{ 000000}{\texttt {CF526G}}$" 先考虑单次询问。 发现 $y$ 条路径的端点一定是叶子节点,产生的联通块最多会有 $2y$ 个叶子。 但还是不好做。 考虑一个相似的问题 一棵有根树,选 $k$ 个点,最大化这 $k$ 个点到根节点路径的并的大小。 选的点肯 ...
分类:
其他好文 时间:
2020-03-28 16:13:48
阅读次数:
76
单例模式 懒汉式,线程不安全。 除非是单线程程序,否则不推荐使用。 public class Singleton { private static Singleton instance; private Singleton (){} public static Singleton getInstan ...
分类:
其他好文 时间:
2020-03-26 10:47:09
阅读次数:
77