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

新闻静态网站咋做百度推广登录手机版

新闻静态网站咋做,百度推广登录手机版,wordpress 菜单 无效,犀牛云建设网站根据题意可以知道是一个动态规划,看完数据范围之后可以知道是一个线性DP。 解决方法有点类似于背包问题,枚举背包的每一个空间。 如果把坐标轴上每个点都看成一个块儿,只需要按顺序求出前 i 个块儿的最大牧草堆数,f[i] 就是前i的…

根据题意可以知道是一个动态规划,看完数据范围之后可以知道是一个线性DP。

解决方法有点类似于背包问题,枚举背包的每一个空间。

如果把坐标轴上每个点都看成一个块儿,只需要按顺序求出前 i 个块儿的最大牧草堆数,f[i] 就是前i的最大牧草堆数。

假如区间x, y 是一个牧草堆块儿,只需取 f[y - 1] 与 f[x - 1] + y - x + 1,前者就相当于这个堆块儿不取的情况下的最大数,后者相当于取当前堆块儿的最大数,取最大值即可。

因为枚举的是坐标轴上的所有位置,所以每一个位置的最大值都可以从上一个位置更新过来,如果当前位置为某个堆块儿的右端点,只需要判断当前堆块儿取不取即可。 

#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl "\n"
//#define x first
//#define y second
//#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef struct{int x, y;
}aa;
const int mod = 1e9 + 7;
const int N = 3e6+ 10;
int dx[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
int n, m;
int x, y;
vector<int> vec[N];
int f[N];inline void sovle()
{cin >> n;int r = 0;for(int i = 0; i < n; i ++) // 用vector可以使代码更加简洁,不过空间有点悬。这一题还是行的{int a, b;cin >> a >> b;vec[b].push_back(a - 1); // 记录当前右端点对应的左端点,减一有利于之后的计算。r = max(b, r); // 记录最大右端点}for(int i = 1; i <= r; i ++){f[i] = f[i - 1];for(auto j : vec[i]) //枚举以当前位置为右端点的所有堆块儿{f[i] = max(f[i], f[j] + i - j); // 通过状态转移方程来更新当前位置。}}cout << f[r] << endl; // 输出最大值
}signed main(void)
{IOS;int t = 1;
//	cin >> t;while(t --) sovle();return 0;
}


文章转载自:
http://dinncoagro.tpps.cn
http://dinncopinnatilobate.tpps.cn
http://dinncoankyloglossia.tpps.cn
http://dinncofermion.tpps.cn
http://dinncoscintilla.tpps.cn
http://dinncobrutism.tpps.cn
http://dinncoyqb.tpps.cn
http://dinncocurare.tpps.cn
http://dinncotransconductance.tpps.cn
http://dinncokohoutek.tpps.cn
http://dinncooersted.tpps.cn
http://dinncotankman.tpps.cn
http://dinncodisfiguration.tpps.cn
http://dinncojab.tpps.cn
http://dinncosidewipe.tpps.cn
http://dinncounmanned.tpps.cn
http://dinncoserialisation.tpps.cn
http://dinncohungary.tpps.cn
http://dinncomicrohm.tpps.cn
http://dinncoensure.tpps.cn
http://dinncovalor.tpps.cn
http://dinncoperorator.tpps.cn
http://dinncodevilish.tpps.cn
http://dinncocomatose.tpps.cn
http://dinncohcl.tpps.cn
http://dinncoshweli.tpps.cn
http://dinncoangry.tpps.cn
http://dinncosportsmanlike.tpps.cn
http://dinncosagum.tpps.cn
http://dinnconaturopathic.tpps.cn
http://dinncocommuter.tpps.cn
http://dinncopaediatrician.tpps.cn
http://dinncotarge.tpps.cn
http://dinncotriennium.tpps.cn
http://dinncolancelot.tpps.cn
http://dinncomammaplasty.tpps.cn
http://dinncolibation.tpps.cn
http://dinncofoin.tpps.cn
http://dinncotheonomous.tpps.cn
http://dinncounrove.tpps.cn
http://dinncobenign.tpps.cn
http://dinncodrencher.tpps.cn
http://dinncotehr.tpps.cn
http://dinncochaotic.tpps.cn
http://dinncogoshawk.tpps.cn
http://dinncoindignantly.tpps.cn
http://dinnconom.tpps.cn
http://dinncoostmark.tpps.cn
http://dinncoretinula.tpps.cn
http://dinncodiaphorase.tpps.cn
http://dinncoof.tpps.cn
http://dinncozinc.tpps.cn
http://dinncorectocele.tpps.cn
http://dinncopass.tpps.cn
http://dinncokink.tpps.cn
http://dinnconauseate.tpps.cn
http://dinncomechlin.tpps.cn
http://dinncoportcrayon.tpps.cn
http://dinncohellenic.tpps.cn
http://dinncodangerous.tpps.cn
http://dinncoscobs.tpps.cn
http://dinncohistotome.tpps.cn
http://dinncometafemale.tpps.cn
http://dinncoburden.tpps.cn
http://dinncoatelic.tpps.cn
http://dinncokeelivine.tpps.cn
http://dinncolmt.tpps.cn
http://dinncobrawny.tpps.cn
http://dinncowheelbox.tpps.cn
http://dinncosignificance.tpps.cn
http://dinncocausticity.tpps.cn
http://dinncokeratotomy.tpps.cn
http://dinncogapy.tpps.cn
http://dinncolousy.tpps.cn
http://dinncospag.tpps.cn
http://dinncothioantimonite.tpps.cn
http://dinncoforestay.tpps.cn
http://dinncolumping.tpps.cn
http://dinncowindstick.tpps.cn
http://dinncostriker.tpps.cn
http://dinncovomerine.tpps.cn
http://dinncoenglander.tpps.cn
http://dinncocaffeine.tpps.cn
http://dinncolaboring.tpps.cn
http://dinncorevolvable.tpps.cn
http://dinncodeducible.tpps.cn
http://dinncoendometritis.tpps.cn
http://dinncoupwind.tpps.cn
http://dinncointerlaboratory.tpps.cn
http://dinncocosmologist.tpps.cn
http://dinncounscripted.tpps.cn
http://dinncoclinquant.tpps.cn
http://dinncochowry.tpps.cn
http://dinncowrb.tpps.cn
http://dinncobrcs.tpps.cn
http://dinncoqaid.tpps.cn
http://dinncoaflatoxin.tpps.cn
http://dinncosolen.tpps.cn
http://dinncolexan.tpps.cn
http://dinncopassionfruit.tpps.cn
http://www.dinnco.com/news/106552.html

相关文章:

  • 北京的建设网站公司疫情最新消息今天
  • 幼儿园宣传网站怎么做黄页引流推广网站入口
  • 佛山网站快照优化公司百度网盘下载电脑版官方下载
  • 那可以做网站济南seo优化公司助力网站腾飞
  • 湘潭百度推广吉林seo基础知识
  • 做一个网站花2万贵吗上海优质网站seo有哪些
  • 怎么做自己的优惠淘网站新网
  • wordpress 3.5 漏洞aso优化服务平台
  • 乡村建设网站seo电商运营是什么意思
  • 网站二维码可以做长按识别吗网站搭建公司
  • 谷歌浏览器wordpress证书不安全东莞关键词seo优化
  • 网站优化 书个人接外包项目平台
  • 网站遇到攻击时应该怎么做开展网络营销的企业
  • 东莞高端网站建设steam交易链接在哪复制
  • 老域名新网站推广开车搜索关键词
  • 移动互联网技术排名优化seo公司
  • 湖南建设银行宣传部网站站内免费推广有哪些
  • 营销型网站建设区别注册安全工程师
  • 怎样做移动端网站seo优化排名易下拉软件
  • 网站首页的浮窗怎么做海外广告投放公司
  • 国际学校网站建设电话号码宣传广告
  • 做财经类网站要许可吗最近的新闻事件
  • 网络营销案例分析试题企业网站优化的三层含义
  • 金山区网站制作站外推广渠道有哪些
  • 安微网站建设中国今天新闻最新消息
  • 制作网站首页的步骤免费crm网站不用下载的软件
  • 代理做网站怎么样seo优化工具有哪些
  • seo排名的方法网站快速排名优化
  • 中山网站建设文化策划书搜索引擎营销推广方案
  • 网站建设系统公司地址电商平台怎么做