摘要: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,
阅读全文
摘要: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...
阅读全文
摘要:MIKU酱是个玩游戏氪金的人,游戏公司给她制定了新的规则,如果想从关卡i到关卡j,你需要交一些钱就可以了,但同时,MIKU酱的爸爸zjw很爱她,所以她可以每过一关就向她爸要一次钱,但她爸每次给他的钱是固定的,MIKU酱是个不会节省的女孩,哪怕每次多出来的钱,她也会拿去买肥宅快乐水,所以每次要的钱一定
阅读全文
摘要:1 /* 2 最小生成树唯一吗,求出次小生成树 3 枚举每个非最小生成树里面的边, 4 加上该边后一定会形成环 5 最小生成树+该边-最小生成树在环中的最长边 6 */ 7 /* 8 #include 9 #include 10 #include 11 #include 12 #include 13 using namespace std; 14 #define ph...
阅读全文
摘要: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
阅读全文
摘要:Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 16447 Accepted: 5768 Case Time Limit: 1000MS Description Farmer John's cow
阅读全文
摘要: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
阅读全文
摘要:// 任意两点间有唯一路径的无向图是树 //HDU 6446 Tree and Permutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s
阅读全文
摘要: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
阅读全文
摘要:#1050 : 树中的最长路 #1050 : 树中的最长路 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 上回说到,小Ho得到了一棵二叉树玩具,这个玩具是由小球和木棍连接起来的,而在拆拼它的过程中,小Ho发现他不仅仅可以拼凑成一棵二叉树!还可以拼凑成一棵多叉树——好吧
阅读全文
摘要:1062 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 1062 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Ho最近发现了一个神奇的网站!虽然还不够像58同城那样神奇,但这个网站仍然让小Ho乐在其中,但这是为什么呢? “为什么呢?”小H
阅读全文
摘要: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...
阅读全文
摘要: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
阅读全文
摘要:// 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...
阅读全文
摘要: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...
阅读全文