【原题】 Note that the memory limit is unusual. You are given a multiset consisting of nn integers. You have to process queries of two types: add integer ...
分类:
其他好文 时间:
2020-07-21 21:33:29
阅读次数:
83
遇到经典问题 func mian() { resslice := []int{1, 2, 3, 4} for _, v := range resslice { fmt.Println(v) defer fun1(v) } } func fun1(value int) { fmt.Println(va ...
分类:
其他好文 时间:
2020-07-21 13:42:40
阅读次数:
52
解题思路:一开始不知道怎么下手,暴力遍历也没有合适的方法。参考了题解,了解到回溯算法,结合他人的代码,写了出来 借用题解的决策树图: 1 //参考了题解的回溯算法 2 public static List<List<Integer>> combinationSum(int[] candidates, ...
分类:
其他好文 时间:
2020-07-21 01:00:33
阅读次数:
67
1 /** 2 * 获取值的区间 3 * 4 * @param num 值 5 */ 6 public static Map<String, Integer> getNumSection(Integer num) { 7 Map<String, Integer> map = new HashMap( ...
分类:
编程语言 时间:
2020-07-20 13:07:55
阅读次数:
75
参考: https://www.cnblogs.com/En-summerGarden/p/10145295.html //只能输入整数 function Integer(obj) { if (obj.value.length == 1) { obj.value = obj.value.replac ...
分类:
Web程序 时间:
2020-07-20 10:56:19
阅读次数:
153
1.1题目 给定一个已按照升序排列 的有序数组,找到两个数使得它们相加之和等于目标数。函数应该返回这两个下标值 index1 和 index2,其中 index1 必须小于 index2。 说明: 返回的下标值(index1 和 index2)不是从零开始的。 你可以假设每个输入只对应唯一的答案,而 ...
分类:
编程语言 时间:
2020-07-20 10:49:07
阅读次数:
66
####报文格式 {"name":"文件名","out":"文件字节码"} ####通过接口下载远程文件 public void downloadFrom(HttpServletResponse res, HttpServletRequest request, Integer id) throws ...
分类:
Web程序 时间:
2020-07-20 10:31:48
阅读次数:
106
概述 ThreadLocal提供了一种线程安全的数据访问方式,每个线程中都存在一个共享变量副本,从而实现多线程状态下的线程安全。 demo public static void main(String[] args) { final ThreadLocal<Integer> MAIN = Threa ...
分类:
其他好文 时间:
2020-07-19 23:56:13
阅读次数:
81
##题目 Pasha loves to send strictly positive integers to his friends. Pasha cares about security, therefore when he wants to send an integer n, he encry ...
分类:
其他好文 时间:
2020-07-19 23:37:51
阅读次数:
80
1.装箱 基本类型直接赋值一个引用类型 Integer I = 10; 拆箱 int i = I; 实际为 Integer I = Integer.valueOf(10); int i = I.intValue(); 2.枚举(enum) 简单情况下,与其他语言的enum相似 enum Light ...
分类:
编程语言 时间:
2020-07-19 23:33:12
阅读次数:
65