代码随想录打卡|Day45 图论(孤岛的总面积 、沉没孤岛、水流问题、建造最大岛屿)

图论part03


孤岛的总面积

代码随想录链接
题目链接
视频讲解链接

在这里插入图片描述
在这里插入图片描述

思路:既然某个网格在边界上的岛屿不是孤岛,那么就把非 孤岛的所有岛屿变成海洋,最后再次统计还剩余的岛屿占据的网格总数即可。

dfs:

import java.util.Scanner;public class Main{static int res = 0;static int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};// TODO 4.dfs遍历逻辑private static void dfs(int[][] graph , int x , int y){graph[x][y] = 0;for(int i = 0 ; i < 4 ; i++){int nextX = x + dir[i][0];int nextY = y + dir[i][1];if(nextX < 0 || nextY < 0 || nextX >= graph.length || nextY >= graph[0].length) continue;if(graph[nextX][nextY] == 1){graph[nextX][nextY] = 0;dfs(graph,nextX,nextY);}}}public static void main(String[] args){// TODO 1.生成graphScanner sc = new Scanner(System.in);int n = sc.nextInt();int m = sc.nextInt();int[][] graph = new int[n][m];for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){graph[i][j] = sc.nextInt();}}// sc.colse();// TODO 2.仅对四个边进行遍历,遇到陆地的时候将该陆地和与之相邻的陆地全部变为海洋for(int i = 0; i < n ; i++){if(graph[i][0] == 1){dfs(graph,i,0);}}for(int i = 0; i < n ; i++){if(graph[i][m - 1] == 1){dfs(graph,i,m-1);}}for(int j = 0 ; j < m ; j++){if(graph[0][j] == 1){dfs(graph,0,j);}}for(int j = 0 ; j < m ; j++){if(graph[n - 1][j] == 1){dfs(graph,n-1,j);}}// TODO 3.遍历图,获取所有岛屿土地数量int sum = 0 ;for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){if(graph[i][j] == 1 ){sum++;                }}}System.out.println(sum);}
}

bfs:

import java.util.*;public class Main{static int res = 0;static int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};// TODO 4.bfs遍历逻辑private static void bfs(int[][] graph , int x , int y){class Node{int x;int y;public Node(int x , int y){this.x = x;this.y = y;}}Queue<Node> queue = new LinkedList<>();queue.add(new Node(x,y));graph[x][y] = 0;while(!queue.isEmpty()){Node node = queue.remove();for(int i = 0 ; i < 4 ; i++){int nextX = node.x + dir[i][0];int nextY = node.y + dir[i][1];if(nextX < 0 || nextY < 0 || nextX >= graph.length || nextY >= graph[0].length)continue;if(graph[nextX][nextY] == 1){graph[nextX][nextY] = 0;queue.add(new Node(nextX,nextY));}}}}public static void main(String[] args){// TODO 1.生成graphScanner sc = new Scanner(System.in);int n = sc.nextInt();int m = sc.nextInt();int[][] graph = new int[n][m];for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){graph[i][j] = sc.nextInt();}}// sc.colse();// TODO 2.仅对四个边进行遍历,遇到陆地的时候将该陆地和与之相邻的陆地全部变为海洋for(int i = 0; i < n ; i++){if(graph[i][0] == 1){bfs(graph,i,0);}}for(int i = 0; i < n ; i++){if(graph[i][m - 1] == 1){bfs(graph,i,m-1);}}for(int j = 0 ; j < m ; j++){if(graph[0][j] == 1){bfs(graph,0,j);}}for(int j = 0 ; j < m ; j++){if(graph[n - 1][j] == 1){bfs(graph,n-1,j);}}// TODO 3.遍历图,获取所有岛屿土地数量int sum = 0 ;for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){if(graph[i][j] == 1 ){sum++;                }}}System.out.println(sum);}
}

沉没孤岛

代码随想录链接
题目链接
视频讲解链接

在这里插入图片描述
在这里插入图片描述

思路:在这道题之中,我们只需要将图保留两份,一份计算孤岛,计算完之后对第二份图的孤岛进行去除即可。

DFS:

import java.util.Scanner;public class Main{static int res = 0;static int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};// TODO 4.dfs遍历逻辑private static void dfs(int[][] graph , int x , int y){graph[x][y] = 0;for(int i = 0 ; i < 4 ; i++){int nextX = x + dir[i][0];int nextY = y + dir[i][1];if(nextX < 0 || nextY < 0 || nextX >= graph.length || nextY >= graph[0].length) continue;if(graph[nextX][nextY] == 1){graph[nextX][nextY] = 0;dfs(graph,nextX,nextY);}}}public static void main(String[] args){// TODO 1.生成graphScanner sc = new Scanner(System.in);int n = sc.nextInt();int m = sc.nextInt();int[][] graph = new int[n][m];int[][] graph2 = new int[n][m];for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){int num = sc.nextInt();graph[i][j] = num;graph2[i][j] = num;}}// sc.colse();// TODO 2.仅对四个边进行遍历,遇到陆地的时候将该陆地和与之相邻的陆地全部变为海洋for(int i = 0; i < n ; i++){if(graph[i][0] == 1){dfs(graph,i,0);}}for(int i = 0; i < n ; i++){if(graph[i][m - 1] == 1){dfs(graph,i,m-1);}}for(int j = 0 ; j < m ; j++){if(graph[0][j] == 1){dfs(graph,0,j);}}for(int j = 0 ; j < m ; j++){if(graph[n - 1][j] == 1){dfs(graph,n-1,j);}}// TODO 3.遍历图,获取所有岛屿土地数量for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){if(graph[i][j] == 1 && graph2[i][j] == 1){graph2[i][j] = 0;                }System.out.print(graph2[i][j] + " ");}System.out.println();}// for(int i = 0 ; i < n ; i++){//     for(int j = 0 ; j < m ; j++){//         System.out.print(graph2[i][j] + " ");//     }//     System.out.println();// }}
}

BFS:

import java.util.*;public class Main{static int res = 0;static int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};// TODO 4.bfs遍历逻辑private static void bfs(int[][] graph , int x , int y){class Node{int x;int y;public Node(int x , int y){this.x = x;this.y = y;}}Queue<Node> queue = new LinkedList<>();queue.add(new Node(x,y));graph[x][y] = 0;while(!queue.isEmpty()){Node node = queue.remove();for(int i = 0 ; i < 4 ; i++){int nextX = node.x + dir[i][0];int nextY = node.y + dir[i][1];if(nextX < 0 || nextY < 0 || nextX >= graph.length || nextY >= graph[0].length)continue;if(graph[nextX][nextY] == 1){graph[nextX][nextY] = 0;queue.add(new Node(nextX,nextY));}}}}public static void main(String[] args){// TODO 1.生成graphScanner sc = new Scanner(System.in);int n = sc.nextInt();int m = sc.nextInt();int[][] graph = new int[n][m];int[][] graph2 = new int[n][m];for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){int num = sc.nextInt();graph[i][j] = num;graph2[i][j] = num;}}// sc.colse();// TODO 2.仅对四个边进行遍历,遇到陆地的时候将该陆地和与之相邻的陆地全部变为海洋for(int i = 0; i < n ; i++){if(graph[i][0] == 1){bfs(graph,i,0);}}for(int i = 0; i < n ; i++){if(graph[i][m - 1] == 1){bfs(graph,i,m-1);}}for(int j = 0 ; j < m ; j++){if(graph[0][j] == 1){bfs(graph,0,j);}}for(int j = 0 ; j < m ; j++){if(graph[n - 1][j] == 1){bfs(graph,n-1,j);}}// TODO 3.遍历图,获取所有岛屿土地数量for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){if(graph[i][j] == 1  && graph2[i][j] == 1){graph2[i][j] = 0;                }System.out.print(graph2[i][j] + " ");}System.out.println();}}
}

水流问题

代码随想录链接
题目链接
视频讲解链接
在这里插入图片描述
在这里插入图片描述

暴力DFS:

import java.util.*;public class Main{static int m,n;// static int[][] dir = {{0,1},{1,0},{0,-1},{1-,0}};static int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};private static void dfs(int[][] graph , boolean[][] visted , int x , int y ){if(visted[x][y]) return ;visted[x][y] = true;for(int i = 0 ; i < 4 ; i++){int nextX = x + dir[i][0];int nextY = y + dir[i][1];if(nextX < 0 || nextY < 0 || nextX >= n || nextY >= m) continue;if(graph[x][y] < graph[nextX][nextY]) continue;dfs(graph,visted,nextX,nextY);}}private static boolean isResult(int[][] graph , int x , int y){boolean[][] visted = new boolean[n][m];dfs(graph,visted,x,y);boolean isFirst = false;boolean isSecond = false;// 判断当前的(x,y)节点是否从第一组边界出去for(int i = 0 ; i < n ; i++){if(visted[i][0]){isFirst = true;break;}}for(int j = 0 ; j < m ; j++){if(visted[0][j]){isFirst = true;break;}}// 判断当前的(x,y)节点是否从第二组边界出去for(int i = 0 ; i < n ; i++){if(visted[i][m-1]){isSecond = true;break;}}for(int j = 0 ; j < m ; j++){if(visted[n - 1][j]){isSecond = true;break;}}return isFirst&&isSecond;}public static void main(String[] args){Scanner sc = new Scanner(System.in);n = sc.nextInt();m = sc.nextInt();int[][] graph = new int[n][m];for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){graph[i][j] = sc.nextInt();}} for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){if(isResult(graph,i,j))System.out.println(i + " " + j);}}}
}

暴力BFS:(超时)

import java.util.*;public class Main{static int m,n;// static int[][] dir = {{0,1},{1,0},{0,-1},{1-,0}};static int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};private static void bfs(int[][] graph , boolean[][] visted , int x , int y ){class Node{int x ;int y;public Node(int x , int y){this.x = x;this.y = y;}}Queue<Node> queue = new LinkedList<>();queue.add(new Node(x,y));visted[x][y] = true;while(!queue.isEmpty()){Node node = queue.remove();for(int i = 0 ; i < 4 ; i++){int nextX = node.x + dir[i][0];int nextY = node.y + dir[i][1];if(nextX < 0 || nextY < 0 || nextX >= n || nextY >= m ) continue;if(visted[nextX][nextY]) continue;if(graph[node.x][node.y] < graph[nextX][nextY] ) continue;queue.add(new Node(nextX,nextY));visted[nextX][nextY] = true;}}}private static boolean isResult(int[][] graph , int x , int y){boolean[][] visted = new boolean[n][m];bfs(graph,visted,x,y);boolean isFirst = false;boolean isSecond = false;// 判断当前的(x,y)节点是否从第一组边界出去for(int i = 0 ; i < n ; i++){if(visted[i][0]){isFirst = true;break;}}for(int j = 0 ; j < m ; j++){if(visted[0][j]){isFirst = true;break;}}// 判断当前的(x,y)节点是否从第二组边界出去for(int i = 0 ; i < n ; i++){if(visted[i][m-1]){isSecond = true;break;}}for(int j = 0 ; j < m ; j++){if(visted[n - 1][j]){isSecond = true;break;}}return isFirst&&isSecond;}public static void main(String[] args){Scanner sc = new Scanner(System.in);n = sc.nextInt();m = sc.nextInt();int[][] graph = new int[n][m];for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){graph[i][j] = sc.nextInt();}} for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){if(isResult(graph,i,j))System.out.println(i + " " + j);}}}
}

DFS优化:
采用逆向思维,考虑水流从低处往高处可以流通的情况,从而获得第一组边界的流通情况和第二组流水的情况,二者均为true的情况则表明该网格可以从第一组边界和第二组边界流出。

import java.util.*;public class Main{static int m,n;// static int[][] dir = {{0,1},{1,0},{0,-1},{1-,0}};static int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};private static void dfs(int[][] graph , boolean[][] visted , int x , int y , int preH){// 遇到边界或者访问过的点直接返回if(x < 0 || y < 0 || x >= graph.length ||y >= graph[0].length || visted[x][y]) return;if(graph[x][y] < preH) return ;visted[x][y] = true;dfs(graph,visted,x+1,y,graph[x][y]);dfs(graph,visted,x,y+1,graph[x][y]);dfs(graph,visted,x-1,y,graph[x][y]);dfs(graph,visted,x,y-1,graph[x][y]);}public static void main(String[] args){Scanner sc = new Scanner(System.in);n = sc.nextInt();m = sc.nextInt();int[][] graph = new int[n][m];boolean[][] firstB = new boolean[n][m];boolean[][] secondB = new boolean[n][m];for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){graph[i][j] = sc.nextInt();}} // 从上下边界进行DFSfor(int j = 0 ; j < m ; j++){dfs(graph,firstB,0,j,Integer.MIN_VALUE);dfs(graph,secondB,n-1,j,Integer.MIN_VALUE);}// 从左右边界进行DFSfor(int i = 0 ; i < n ; i++){dfs(graph,firstB,i,0,Integer.MIN_VALUE);dfs(graph,secondB,i,m-1,Integer.MIN_VALUE);}for(int i = 0 ; i < n ; i++){for(int j = 0 ; j < m ; j++){if(firstB[i][j] && secondB[i][j])System.out.println(i + " " + j);}}}
}

BFS(待补充)


建造最大岛屿(待完成)

代码随想录链接
题目链接
视频讲解链接

在这里插入图片描述

import java.util.*;
public class Main {// 该方法采用 DFS// 定义全局变量// 记录每次每个岛屿的面积static int count;// 对每个岛屿进行标记static int mark;// 定义二维数组表示四个方位static int[][] dirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};// DFS 进行搜索,将每个岛屿标记为不同的数字public static void dfs(int[][] grid, int x, int y, boolean[][] visited) {// 当遇到边界,直接returnif (x < 0 || x >= grid.length || y < 0 || y >= grid[0].length) return;// 遇到已经访问过的或者遇到海水,直接返回if (visited[x][y] || grid[x][y] == 0) return;visited[x][y] = true;count++;grid[x][y] = mark;// 继续向下层搜索dfs(grid, x, y + 1, visited);dfs(grid, x, y - 1, visited);dfs(grid, x + 1, y, visited);dfs(grid, x - 1, y, visited);}public static void main (String[] args) {// 接收输入Scanner sc = new Scanner(System.in);int m = sc.nextInt();int n = sc.nextInt();int[][] grid = new int[m][n];for (int i = 0; i < m; i++) {for (int j = 0; j < n; j++) {grid[i][j] = sc.nextInt();}}// 初始化mark变量,从2开始(区别于0水,1岛屿)mark = 2;// 定义二位boolean数组记录该位置是否被访问boolean[][] visited = new boolean[m][n];// 定义一个HashMap,记录某片岛屿的标记号和面积HashMap<Integer, Integer> getSize = new HashMap<>();// 定义一个HashSet,用来判断某一位置水四周是否存在不同标记编号的岛屿HashSet<Integer> set = new HashSet<>();// 定义一个boolean变量,看看DFS之后,是否全是岛屿boolean isAllIsland = true;// 遍历二维数组进行DFS搜索,标记每片岛屿的编号,记录对应的面积for (int i = 0; i < m; i++) {for (int j = 0; j < n; j++) {if (grid[i][j] == 0) isAllIsland = false;if (grid[i][j] == 1) {count = 0;dfs(grid, i, j, visited);getSize.put(mark, count);mark++;}}}int result = 0;if (isAllIsland) result =  m * n;// 对标记完的grid继续遍历,判断每个水位置四周是否有岛屿,并记录下四周不同相邻岛屿面积之和// 每次计算完一个水位置周围可能存在的岛屿面积之和,更新下result变量for (int i = 0; i < m; i++) {for (int j = 0; j < n; j++) {if (grid[i][j] == 0) {set.clear();// 当前水位置变更为岛屿,所以初始化为1int curSize = 1;for (int[] dir : dirs) {int curRow = i + dir[0];int curCol = j + dir[1];if (curRow < 0 || curRow >= m || curCol < 0 || curCol >= n) continue;int curMark = grid[curRow][curCol];// 如果当前相邻的岛屿已经遍历过或者HashMap中不存在这个编号,继续搜索if (set.contains(curMark) || !getSize.containsKey(curMark)) continue;set.add(curMark);curSize += getSize.get(curMark);}result = Math.max(result, curSize);}}}// 打印结果System.out.println(result);}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/81995.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C#自定义扩展方法 及 EventHandler<TEventArgs> 委托

有自定义官方示例链接&#xff1a; 如何实现和调用自定义扩展方法 - C# | Microsoft Learn 1.静态类 2.静态方法 3.第一参数固定为this 要修改的类型,后面才是自定的参数 AI给出的一个示例&#xff1a;没有自定义参数 、有自定义参数的 using System; using System.Colle…

Zephyr OS 中的 FIFO 接口应用介绍

目录 概述 1 FIFO的接口函数 1.1 K_FIFO_DEFINE函数 1.2 k_fifo_init函数 1.3 k_fifo_put函数 1.4 k_fifo_get 函数 1.5 k_fifo_is_empty 函数 2 应用验证 2.1 UART中使用FIFO范例 2.2 生产-消费类型范例 3 注意事项 3.1 内存管理 3.2 线程安全边界 概述 Zephy…

Spring Boot 集成 Elasticsearch【实战】

前言&#xff1a; 上一篇我们简单分享了 Elasticsearch 的一些概念性的知识&#xff0c;本篇我们来分享 Elasticsearch 的实际运用&#xff0c;也就是在 Spring Booot 项目中使用 Elasticsearch。 Elasticsearch 系列文章传送门 Elasticsearch 基础篇【ES】 Elasticsearch …

Win11下轻松搭建wiki.js,Docker.desktop部署指南(mysql+elasticsearch+kibana+wiki.js)

Docker.desktop部署wiki.js指南 前言环境和要求介绍提前准备 1. elasticsearch1.1 部署容器1.2 参数说明1.3 验证容器是否部署成功 2. kibana2.1 部署容器2.2 验证是否部署成功2.3 安装IK分词器 3. MySql3.1 部署容器3.2 增加数据库和wiki.js所需要的账号 4. wiki.js4.1 部署容…

PCB设计教程【入门篇】——电路分析基础-元件数据手册

前言 本教程基于B站Expert电子实验室的PCB设计教学的整理&#xff0c;为个人学习记录&#xff0c;旨在帮助PCB设计新手入门。所有内容仅作学习交流使用&#xff0c;无任何商业目的。若涉及侵权&#xff0c;请随时联系&#xff0c;将会立即处理 目录 前言 一、数据手册的重要…

【论文阅读 | AAAI 2025 | FD2-Net:用于红外 - 可见光目标检测的频率驱动特征分解网络】

论文阅读 | AAAI 2025 | FD2-Net&#xff1a;用于红外 - 可见光目标检测的频率驱动特征分解网络 1.摘要&&引言2. 方法2.1总体架构2.2特征分解编码器2.3多模态重建机制2.4训练损失 3.实验3.1实验设置3.2主要结果3.3消融研究 4.结论 题目&#xff1a;FD2-Net: Frequency-…

CAU人工智能class3 优化器

优化算法框架 优化思路 随机梯度下降 随机梯度下降到缺点&#xff1a; SGD 每一次迭代计算 mini-batch 的梯度&#xff0c;然后对参数进行更新&#xff0c;每次迭代更新使用的梯度都只与本次迭代的样本有关。 因为每个批次的数据含有抽样误差&#xff0c;每次更新可能并不会 …

webpack 学习

webpack打包流程及原理 Webpack 是一个现代 JavaScript 应用程序的静态模块打包器&#xff08;module bundler&#xff09;。在 Web 开发中&#xff0c;它主要用于将各种资源&#xff08;如 JavaScript、CSS、图片等&#xff09;打包成浏览器可以直接运行的文件。Webpack 的核…

HTML5中的Microdata与历史记录管理详解

HTML5中的Microdata与历史记录管理解析 一、Microdata结构化数据 核心属性 itemscope 声明数据范围itemtype 指定数据词汇表&#xff08;如http://schema.org/Product&#xff09;itemprop 定义数据属性 <div itemscope itemtype"http://schema.org/Book">…

《算法笔记》11.7小节——动态规划专题->背包问题 问题 A: 装箱问题

【问题描述】 有一个箱子的容量为V&#xff08;V为正整数&#xff0c;且满足0≤V≤20000&#xff09;&#xff0c;同时有n件物品&#xff08;0的体积值为正整数。 要求从n件物品中&#xff0c;选取若干装入箱内&#xff0c;使箱子的剩余空间最小。 输入&#xff1a; 1行整数&a…

Compose笔记(二十五)--Brush

这一节主要了解一下Compose中Brush,在Jetpack Compose里&#xff0c;Brush是一个重要的 API&#xff0c;它用于定义填充图形的颜色渐变或图案&#xff0c;能够为界面元素添加丰富的视觉效果。简单总结如下: 1 常见场景 填充形状&#xff08;圆形、矩形等&#xff09; 创建渐变…

离线服务器Python环境配置指南

离线服务器Python环境配置指南&#xff1a;避坑与实战 0. 场景分析&#xff1a;当服务器与世隔绝时 典型困境&#xff1a; 无法访问国际网络&#xff08;如PyPI、Conda官方源&#xff09;服务器处于内网隔离环境安全策略限制在线安装 解决方案矩阵&#xff1a; 方法适用场…

Mac下载bilibili视频

安装 安装 yt-dlp brew install yt-dlp安装FFmpeg 用于合并音视频流、转码等操作 brew install ffmpeg使用 下载单个视频 查看可用格式 yt-dlp -F --cookies-from-browser chrome "https://www.bilibili.com/video/BV15B4y1G7F3?spm_id_from333.788.recommend_more_vid…

常见的实时通信技术(轮询、sse、websocket、webhooks)

1. HTTP轮询&#xff1a;最老实的办法 刚开始做实时功能时&#xff0c;我第一个想到的就是轮询。特别简单直白&#xff0c;就像你每隔5分钟就刷新一次朋友圈看看有没有新消息一样。 短轮询&#xff1a;勤快但费劲 短轮询就是客户端隔三差五地问服务器&#xff1a;"有新…

Elasticsearch Fetch阶段面试题

Elasticsearch Fetch阶段面试题 🚀 目录 基础原理性能优化错误排查场景设计底层机制总结基础原理 🔍 面试题1:基础原理 题目: 请描述Elasticsearch分布式搜索中Query阶段和Fetch阶段的工作流程,为什么需要将搜索过程拆分为这两个阶段? 👉 点击查看答案 查询流程…

vr制作公司提供什么服务?

随着科技的迅猛进步&#xff0c;虚拟现实&#xff08;Virtual Reality&#xff0c;简称VR&#xff09;技术已经悄然渗透到我们的日常生活与工作中&#xff0c;成为推动数字化转型的重要力量。VR制作公司&#xff0c;作为前沿领域的探索者和实践者&#xff0c;以专业的技术和创新…

COCO数据集神经网络性能现状2025.5.18

根据当前搜索结果&#xff0c;截至2025年5月&#xff0c;COCO数据集上性能最佳的神经网络模型及其关键参数如下&#xff1a; 1. D-FINE&#xff08;中科大团队&#xff09; 性能参数&#xff1a; 在COCO数据集上以78 FPS的速度实现了59.3%的平均精度&#xff08;AP&#xff0…

Sentinel原理与SpringBoot整合实战

前言 随着微服务架构的广泛应用&#xff0c;服务和服务之间的稳定性变得越来越重要。在高并发场景下&#xff0c;如何保障服务的稳定性和可用性成为了一个关键问题。阿里巴巴开源的Sentinel作为一个面向分布式服务架构的流量控制组件&#xff0c;提供了从流量控制、熔断降级、…

Ubuntu 20.04 报错记录: Matplotlib 无法使用 OpenCV 的 libqxcb.so

网上查了一下这个报错&#xff0c;有很多解决方案&#xff0c;但是都不是针对 OpenCV 触发的这种 qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in " */lib/*/site-packages/cv2/qt/plugins" even though it was found. 本文的方案是牺牲 …

配置代理服务器访问github、google

配置代理服务器访问github、google 背景与原理配置环境配置步骤云主机配置Windows客户端创建SSH隧道安装 Windows 内置 OpenSSHssh config 配置文件创建动态代理隧道 浏览器代理设置 验证浏览器访问google、githubssh 访问github 背景与原理 由于网络政策限制&#xff0c;中国…