随笔分类 -  图论

2019 西安邀请赛 D
摘要:1 //n件物品,m种关系,(有关系的2个不能在同一组) 2 //把所有物品分为2组,希望最后2组的差值尽可能小,输出较大者 3 /* 4 二分图涂色+可行性(01)背包 5 dp[i] =1表示 最后差值为i可行 6 建图后,对于每个连通分量记录差值,来求所有的可行 7 */ 8 #include<bits/stdc++.h> 9 using namespace std; 10 int t,n, 阅读全文

posted @ 2019-10-05 17:14 cltt 阅读(248) 评论(0) 推荐(0) 编辑

2019 西安邀请赛 M
摘要:Problem Description There are n planets in the MOT galaxy, and each planet has a unique number from 1∼n. Each planet is connected to other planets through some transmission channels. There are m tran... 阅读全文

posted @ 2019-07-30 20:40 cltt 阅读(215) 评论(0) 推荐(0) 编辑

华东交通大学2018年ACM“双基”程序设计竞赛 K
摘要:MIKU酱是个玩游戏氪金的人,游戏公司给她制定了新的规则,如果想从关卡i到关卡j,你需要交一些钱就可以了,但同时,MIKU酱的爸爸zjw很爱她,所以她可以每过一关就向她爸要一次钱,但她爸每次给他的钱是固定的,MIKU酱是个不会节省的女孩,哪怕每次多出来的钱,她也会拿去买肥宅快乐水,所以每次要的钱一定 阅读全文

posted @ 2018-11-17 20:00 cltt 阅读(269) 评论(0) 推荐(0) 编辑

次小生成树
摘要:1 /* 2 最小生成树唯一吗,求出次小生成树 3 枚举每个非最小生成树里面的边, 4 加上该边后一定会形成环 5 最小生成树+该边-最小生成树在环中的最长边 6 */ 7 /* 8 #include 9 #include 10 #include 11 #include 12 #include 13 using namespace std; 14 #define ph... 阅读全文

posted @ 2018-11-17 10:53 cltt 阅读(135) 评论(0) 推荐(0) 编辑

图上两点之间的第k最短路径的长度 ACM-ICPC 2018 沈阳赛区网络预赛 D. Made In Heaven
摘要:131072K One day in the jail, F·F invites Jolyne Kujo (JOJO in brief) to play tennis with her. However, Pucci the father somehow knows it and wants to 阅读全文

posted @ 2018-09-14 22:16 cltt 阅读(260) 评论(0) 推荐(0) 编辑

poj 1986
摘要:Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 16447 Accepted: 5768 Case Time Limit: 1000MS Description Farmer John's cow 阅读全文

posted @ 2018-09-13 19:44 cltt 阅读(222) 评论(0) 推荐(0) 编辑

ACM-ICPC 2018 南京赛区网络预赛 L. Magical Girl Haze
摘要:262144K There are NN cities in the country, and MM directional roads from uu to v(1\le u, v\le n)v(1≤u,v≤n). Every road has a distance c_ici​. Haze is 阅读全文

posted @ 2018-09-04 21:21 cltt 阅读(217) 评论(0) 推荐(1) 编辑

树上任意两点间距离
摘要:// 任意两点间有唯一路径的无向图是树 //HDU 6446 Tree and Permutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s 阅读全文

posted @ 2018-08-28 00:21 cltt 阅读(1288) 评论(0) 推荐(0) 编辑

ACM训练联盟周赛 A. Teemo's bad day
摘要:65536K Today is a bad day. Teemo is scolded badly by his teacher because he didn't do his homework.But Teemo is very self-confident, he tells the teac 阅读全文

posted @ 2018-08-01 01:01 cltt 阅读(226) 评论(0) 推荐(0) 编辑

hiho 1050 树的直径
摘要:#1050 : 树中的最长路 #1050 : 树中的最长路 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 上回说到,小Ho得到了一棵二叉树玩具,这个玩具是由小球和木棍连接起来的,而在拆拼它的过程中,小Ho发现他不仅仅可以拼凑成一棵二叉树!还可以拼凑成一棵多叉树——好吧 阅读全文

posted @ 2018-07-30 00:19 cltt 阅读(166) 评论(0) 推荐(0) 编辑

最近公共祖先
摘要:1062 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 1062 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Ho最近发现了一个神奇的网站!虽然还不够像58同城那样神奇,但这个网站仍然让小Ho乐在其中,但这是为什么呢? “为什么呢?”小H 阅读全文

posted @ 2018-07-26 16:30 cltt 阅读(150) 评论(0) 推荐(0) 编辑

German Collegiate Programming Contest 2018​
摘要:1 // Coolest Ski Route 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 typedef long l... 阅读全文

posted @ 2018-07-19 19:56 cltt 阅读(324) 评论(0) 推荐(0) 编辑

The 2018 ACM-ICPC Chinese Collegiate Programming Contest Moving On
摘要:Firdaws and Fatinah are living in a country with nn cities, numbered from 11 to nn.Each city has a risk of kidnapping or robbery. Firdaws's home locat 阅读全文

posted @ 2018-07-19 10:55 cltt 阅读(615) 评论(0) 推荐(0) 编辑

German Collegiate Programming Contest 2015 计蒜课
摘要:// Change of Scenery 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 typedef long long ll; 10 typedef pairP; 11 int n,m,k; 12 con... 阅读全文

posted @ 2018-07-15 20:24 cltt 阅读(135) 评论(0) 推荐(0) 编辑

团体程序设计天梯赛-练习集
摘要:1 L2-001 紧急救援(25 分) 2 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 typedef pairP; 12 int n,m,s,d; 13 const int N=550; 14 c... 阅读全文

posted @ 2018-07-15 14:23 cltt 阅读(293) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示