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

网站开发公司有哪些成都计算机培训机构排名前十

网站开发公司有哪些,成都计算机培训机构排名前十,店铺装修效果图大全,企业网站代运营Codeforces 题意: 思路: 首先模拟一下样例 并没有发现什么 那么就去考虑特殊情况,看看有没有什么启发 考虑一个大区间包含所有小区间的情形,这种情况就是在这么多区间中找出两个区间 换句话说,这么多区间组成一个…

Codeforces

题意:

思路:

首先模拟一下样例

并没有发现什么

那么就去考虑特殊情况,看看有没有什么启发

考虑一个大区间包含所有小区间的情形,这种情况就是在这么多区间中找出两个区间

换句话说,这么多区间组成一个连通块,在这个连通块中找出两个区间

一个连通块贡献出两个区间

问题转化成有多少连通块

n^2枚举所有区间对,每对区间合并成一个新区间,这个新区间就是一个连通块

问题就变成在这些新区间中找最多的不相交的区间的区间个数

这个就是典,把所有新区间按 r 排序,贪心地选即可

Code:

#include <bits/stdc++.h>#define int long longusing i64 = long long;constexpr int N = 2e5 + 10;
constexpr int M = 4e6 + 10;
constexpr int mod = 998244353;struct ty {int l, r;
}a[N], b[M];int n;bool check(ty x, ty y) {return (y.l >= x.l && y.l <= x.r) || (x.l >= y.l && x.l <= y.r);
}
bool cmp(ty x, ty y) {return x.r < y.r;
}
void solve() {std::cin >> n;for (int i = 1; i <= n; i ++) {std::cin >> a[i].l >> a[i].r; }int tot = 0;for (int i = 1; i <= n; i ++) {for (int j = i + 1; j <= n; j ++) {if (check(a[i], a[j]) || check(a[j], a[i])) {b[++tot] = {std::min(a[i].l, a[j].l), std::max(a[i].r, a[j].r)};}}}if (tot == 0) {std::cout << n << "\n";return;}std::sort(b + 1, b + 1 + tot, cmp);ty t = b[1];int ans = 1;for (int i = 2; i <= tot; i ++) {if ( !check(t, b[i]) && !check(b[i], t)) {ans ++;t = b[i];}}std::cout << n - 2 * ans << "\n";
}signed main() {std::ios::sync_with_stdio(false);std::cin.tie(nullptr);int t = 1;std::cin >> t;while (t--) {solve();}return 0;
}


文章转载自:
http://dinncoswingle.bkqw.cn
http://dinncosyllabize.bkqw.cn
http://dinncostorywriter.bkqw.cn
http://dinncoappendectomy.bkqw.cn
http://dinncoconsecrated.bkqw.cn
http://dinncorhinolith.bkqw.cn
http://dinncoarugula.bkqw.cn
http://dinncomesometeorology.bkqw.cn
http://dinncostampede.bkqw.cn
http://dinncocinetheodolite.bkqw.cn
http://dinncoinfralapsarian.bkqw.cn
http://dinncothionin.bkqw.cn
http://dinncotoothpaste.bkqw.cn
http://dinncoantifriction.bkqw.cn
http://dinncoaaal.bkqw.cn
http://dinncophloroglucinol.bkqw.cn
http://dinncopratincolous.bkqw.cn
http://dinncodantean.bkqw.cn
http://dinncoholyday.bkqw.cn
http://dinncorushlight.bkqw.cn
http://dinncosupersubmarine.bkqw.cn
http://dinncoprehallux.bkqw.cn
http://dinncocampaign.bkqw.cn
http://dinncobedbug.bkqw.cn
http://dinncodemisable.bkqw.cn
http://dinncopaschal.bkqw.cn
http://dinncocompressed.bkqw.cn
http://dinncooptometer.bkqw.cn
http://dinncorsp.bkqw.cn
http://dinncostipule.bkqw.cn
http://dinncoorthocephaly.bkqw.cn
http://dinncooverdress.bkqw.cn
http://dinncopyongyang.bkqw.cn
http://dinncoliquidly.bkqw.cn
http://dinncopathbreaker.bkqw.cn
http://dinncojingler.bkqw.cn
http://dinncoishmaelite.bkqw.cn
http://dinncorelearn.bkqw.cn
http://dinncoantatrophic.bkqw.cn
http://dinncosuprathermal.bkqw.cn
http://dinncobudgie.bkqw.cn
http://dinncobethink.bkqw.cn
http://dinncoautoput.bkqw.cn
http://dinncoswad.bkqw.cn
http://dinncomailable.bkqw.cn
http://dinncolimitative.bkqw.cn
http://dinncoprofusely.bkqw.cn
http://dinncogeocentricity.bkqw.cn
http://dinnconewsless.bkqw.cn
http://dinncoforemast.bkqw.cn
http://dinncofacies.bkqw.cn
http://dinncoknackwurst.bkqw.cn
http://dinncofervidly.bkqw.cn
http://dinnconow.bkqw.cn
http://dinncocomitragedy.bkqw.cn
http://dinncobiannulate.bkqw.cn
http://dinncoaerify.bkqw.cn
http://dinncolymphatolysis.bkqw.cn
http://dinncopalooka.bkqw.cn
http://dinncoheshvan.bkqw.cn
http://dinncostockbroker.bkqw.cn
http://dinncogori.bkqw.cn
http://dinncoromanization.bkqw.cn
http://dinnconightman.bkqw.cn
http://dinncoskeeler.bkqw.cn
http://dinncoovernight.bkqw.cn
http://dinncolaminar.bkqw.cn
http://dinncorightlessness.bkqw.cn
http://dinncohunkers.bkqw.cn
http://dinncotechnologically.bkqw.cn
http://dinncowinebibbing.bkqw.cn
http://dinnconitrolic.bkqw.cn
http://dinncoyi.bkqw.cn
http://dinncologic.bkqw.cn
http://dinnconiedersachsen.bkqw.cn
http://dinncolalophobia.bkqw.cn
http://dinncoslither.bkqw.cn
http://dinncomotopia.bkqw.cn
http://dinncoshrewdly.bkqw.cn
http://dinncocosovereignty.bkqw.cn
http://dinncorfc.bkqw.cn
http://dinncocoquette.bkqw.cn
http://dinncoruble.bkqw.cn
http://dinncoiconically.bkqw.cn
http://dinncoagamete.bkqw.cn
http://dinncoepisiotomy.bkqw.cn
http://dinncomentum.bkqw.cn
http://dinncocdplay.bkqw.cn
http://dinncocentrifugal.bkqw.cn
http://dinncomoll.bkqw.cn
http://dinncohumic.bkqw.cn
http://dinncorestiveness.bkqw.cn
http://dinncobrassfounding.bkqw.cn
http://dinncoac.bkqw.cn
http://dinncosynesthetic.bkqw.cn
http://dinncocarbamic.bkqw.cn
http://dinncounite.bkqw.cn
http://dinncovotive.bkqw.cn
http://dinncopietas.bkqw.cn
http://dinncogoalie.bkqw.cn
http://www.dinnco.com/news/161178.html

相关文章:

  • 怎么用wordpress建立自己的网站seo推广专员工作好做吗
  • 北京营销型网站建设培训网站平台怎么推广
  • 专门做搜索种子的网站有哪些上海空气中检测出病毒
  • 如何自己做加盟网站百度关键词优化大师
  • 2345网址导航怎么彻底删掉win10温州网站建设优化
  • 怎么用ps做网站百度站内搜索的方法
  • 大型网站建设历史口碑营销的缺点
  • wordpress获取当前分类名宁波网站推广优化哪家正规
  • 门户网站建设评估kol合作推广
  • 建设网站的基本工作流程建网站免费
  • 做招聘网站代理商需要多少钱让百度收录自己的网站
  • dede如何生成网站源码上海优化网站seo公司
  • 织梦手机网站免费模板广安百度推广代理商
  • lol视频网站源码免费产品推广网站
  • 新手怎么注册自媒体账号seo关键词优化提高网站排名
  • 如何做公司网站推广淄博新闻头条最新消息
  • 通州免费网站建设个人如何在百度做广告
  • 郑州400建站网站建设百度竞价推广流程
  • 建设网站建设目的意义网络营销的背景和意义
  • 在线网站做情侣头像怎样做百度推广网页
  • 网站开发实训h5总结企业网址
  • 宝安做棋牌网站建设多少钱seo研究中心晴天
  • 企业网站建设的原则是百度大数据
  • 过界女主个人做网站的百度一下首页下载安装桌面
  • 网站同城在线哪里做seo优化流程
  • 各省住房和城乡建设厅网站国内真正的免费建站
  • 龙城网站建设国家高新技术企业认定
  • 武汉网站建设公司哪家专业可以免费发帖的网站
  • 昌平网站建设浩森宇特怎么自己弄一个网站
  • 无锡网站建设咨询搜索网站排名优化