- 博客(15)
- 收藏
- 关注
原创 蓝桥杯之直线题解
class Node{ public double k; public double b; public Node(double k, double b) { this.k = k; this.b = b; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || get.
2022-04-03 23:43:58 320
原创 蓝桥杯第十二届B组之路径
动态规划做法public class SenvenB { public static long f(int m,int n){ long i = m; long j = n; while(j != 0){ long tmp = j; j = i % j; i = tmp; } return (m * n) / i; } publi.
2022-03-31 21:48:57 144
原创 第十届蓝桥杯省赛之迷宫
010101010010110010010101100101101001000010001010100000100010000010101001000010000000100110011010010101111011010010001000001101001011100011000000010000010000000010101000110100001010000010101010110010110001111100000010100001001010001010000010110...
2022-03-27 20:31:29 154
原创 蓝桥杯之剪邮票
import java.util.LinkedList;public class SenvenB { public static LinkedList<Integer> path = new LinkedList<>(); public static int[][] map; public static int count = 0; public static void f(int[][] m,int i,int j){//进行连通性检测 .
2022-03-21 09:13:52 97
原创 蓝桥杯之方格填数
暴力解法干他。。。dfs进行处理import java.util.Arrays;import java.util.LinkedList;public class SenvenB { public static int count = 0; public static LinkedList<Integer> path = new LinkedList<>(); public static void dfs(int[][] map,int row,i.
2022-03-20 21:04:30 437
原创 第七届蓝桥杯省赛B组部分题目代码
package LQseven;/*//第一题 171700public class proGame { public static void main(String[] args){ int num = 1; int sum = 0; int n = 2; for(int i = 1;i <= 100;i++){ sum += num; num += n; .
2022-03-13 11:25:13 945
原创 蓝桥杯刷题之dfs
public class BRTdfs2 { public static char[][] map = new char[5][5]; public static int min = 999999; public static int[][] ArrNum = new int[5][5]; public static void dfs(int i,int j,int step){ if (map[i][j] == 'B') { ...
2022-03-11 08:30:22 168
原创 蓝桥杯之刷题巧用进制
利用3的倍数算砝码问题:巧妙转化为进制的问题package test10;import java.util.ArrayList;import java.util.List;import java.util.Scanner;public class test { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextIn
2022-03-09 21:39:03 233
原创 蓝桥杯之刷题篇
import java.util.ArrayList;import java.util.LinkedList;import java.util.List;public class test5 { public static LinkedList<Integer> path = new LinkedList<>(); public static List<List<Integer>> result = new ArrayLis...
2022-03-09 18:56:56 141
原创 蓝桥杯之解数独
今天刚刚敲得代码,刚刚学会的public class test3 { public static int[][] map; public static boolean isValid(int[][] map,int row,int col,int num){ for(int i = 0;i < 9;i++){ if(map[i][col] == num){ return false;
2022-03-09 15:56:58 88
原创 蓝桥杯准备之题目
切割字符串package test6;import java.util.HashSet;import java.util.Set;import java.util.Stack;public class test2 { public static void main(String[] args){ String words = "bbaaabcaba"; int len = words.length(); int max = 0; .
2022-03-09 15:53:19 87
原创 蓝桥杯准备之习题练习
package test8;import java.util.ArrayList;import java.util.HashSet;import java.util.Iterator;import java.util.Set;public class test1 { public static boolean SNum(int num){ Set<Integer> set = new HashSet<>(); set....
2022-03-08 16:17:14 200
原创 蓝桥杯准备之回溯算法
回溯算法应用组合里面:对应力扣77题利用的就是回溯算法,去深探找到组合public static List<List<Integer>> result = new ArrayList<>();public static LinkedList<Integer> path = new LinkedList<>();public static void main(String[] args){ dfs(4,2,1); Sys
2022-02-24 20:38:35 396
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人