上一页 1 ··· 7 8 9 10 11 12 13 14 15 下一页
摘要: 🤠 原题地址 🤠 超级源点,到所有上商店的距离为 0,而且是有向的,0 -> 商店,某个村庄到商店的距离转为 超级源点 到 商店再 某个村庄的最近距离 🤠 堆(PriorityQueue),找当前已知最短距离的节点的下一个最近的节点时间复杂度 O( logm) import java.io.* 阅读全文
posted @ 2023-03-03 15:01 兑生 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 🐷 输入案列 5 1996 1 2 1994 12 29 🐷 输出案列 2 👵 优先搜索可能方案比较少的分支 🤠 DFS+剪枝:排序,优先处理大的 🤠 枚举 猫?枚举 车?不重不漏,猫放缆车,能放则放,不能放则新开一辆 🤠 dfs 参数:传递方案 🤠 原题地址 🤠 java Arra 阅读全文
posted @ 2023-03-02 22:02 兑生 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 🤠 原题地址 🤠 参考链接 🤠 有向边确定了,就直到有没有解了 import java.io.*; import java.util.Arrays; public class Main { static int N = (int) 2e5 + 10; // 邻接表存图 static int[] 阅读全文
posted @ 2023-03-02 16:27 兑生 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 1. 递归 ① 递归实现指数型枚举 🤠 原题地址 import java.util.*; class Main{ static int N = 16,n; static int[] st = new int[N];// 0 表示默认, 1 表示选 ,2 表示不选 public static voi 阅读全文
posted @ 2023-02-28 16:33 兑生 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 🤠 笨拙的牛蹄 import java.io.*; import java.util.*; public class Main { static int get(char[] a, int b)// 将 b 进制数组组成的数 转换为 10 进制的数 { int res = 0; for (int 阅读全文
posted @ 2023-02-22 10:29 兑生 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 🤠 亲戚 🤠 合并并查集a,b:p[ find(a) ] = find(b) import java.util.*; import java.io.*; public class Main { static int N = 20010; static int[] p = new int[N]; 阅读全文
posted @ 2023-02-21 21:48 兑生 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1. 快速排序 🤠 原题链接 🤠 快速排序+选择性递归 🤠 O( 2n ) import java.util.*; class Main{ static int N = 1010; static int[] q = new int[N]; public static void main(Str 阅读全文
posted @ 2023-02-20 15:54 兑生 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 🤠 参考链接 import java.util.*; public class 数的三次方根 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double n = sc.nextDoub 阅读全文
posted @ 2023-02-20 14:22 兑生 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 🤠 参考链接 🤠 归并求逆序对(分而治之) static int N = 100010; static int[] q = new int[N], tmp = new int[N]; public static void main(String[] args) { Scanner sc = ne 阅读全文
posted @ 2023-02-20 13:21 兑生 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 🤠 原题链接 🤠 快速排序+选择性递归 🤠 O( 2n ) import java.util.*; class Main{ static int N = 1010; static int[] q = new int[N]; public static void main(String[] ar 阅读全文
posted @ 2023-02-20 10:25 兑生 阅读(7) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 下一页
Live2D