最近在看java核心技术,里面有实现repeat方法的代码,用到lambda表达式和Runable接口。 lambda表达式实际上就是传入函数,这样就不用自己写一个实例来实现接口,挺有意思的。 public class learning { public static void main(Strin ...
分类:
编程语言 时间:
2021-01-26 12:01:37
阅读次数:
0
[题目链接] https://atcoder.jp/contests/arc093/tasks/arc093_c [题解] 一个重要的观察是 : 最多只会用一条不在忽略颜色求得的最小生成树上的边。 首先不妨求出最小生成树 , 并计算其权值 \(W\) , 令 \(\delta = X - W\)。 ...
分类:
其他好文 时间:
2021-01-26 12:00:48
阅读次数:
0
登陆MySQL [root@localhost mysql]# /usr/local/mysql/bin/mysql -uroot //未设置密码 [root@localhost mysql]# /usr/local/mysql/bin/mysql -uroot -p //输入密码 mysqladm ...
分类:
数据库 时间:
2021-01-26 11:55:04
阅读次数:
0
思路分析 其实就是递归判断左树和右树,但是一些判断条件需要仔细思考下. cpp /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * ...
分类:
其他好文 时间:
2021-01-26 11:49:40
阅读次数:
0
Two strings are considered close if you can attain one from the other using the following operations: Operation 1: Swap any two existing characters. F ...
分类:
其他好文 时间:
2021-01-25 11:07:52
阅读次数:
0
给定一个 n×nn×n 的二维数组,如下所示: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横 ...
官方文档(在2.x 里面 版本1.0.9 的文档 和演示例子 是没有的) https://www.layui.com/doc/modules/form.html 一,代码 1,官方内置校验规则 单条校验 <!--email 是官方内置的 还有很多 --> <input type="text" lay ...
分类:
其他好文 时间:
2021-01-22 12:15:17
阅读次数:
0
使用python自带的logging日志模块 1.简单设置 import logging # 设置log级别为 info logging.basicConfig(level=logging.INFO) # error > debug > info def run(*args, **kwargs): ...
分类:
编程语言 时间:
2021-01-21 10:53:34
阅读次数:
0
题目链接:https://ac.nowcoder.com/acm/problem/107658 题意:给定一个长度为n的数组,和一个数值s,寻找最小的区间长度,使得区间长度内的数值和 \(\geq\) s 思路:双指针,l和r作为两个区间端点,当区间和<s时,r++,当区间和$\geq$s时l 右移 ...
分类:
其他好文 时间:
2021-01-20 11:58:42
阅读次数:
0
定义简单单链表结构 public class ListNode { public int val; public ListNode next; public ListNode(int val = 0, ListNode next = null) { this.val = val; this.next ...