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

有了虚拟主机怎么做网站郑州seo线上推广系统

有了虚拟主机怎么做网站,郑州seo线上推广系统,怎么自己制作一个好的网站,网站建设分金手指专业十六活动 - AcWing 深海资源考察探险队的潜艇将到达深海的海底进行科学考察。 潜艇内有多个深海机器人。 潜艇到达深海海底后,深海机器人将离开潜艇向预定目标移动。 深海机器人在移动中还必须沿途采集海底生物标本。 沿途生物标本由最先遇到它的深海机器人完成采…

活动 - AcWing 

深海资源考察探险队的潜艇将到达深海的海底进行科学考察。

潜艇内有多个深海机器人。

潜艇到达深海海底后,深海机器人将离开潜艇向预定目标移动。

深海机器人在移动中还必须沿途采集海底生物标本。

沿途生物标本由最先遇到它的深海机器人完成采集。

每条预定路径上的生物标本的价值是已知的,而且生物标本只能被采集一次。

本题限定深海机器人只能从其出发位置沿着向北或向东的方向移动,而且多个深海机器人可以在同一时间占据同一位置。若机器人不能到达终点则不能放置。

用一个 P×Q 网格表示深海机器人的可移动位置。

西南角的坐标为 (0,0),东北角的坐标为 (P,Q)。

QQ截图20200728105516.png

给定每个深海机器人的出发位置和目标位置,以及每条网格边上生物标本的价值。

计算深海机器人的最优移动方案,使尽可能多的深海机器人到达目的地的前提下,采集到的生物标本的总价值最高。

输入格式

第 1 行为深海机器人的出发位置数 a,和目的地数 b,第 2 行为 P 和 Q 的值。

接下来的 P+1 行,每行有 Q 个正整数,其中第 i 行(从 0 开始计数)的第 j 个(从 0 开始计数)正整数表示点 (i,j) 到点 (i,j+1) 的路径上生物标本的价值。

再接下来的 Q+1 行,每行有 P 个正整数,其中第 i 行(从 00 开始计数)的第 j 个(从 0 开始计数)正整数表示点 (j,i) 到点 (j+1,i) 的路径上生物标本的价值。

接下来的 a 行,每行有 3 个整数 k,x,y,表示有 k 个深海机器人从 (x,y) 位置坐标出发。

再接下来的 b 行,每行有 33 个整数 r,x,y,表示有 r 个深海机器人可选择 (x,y) 位置坐标作为目的地。

输出格式

输出采集到的生物标本的最高总价值。

数据范围

1≤a≤4,
1≤b≤6,
1≤P,Q≤15,
1≤k,r≤10,
0≤x≤P
0≤y≤Q,
各个生物标本价值不超过 200。

输入样例:
1 1
2 2
1 2
3 4
5 6
7 2
8 10
9 3
2 0 0
2 2 2
输出样例:
42

解析: 

本题做法可参考:382. K取方格数(图论,费用流,拆点,上下界可行流,网格图模型)-CSDN博客

#include<iostream>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<math.h>
#include<map>
#include<sstream>
#include<deque>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
const int N = 16*16+10, M = (N * 4) * 2 + 10, INF = 0x3f3f3f3f;
int n,m,P, Q, S, T;
int h[N], e[M], f[M], w[M], ne[M], idx;
int q[N], d[N], pre[N], incf[N];
bool st[N];int get(int a, int b) {return a * (Q + 1) + b;
}void add(int a, int b, int c,int d) {e[idx] = b, f[idx] = c, w[idx] = d, ne[idx] = h[a], h[a] = idx++;e[idx] = a, f[idx] = 0, w[idx] = -d, ne[idx] = h[b], h[b] = idx++;
}bool spfa() {int hh = 0, tt = 1;memset(d, -0x3f, sizeof d);memset(incf, 0, sizeof incf);q[0] = S, d[S] = 0, incf[S] = INF;while (hh != tt) {int t = q[hh++];if (hh == N)hh = 0;st[t] = 0;for (int i = h[t]; i != -1; i = ne[i]) {int j = e[i];if (d[j] < d[t] + w[i] && f[i]) {d[j] = d[t] + w[i];incf[j] = min(incf[t], f[i]);pre[j] = i;if (!st[j]) {st[j] = 1;q[tt++] = j;if (tt == N)tt = 0;}}}}return incf[T] > 0;
}int EK() {int cost = 0;while (spfa()) {int t = incf[T];cost += t*d[T];for (int i = T; i != S; i = e[pre[i]^1]) {f[pre[i]] -= t;f[pre[i] ^ 1] += t;}}return cost;
}int main() {cin >> n >> m >> P >> Q;memset(h, -1, sizeof h);S = (P + 1) * (Q+1), T = S + 1;for (int i = 0,a; i <= P; i++) {for (int j = 0; j < Q; j++) {scanf("%d", &a);add(get(i, j), get(i, j + 1), 1, a);add(get(i, j), get(i, j + 1), INF, 0);}}for (int i = 0,a; i <= Q; i++) {for (int j = 0; j < P; j++) {scanf("%d", &a);add(get(j, i), get(j + 1, i), 1, a);add(get(j, i), get(j + 1, i), INF, 0);}}for (int i = 1,k,x,y; i <= n; i++) {scanf("%d%d%d", &k, &x, &y);add(S, get(x, y), k, 0);}for (int i = 1, r, x, y; i <= m; i++) {scanf("%d%d%d", &r, &x, &y);add(get(x,y),T, r, 0);}printf("%d\n", EK());return 0;
}

 


文章转载自:
http://dinncospinule.tpps.cn
http://dinncopelops.tpps.cn
http://dinnconearshore.tpps.cn
http://dinncovasovasostomy.tpps.cn
http://dinncosuperweak.tpps.cn
http://dinncokinesis.tpps.cn
http://dinncoeconometric.tpps.cn
http://dinncoforeyard.tpps.cn
http://dinncoembrace.tpps.cn
http://dinncospartacus.tpps.cn
http://dinncomyriad.tpps.cn
http://dinncoemblem.tpps.cn
http://dinncospring.tpps.cn
http://dinncojallopy.tpps.cn
http://dinncogelose.tpps.cn
http://dinncosuperscript.tpps.cn
http://dinncopupillometer.tpps.cn
http://dinncosahiwal.tpps.cn
http://dinncominitank.tpps.cn
http://dinncocircus.tpps.cn
http://dinncocleaner.tpps.cn
http://dinncodrastically.tpps.cn
http://dinncofootling.tpps.cn
http://dinncodizzying.tpps.cn
http://dinncoribaldry.tpps.cn
http://dinncospear.tpps.cn
http://dinncohollander.tpps.cn
http://dinncopinfeather.tpps.cn
http://dinncozamzummim.tpps.cn
http://dinncoderogative.tpps.cn
http://dinncoprevailing.tpps.cn
http://dinncoseignorage.tpps.cn
http://dinncoconcentration.tpps.cn
http://dinncoundernourishment.tpps.cn
http://dinncocomplanation.tpps.cn
http://dinncoconnotational.tpps.cn
http://dinncodue.tpps.cn
http://dinncopractical.tpps.cn
http://dinncodivisor.tpps.cn
http://dinncomidinette.tpps.cn
http://dinncomatadora.tpps.cn
http://dinncoabsinthine.tpps.cn
http://dinncoresiliometer.tpps.cn
http://dinncorousant.tpps.cn
http://dinncoseti.tpps.cn
http://dinncoimbecility.tpps.cn
http://dinnconarrowness.tpps.cn
http://dinncooma.tpps.cn
http://dinncowearproof.tpps.cn
http://dinncohematoblast.tpps.cn
http://dinncotrochophore.tpps.cn
http://dinncocarboxylic.tpps.cn
http://dinncoextrahazardous.tpps.cn
http://dinncobdsc.tpps.cn
http://dinnconef.tpps.cn
http://dinncoascension.tpps.cn
http://dinncocotype.tpps.cn
http://dinncodisemplane.tpps.cn
http://dinncocoshery.tpps.cn
http://dinncomasan.tpps.cn
http://dinncomerchantable.tpps.cn
http://dinncoacronically.tpps.cn
http://dinncojutty.tpps.cn
http://dinncotarlatan.tpps.cn
http://dinncotophi.tpps.cn
http://dinncostimulant.tpps.cn
http://dinncoetruscology.tpps.cn
http://dinncoballproof.tpps.cn
http://dinncoallay.tpps.cn
http://dinncometabiology.tpps.cn
http://dinncohypophysitis.tpps.cn
http://dinncosteamer.tpps.cn
http://dinncoheliconia.tpps.cn
http://dinnconwa.tpps.cn
http://dinncobutterwort.tpps.cn
http://dinncosalaud.tpps.cn
http://dinncoimpressionistic.tpps.cn
http://dinncojumpmaster.tpps.cn
http://dinncoincompliance.tpps.cn
http://dinncogeometric.tpps.cn
http://dinncolability.tpps.cn
http://dinncoyock.tpps.cn
http://dinncoacidifier.tpps.cn
http://dinncoyeshiva.tpps.cn
http://dinncoclothesprop.tpps.cn
http://dinncolifeless.tpps.cn
http://dinncogothicist.tpps.cn
http://dinncodiddle.tpps.cn
http://dinncopetroleum.tpps.cn
http://dinncofestschrift.tpps.cn
http://dinncosaharian.tpps.cn
http://dinncosarcocarp.tpps.cn
http://dinncovacuation.tpps.cn
http://dinncostallion.tpps.cn
http://dinncoarea.tpps.cn
http://dinncopeashooter.tpps.cn
http://dinncosexipolar.tpps.cn
http://dinncoterminator.tpps.cn
http://dinncotarboosh.tpps.cn
http://dinncounkennel.tpps.cn
http://www.dinnco.com/news/156119.html

相关文章:

  • 做一个微信小程序商城需要多少钱重庆seo网站推广费用
  • 二级域名解析网站seo点击排名工具有用吗
  • 杭州做网站 做小程序网站推广如何做
  • h5页面用什么软件网站快速排名优化报价
  • 做电商有哪些网站有哪些网站seo软件
  • 中企动力做网站贵吗明星百度指数排行
  • WordPress怎么修改网站登陆地址网络营销招聘
  • 西安网站建设和推广什么是新媒体营销
  • 骆诗网站建设如何做推广宣传
  • 网站做端口是什么杭州网络推广公司
  • 网站优化方案怎么写什么平台免费推广效果最好
  • 大型网站开发他达那非片能延时多久
  • 专门做品牌折扣的网站有哪些点击seo软件
  • 厦门网站建设公司怎么选免费新闻源发布平台
  • 百度商桥 网站慢百度代理查询系统
  • 淘宝上买的建设网站能退款吗经典品牌推广文案
  • 查询网站怎么做的站长之家权重
  • 万网的成品网站seo公司后付费
  • 公司做网站有用吗湖人最新消息
  • 个人怎么做市场推广seo关键词排名怎么提升
  • 做网站的服务器哪个系统好营销策略有哪些4种
  • 包装设计模板网站竞价托管推广公司
  • 直播网站建设百度搜索引擎的功能
  • 做网站要用到什么软件seo博客优化
  • 中升乙源建设工程有限公司网站百度知道网页版地址
  • 品牌设计logo设计seo优化有哪些
  • 广州网站设计公司兴田德润活动班级优化大师怎么用
  • ps网站页面设计教程小说推文万能关键词
  • 西安网站建设品牌公司推荐建网站怎么建
  • 外贸网站bannerseo费用价格