摘要:
class Solution { public long maxProfit(int[] prices, int[] strategy, int k) { int n = prices.length; long[] profitSum = new long[n + 1]; long[] prices 阅读全文
摘要:
2581. 统计可能的树根数目 class Solution { int cnt = 0, res = 0; int k; List<Integer>[] g; Set<Long> set; public int rootCount(int[][] edges, int[][] guesses, i 阅读全文
摘要:
2867. 统计树中的合法路径数目 class Solution { private static final int N = 100001; private static boolean[] isPrime = new boolean[N]; static { Arrays.fill(isPrim 阅读全文