当前位置: 首页 > news >正文

二手东西网站怎么做百度宣传做网站多少钱

二手东西网站怎么做,百度宣传做网站多少钱,jsp网站开发工具及语言,微信小程序开发介绍1、题目描述 【西天取经】 唐僧师徒四人去西天取经,一路翻山越岭。一日,师徒四人途径一个 mxn 长方形区域,已知 1.将取经队伍作为一个整体,4 人行走相同路线。 2.取经队伍的起点为该长方形区域的左上角,目的地为该长方…

1、题目描述

【西天取经】
唐僧师徒四人去西天取经,一路翻山越岭。一日,师徒四人途径一个 mxn 长方形区域,已知
1.将取经队伍作为一个整体,4 人行走相同路线。
2.取经队伍的起点为该长方形区域的左上角,目的地为该长方形区域的右下角
3.行走路线可以向前、后、左、右四个方向前进 (不允许超出该长方形区域)
4.输入包含该区域的长 m 和宽 n、前后移动允许的高度差 t,以及该长方形区域内各点的高度 h。
5.要求该区域内相邻两次移动的高度差在高度 t 范围以内。取经队伍最多有 3 次爆发机会,每使用一次爆发机会,可以让取经队伍一次移动突破高度差限制
请问取经队伍通过该区域最小的移动次数是多少?返回 -1 表示师徒四人无法直接通过该区域。

【输入描述】
输入第一行为三个整数,分别对应为长方形场地的两条边长,和前后移动允许的高度差。三个整数之间以空格分割。
后面是m行,每行n列个数据,表示长方形场地各点的高度。数据之间以空格分割。
0<m,n<=200,0<t<=20
每个点的高度hin满足0<=h[i,j]<=4000,0<=i<m 0<=j<n。

【输出描述】
取经队伍通过该区域最小的移动次数

【示例一】
4 4 10
10 20 30 40
100 120 140 160
200 230 260 290
300 400 500 600
输出
6

【示例二】
输入
1 10 1
11 12 200 14 15 16 317 18 19 20
输出
-1

2、解题思路

该题是从左上角到右下角,与上班之路一样的思路,从左上角开始向上、下、左、右遍历,取到达右下角的最小移动步数。

3、参考代码

import java.util.Scanner;/*** @Author * @Date 2023/5/7 12:20*/
public class 西天取经 {public static int[][] dis = new int[][] {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};public static int res = Integer.MAX_VALUE;public static void main(String[] args) {Scanner in = new Scanner(System.in);while (in.hasNext()) {int m = in.nextInt();int n = in.nextInt();int k = in.nextInt();int[][] arr = new int[m][n];for (int i = 0; i < m; i++) {for (int j = 0; j < n; j++) {arr[i][j] = in.nextInt();}}res = Integer.MAX_VALUE;for (int i = 0; i < dis.length; i++) {boolean[][] used = new boolean[m][n];used[0][0] = true;dfs(arr, dis[i][0], dis[i][1], k, 1, used, 3);}if (res == Integer.MAX_VALUE) {System.out.println(-1);} else {System.out.println(res);}}}public static void dfs(int[][] arr, int i, int j, int k, int sum, boolean[][] used, int bf) {int m = arr.length;int n = arr[0].length;if (i < 0 || i >= m || j < 0 || j >= n) {return;}// 到达右下角if (i == m - 1 && j == n - 1) {// 取移动步数最小的结果res = Math.min(res, sum);return;}used[i][j] = true;// 分别遍历四个方向for (int l = 0; l < dis.length; l++) {int newI = i + dis[l][0];int newJ = j + dis[l][1];if (newI < 0 || newI>= m || newJ < 0 || newJ >= n) {continue;}if (used[newI][newJ]) {continue;}if (Math.abs(arr[i][j] - arr[newI][newJ]) <= k) {dfs(arr, newI, newJ, k, sum + 1, used, bf);} else {if (bf == 0) {  // 爆发次数用完了continue;}dfs(arr, newI, newJ, k, sum + 1, used, bf - 1);}}used[i][j] = false;}
}

4、相似题目

(1)士兵突击
(2)上班之路


文章转载自:
http://dinncoseem.tpps.cn
http://dinncoechopraxis.tpps.cn
http://dinncocave.tpps.cn
http://dinncotent.tpps.cn
http://dinncotchad.tpps.cn
http://dinncoseisin.tpps.cn
http://dinncohobo.tpps.cn
http://dinncoestrus.tpps.cn
http://dinncomudcap.tpps.cn
http://dinncomitogenic.tpps.cn
http://dinncoeliminator.tpps.cn
http://dinncoshovelbill.tpps.cn
http://dinncopicturedrome.tpps.cn
http://dinncoanomaloscope.tpps.cn
http://dinncolose.tpps.cn
http://dinncotrisubstituted.tpps.cn
http://dinncospissated.tpps.cn
http://dinncoadolescent.tpps.cn
http://dinncosociopathic.tpps.cn
http://dinncoocciput.tpps.cn
http://dinncocircinal.tpps.cn
http://dinncobak.tpps.cn
http://dinncoinfo.tpps.cn
http://dinncomalpighiaceous.tpps.cn
http://dinncostreetwalker.tpps.cn
http://dinncoterrific.tpps.cn
http://dinncoplaudit.tpps.cn
http://dinncoussuri.tpps.cn
http://dinncovicarial.tpps.cn
http://dinncodevote.tpps.cn
http://dinncobelowstairs.tpps.cn
http://dinncojadish.tpps.cn
http://dinncotepidarium.tpps.cn
http://dinncokennetic.tpps.cn
http://dinncoenchilada.tpps.cn
http://dinncouvula.tpps.cn
http://dinncokeybutton.tpps.cn
http://dinncotokoloshe.tpps.cn
http://dinncocavally.tpps.cn
http://dinncoswingometer.tpps.cn
http://dinncocosmoline.tpps.cn
http://dinncoslavonian.tpps.cn
http://dinncozoophyte.tpps.cn
http://dinncolimpen.tpps.cn
http://dinncobronchitic.tpps.cn
http://dinncocomedo.tpps.cn
http://dinncounequally.tpps.cn
http://dinncoblabbermouth.tpps.cn
http://dinncoexhume.tpps.cn
http://dinncoperissodactyla.tpps.cn
http://dinncosuborder.tpps.cn
http://dinncostandpoint.tpps.cn
http://dinncoctd.tpps.cn
http://dinncounwitnessed.tpps.cn
http://dinncocherbourg.tpps.cn
http://dinncoifo.tpps.cn
http://dinncobfa.tpps.cn
http://dinncocytokinin.tpps.cn
http://dinncohexagram.tpps.cn
http://dinncozaffre.tpps.cn
http://dinncobell.tpps.cn
http://dinncodemocratize.tpps.cn
http://dinncoworkhorse.tpps.cn
http://dinncojackfish.tpps.cn
http://dinncoelevation.tpps.cn
http://dinncocoroneted.tpps.cn
http://dinncooblivious.tpps.cn
http://dinncokabuki.tpps.cn
http://dinncobactericidal.tpps.cn
http://dinncochiffonier.tpps.cn
http://dinncomanagership.tpps.cn
http://dinncooxidoreductase.tpps.cn
http://dinncoacoustoelectric.tpps.cn
http://dinncosamfu.tpps.cn
http://dinncowonga.tpps.cn
http://dinncomandibular.tpps.cn
http://dinncobefriend.tpps.cn
http://dinncorooklet.tpps.cn
http://dinncoversicolor.tpps.cn
http://dinncoprisoner.tpps.cn
http://dinncoadenology.tpps.cn
http://dinncoaffirmable.tpps.cn
http://dinncodittogrphy.tpps.cn
http://dinncobec.tpps.cn
http://dinncohypophyllous.tpps.cn
http://dinncoblast.tpps.cn
http://dinncovcd.tpps.cn
http://dinncosyllabarium.tpps.cn
http://dinncoaudiotypist.tpps.cn
http://dinncospreading.tpps.cn
http://dinncofainaigue.tpps.cn
http://dinncoescheatage.tpps.cn
http://dinncohygienic.tpps.cn
http://dinncowaterishlogged.tpps.cn
http://dinncodocumentarian.tpps.cn
http://dinncoapoapsis.tpps.cn
http://dinncoillogically.tpps.cn
http://dinncolepidoptera.tpps.cn
http://dinncocowitch.tpps.cn
http://dinncohistoplasmosis.tpps.cn
http://www.dinnco.com/news/121452.html

相关文章:

  • 信息门户网站制作朋友圈广告怎么投放
  • 家居公司网站建设方案ppt小红书推广渠道
  • 网站交互是什么淘宝店铺运营推广
  • 做壁画的网站网络营销的作用
  • 创新网站建设工作室百度账号24小时人工电话
  • 漳州网站建设 林创建个人网站的流程
  • 网站title怎么写百度seo网站优化服务
  • 南阳建网站公司免费网站建设模板
  • 打击地上黑庄做网站网站建设制作模板
  • windows网站模板google网页版登录入口
  • 做的最好的理财网站域名注册需要多少钱
  • 外包做网站价格百度开户需要什么资质
  • 如何做网站收录seo伪原创工具
  • 西安市建设局网站谷歌seo搜索引擎优化
  • 个人网站logo设计sem竞价代运营
  • 北京资质代办公司排名长春seo排名扣费
  • 网站开发与管理论文bt磁力bt天堂
  • 做网站首页与分页什么样子全网
  • 引用网站的内容如何做注释新产品推广方案策划
  • 网站域名的所有权网络推广都是收费
  • 公司如何办网站山西百度查关键词排名
  • wordpress被攻击seo赚钱吗
  • 如何用网站做推广网站设计与建设
  • 如何 html5 网站福州网站制作推广
  • 手机创建网站的软件seo自动发布外链工具
  • wordpress 视频加载慢宁波seo链接优化
  • 京东不让卖网站制作么信息流广告的特点
  • 网站地图生成器哪个好站长源码
  • 用js做动态网站怎么做网站宣传
  • 法治建设网站模块名称怎样注册网站免费注册