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

山西网站开发建设网站企业案例

山西网站开发建设,网站企业案例,做网站一般几个人,杭州做网站吧https://vjudge.net/problem/Kattis-planestrainsbutnotautomobiles 题意#xff1a;给一个有向图#xff0c;火车可以由任意一个起点开始#xff0c;每一个点只能经过一次#xff0c;在坐火车的时候你可以选择坐飞机到另外一个点#xff0c;求坐飞机的最小次数#xff…https://vjudge.net/problem/Kattis-planestrainsbutnotautomobiles 题意给一个有向图火车可以由任意一个起点开始每一个点只能经过一次在坐火车的时候你可以选择坐飞机到另外一个点求坐飞机的最小次数以及求出可能在哪里坐飞机和降落。 样例 思路求坐飞机次数 就是裸的最小路径覆盖然后bfs求出可能的起点和终点。 #include iostream #include cstdio #include fstream #include algorithm #include cmath #include deque #include vector #include queue #include string #include cstring #include map #include stack #include set #include cstdlib #include list #define INF 0x3f3f3f3f3f3f3f3f #define inf 0x3f3f3f3f #define FILL(a,b) (memset(a,b,sizeof(a))) #define lson rt1 #define rson rt1|1 #define lowbit(a) ((a)-(a)) #define ios std::ios::sync_with_stdio(false);std::cin.tie(0);std::cout.tie(0); #define fi first #define sc second #define pb push_back #define endl \n #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pairll,ll pii; int dx[8] {-1,1,0,0,1,1,-1,-1},dy[8] {0,0,1,-1,-1,1,-1,1}; const ll mod998244353; const ll N 2e510; const ll M 250000; const double eps 1e-4; //const double piacos(-1); ll re(){ll x;scanf(%lld,x);return x;} ll qk(ll a,ll b){ll ans1;while(b){if(b1) ansans*a%mod;aa*a%mod;b/2;}return ans;} inline int read(){int sgn 1; int sum 0;char ch getchar();while (ch 0 || ch 9) {if(ch -) sgn -sgn;ch getchar();}while (0 ch ch 9) {sum sum*10(ch-0);ch getchar();}return sgn*sum;}ll n,m; vectorint g[N]; vectorint a; int match[N]; int vis[N]; int vis1[N]; bool dfs(int x){for(int i:g[x]){if(!vis1[i]){vis1[i]1;if(!match[i]||dfs(match[i])){match[x]i;match[i]x;return 1;}}}return 0; } void bfs(){FILL(vis,0);queueint q;for(int i1;in;i){if(!match[i]) q.push(i);}while(!q.empty()){int uq.front();q.pop();if(vis[u]) continue;vis[u]1;a.pb(u);for(int v:g[u]){if(v!match[u]match[v]){q.push(match[v]);}}}for(int in1;i2*n;i){if(!match[i]) q.push(i);}while(!q.empty()){int uq.front();q.pop();if(vis[u]) continue;vis[u]1;a.pb(u-n);//coutu-nendl;for(int v:g[u]){if(v!match[u]match[v]){q.push(match[v]);}}}sort(all(a));a.erase(unique(all(a)),a.end()); } void sovle(){nre(),mre();for(int i1;im;i){int ure(),vre();g[u].pb(vn);g[vn].pb(u);}ll ans0;for(int i1;in;i){FILL(vis1,0);if(dfs(i)) ans;}bfs();coutn-ans-1endl;if(n-ans-1!0)for(int i:a) couti ; }int main() {iosint t1;while(t--){sovle();}return 0; }
http://wiki.neutronadmin.com/news/85063/

相关文章:

  • 网站联盟营销江苏省住房和城乡建设厅官网
  • pyton 网站开发网站的建设及维护
  • 大连 做网站公司个人主页网页设计源代码
  • 做网站的时候网站的第一个字母怎么在网站标题前面显示 比如谷歌g一样万网域名申请网站
  • 网站首页改版需求有没有做高仿手表的网站
  • 太原网站seo搜索优化wordpress广告代码是什么意思
  • 做网站用是内网穿透好搜索引擎优化的概念
  • 网站建设与管理专业就业方向jsp做的网站代码
  • WordPress情侣网站wordpress产品参数多图
  • 如何查网站域名备案重庆梁平网站建设报价
  • 网站建设证有中国建设网查询平台网址
  • 网站的维护和推广广告在线设计制作
  • 建站套餐推荐怎么优化百度关键词
  • 网站关站域名解析错误连不上网
  • 网上有做logo的网站吗个人网站备案简介
  • 网站建设个人年终总结机械模板网站
  • 搭建一个网站的流程建设银行咸阳交费网站
  • 建什么网站可以赚钱怎么在网站添加关键词
  • 网站制作流程一般制作流程?巨量千川广告投放平台
  • 深圳网站建设有限公司宏润建设集团股份有限公司网站
  • 用php做的博客网站有哪些高州新闻 头条 今天
  • 网站建设运营维护方案搜索引擎推广特点
  • 做网站开源深圳市招投标交易中心
  • 公司网站的个人主页怎么做网络游戏传奇
  • 做网站要多少费用环保局网站如何做备案证明
  • 黄山建设网站公司电话号码wordpress 常用钩子
  • 杭州住房和城乡建设局网站首页企业软件管家
  • 网站模板安装好后腾讯街景地图全景在线
  • 哪些网站怎么进桓台做网站
  • 建造个网站花多少钱广西建设工会网站