摘要: class Solution { List<List<String>> res; //检查 列+主对角+负对角 boolean[] cols; boolean[] poss; boolean[] negs; char[][] t; int m ; public List<List<String>> 阅读全文
posted @ 2021-08-24 08:53 常熟阿诺 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 1.修改host 找到C:\Windows\System32\drivers\etc路径下的hosts文件,加上这么两行 127.0.0.1 eureka7001.com 127.0.0.1 eureka7002.com 2.修改yml 以前是单机,搂一搂 server: port: 7001 eu 阅读全文
posted @ 2021-05-04 19:43 常熟阿诺 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 前缀和的应用场景是,需要对某个区间[i...j]频繁查询累计和,避免每次查询都遍历这个区间。 差分数组的应用场景是,需要对某个区间[i...j]频繁地加或减某一值,避免每次都遍历这个区间。 dif数组本质是对[l,r]区间,dif[l]+=x,dif[r+1]-=x; 使用n的dif数组为什么要判断 阅读全文
posted @ 2021-02-19 22:24 常熟阿诺 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 抽象类和接口的区别 抽象类是用来捕捉子类的通用特性的。所以当基本功能在不断变化时,就要用抽象类。如果这个时候用接口,那就要改变所有实现接口的类。 接口是抽象方法的集合,更注重于功能本身。多继承必须使用接口。 抽象方法 普通类不能有抽象方法,只有抽象类才有。 抽象方法没有方法体。 如果一个抽象的int 阅读全文
posted @ 2021-02-10 10:41 常熟阿诺 阅读(51) 评论(0) 推荐(0) 编辑
摘要: private int GetMaxInN(int[] A,int k){ int len=A.length; int l=0,r=0; //+1是为了对齐 没有其他作用 int[] freq=new int[len+1]; int count=0; int res=0; //基本工作完成了 开始遍 阅读全文
posted @ 2021-02-09 20:19 常熟阿诺 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 最多比恰好要好 好很多 所以恰好n可以转换成 最多n-最多n-1 子串和排列的区别: 123 13是排列不是子串 阅读全文
posted @ 2021-02-09 17:58 常熟阿诺 阅读(28) 评论(0) 推荐(0) 编辑
摘要: class U{ int n; int cal; int[] ancinents; int[] bros; public U(U u){ this.n=u.n; this.cal=u.cal; this.ancinents=new int[n]; this.bros=new int[n]; for( 阅读全文
posted @ 2021-02-02 16:41 常熟阿诺 阅读(71) 评论(0) 推荐(0) 编辑