上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: 思路很简单: import java.util.ArrayList; import java.util.List; class TreeAncestor { List<Integer>[] children; List<List<Integer>> paths = new ArrayList<>() 阅读全文
posted @ 2024-04-06 18:47 fishcanfly 阅读(17) 评论(0) 推荐(0)
摘要: 解法: trie树 import java.util.*; class Solution { int m, n; char[][] board; String[] querys; public static void main(String[] args) { Solution solution = 阅读全文
posted @ 2024-04-06 15:31 fishcanfly 阅读(19) 评论(0) 推荐(0)
摘要: D - Popcount and XOR easy. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; i 阅读全文
posted @ 2024-03-31 23:21 fishcanfly 阅读(57) 评论(0) 推荐(0)
摘要: How to slove this problem? If we reverse the strings, the problem changes to finding the longest common prefix. Build a Trie, each node is a letter an 阅读全文
posted @ 2024-03-24 16:15 fishcanfly 阅读(24) 评论(0) 推荐(0)
摘要: 题目链接:problem D 解法: 比较简单。看代码。 import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamTokenizer; import java.util.Set; impor 阅读全文
posted @ 2024-03-16 22:38 fishcanfly 阅读(75) 评论(0) 推荐(0)
摘要: 题目链接: https://acm.hdu.edu.cn/showproblem.php?pid=4427 解法: 题目m范围较小$m\leq 1000$,n 范围也较小 $n\leq 1000$, $k\leq 100$ 可以枚举m的约数,很容易知道不会超过32个。 对于$\sum factor[ 阅读全文
posted @ 2024-03-16 20:29 fishcanfly 阅读(17) 评论(0) 推荐(0)
摘要: \begin{bmatrix}1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\end{bmatrix} 阅读全文
posted @ 2024-02-08 22:52 fishcanfly 阅读(20) 评论(0) 推荐(0)
摘要: import java.util.HashMap; import java.util.Map; class Solution { public static void main(String[] args) { Solution solution = new Solution(); long ans 阅读全文
posted @ 2023-12-01 20:56 fishcanfly 阅读(57) 评论(0) 推荐(0)
摘要: 地址:https://zhuanlan.zhihu.com/p/459579152 我这里翻译一下官方的文档。 首先需要满足几个性质。 (注意 ∗ 是个操作,不是单纯的一个乘号) 1)操作满足结合律 即 (a∗b)∗c=a∗(b∗c)2)操作需要有个幺元(基本元/单位元) a∗e=e∗a=a 如果你 阅读全文
posted @ 2023-12-01 11:03 fishcanfly 阅读(319) 评论(0) 推荐(1)
摘要: 本题可以用线段树+二分的方式实现。代码如下: import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StreamTokenizer; // Pr 阅读全文
posted @ 2023-12-01 10:38 fishcanfly 阅读(24) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 11 下一页
//雪花飘落效果