06 2022 档案

摘要:class Solution { public int maximumsSplicedArray(int[] nums1, int[] nums2) { int n = nums1.length; int[] b = new int[n]; int[] c = new int[n]; dp(nums 阅读全文
posted @ 2022-06-26 19:54 fishcanfly 阅读(35) 评论(0) 推荐(0)
摘要:要特别注意下精度,long,int范围。WA了几次 import java.util.Scanner; class Main { // static long[] A2 ;//i^2*AI // static long[] A1;//i*Ai; static long[] A; //Ai; stat 阅读全文
posted @ 2022-06-24 10:54 fishcanfly 阅读(56) 评论(2) 推荐(0)
摘要:import java.util.*; class Solution { public static void main(String[] args) { Solution solution = new Solution(); System.out.println(solution.minimumN 阅读全文
posted @ 2022-06-22 16:38 fishcanfly 阅读(48) 评论(0) 推荐(0)
摘要:class Solution { public static void main(String[] args) { Solution solution = new Solution(); System.out.println(solution.longestSubsequence("1001010" 阅读全文
posted @ 2022-06-22 15:57 fishcanfly 阅读(44) 评论(0) 推荐(0)
摘要:class Solution { public static void main(String[] args) { Solution solution = new Solution(); solution.countSubarrays(new int[]{ 2,1,4,3,5 },10); } pu 阅读全文
posted @ 2022-06-17 18:44 fishcanfly 阅读(42) 评论(0) 推荐(0)
摘要:import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) t 阅读全文
posted @ 2022-06-12 19:14 fishcanfly 阅读(63) 评论(0) 推荐(0)
摘要:import java.util.HashSet; import java.util.Set; class Solution { public long distinctNames(String[] ideas) { int[][] cnt = new int[26][26]; boolean[][ 阅读全文
posted @ 2022-06-12 17:29 fishcanfly 阅读(28) 评论(0) 推荐(0)
摘要:class Solution { public int minFlipsMonoIncr(String s) { int len = s.length(); int[][] dp = new int[len][2]; if (s.charAt(0) == '0') { dp[0][0] = 0; d 阅读全文
posted @ 2022-06-11 19:15 fishcanfly 阅读(20) 评论(0) 推荐(0)
摘要:import java.util.Arrays; class Solution { public int numSubseq(int[] nums, int target) { Arrays.sort(nums); int len = nums.length; long ans = 0l; for 阅读全文
posted @ 2022-06-08 21:49 fishcanfly 阅读(29) 评论(0) 推荐(0)
摘要:class Solution { public int minEatingSpeed(int[] piles, int h) { int ans = 0; int low = 1; int high = 1000000001; while(low<high){ int mid = ( low +hi 阅读全文
posted @ 2022-06-07 18:46 fishcanfly 阅读(26) 评论(0) 推荐(0)
摘要:class Solution { public static void main(String[] args) { Solution solution = new Solution(); int ans = solution.videoStitching(new int[][]{ {8,10},{1 阅读全文
posted @ 2022-06-07 11:06 fishcanfly 阅读(126) 评论(0) 推荐(0)
摘要://只需要考虑前6位的状态,i这种状态和i+6这个状态是一样的import java.util.ArrayDeque; import java.util.Arrays; import java.util.HashSet; class Solution { public static void mai 阅读全文
posted @ 2022-06-06 17:09 fishcanfly 阅读(33) 评论(2) 推荐(0)
摘要:class MyCalendarThree { private TreeMap<Integer, Integer> cnt; public MyCalendarThree() { cnt = new TreeMap<Integer, Integer>(); } public int book(int 阅读全文
posted @ 2022-06-06 15:29 fishcanfly 阅读(35) 评论(0) 推荐(0)
摘要:class MyCalendarThree { public static void main(String[] args) { MyCalendarThree myCalendarThree = new MyCalendarThree(); System.out.println( myCalend 阅读全文
posted @ 2022-06-06 15:00 fishcanfly 阅读(39) 评论(0) 推荐(0)
摘要:import java.io.IOException; import java.util.Scanner; public class Main { static int MOD = 1000000007; public static void main(String[] args) throws I 阅读全文
posted @ 2022-06-03 21:20 fishcanfly 阅读(58) 评论(0) 推荐(0)
摘要:class Solution { int[] parent; int[] rank; public void init(int n) { parent = new int[n + 1]; rank = new int[n + 1]; for (int i = 1; i <= n; i++) { pa 阅读全文
posted @ 2022-06-03 18:33 fishcanfly 阅读(35) 评论(0) 推荐(0)
摘要://空间可以降到2维class Solution { private int MOD= 1000000007; public int profitableSchemes(int n, int minProfit, int[] g, int[] profit) { int len = profit.l 阅读全文
posted @ 2022-06-03 16:47 fishcanfly 阅读(47) 评论(0) 推荐(0)
摘要:import java.util.HashMap; import java.util.Map; /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeN 阅读全文
posted @ 2022-06-02 15:38 fishcanfly 阅读(46) 评论(1) 推荐(0)
摘要://先求出和为edge的划分。再枚举划分,至多只需要枚举三个划分import java.util.ArrayList; import java.util.List; class Solution { int edge = 0; List<Integer> stateList = new ArrayL 阅读全文
posted @ 2022-06-01 20:33 fishcanfly 阅读(46) 评论(0) 推荐(0)

//雪花飘落效果