题意:一个农夫有n头牛,他希望将这些牛按照编号 1~n排成一条直线,允许有几头牛站在同一点,但是必须按照顺序,有一些牛关系比较好,希望站的距离不超过某个值,而有一些牛关系不太好,所以希望站的距离大于等于某个值,问1号牛和n号牛之间的最远距离是多少。差分约束的裸题,对于 d[v] - d[u] ≤ w...
分类:
其他好文 时间:
2015-09-06 23:05:20
阅读次数:
201
放假刷了一个月的水题,集中写一下题解吧。bzoj1858:线段树随便维护一下。 code
bzoj2705:莫比乌斯反演裸题。 code
bzoj1202:并查集,但是我写了一种跟floyd很像的奇怪的东西。 code
bzoj1072:暴力。
bzoj2431:dp f[i][j]=sum(f[i-1],[k]) code
bzoj3505:组合数学。 code
bzoj1058:...
分类:
其他好文 时间:
2015-08-31 13:42:02
阅读次数:
210
最小生成树裸题,没有初始化都能AC,看来测试数据只有一组
#include
#include
#include
#include
#define inf 1<<30
#define maxn 105
using namespace std;
struct stu
{
double x,y;
};
stu mapp[maxn];
int n;
vectorroot[maxn];
double...
分类:
其他好文 时间:
2015-08-26 01:54:00
阅读次数:
170
最小生成树裸题,懒得写,直接模板
#include
#include
#include
#include
#define inf 1<<30
#define maxn 30
using namespace std;
int n;
vectormapp[maxn];
int vaule[maxn][maxn];
int visit[maxn];
void prim()
{
int d[max...
分类:
其他好文 时间:
2015-08-26 01:51:32
阅读次数:
161
http://acm.hdu.edu.cn/showproblem.php?pid=4911/*裸题有重复的不能用树状数组!!!!sort的时候会出错*//************************************************* Author :Powatr*...
分类:
编程语言 时间:
2015-08-19 19:34:43
阅读次数:
134
Roads in the North
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 2358
Accepted: 1156
Description
Building and maintaining roads among communities in th...
分类:
其他好文 时间:
2015-08-17 19:39:57
阅读次数:
97
1094 - Farthest Nodes in a Tree
PDF (English)
Statistics
Forum
Time Limit: 2 second(s)
Memory Limit: 32 MB
Given a tree (a connected graph with no cycles), yo...
分类:
其他好文 时间:
2015-08-17 17:20:59
阅读次数:
155
Problem Description
Eddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his small room, and he usually puts out his newest pic...
分类:
编程语言 时间:
2015-08-17 17:19:11
阅读次数:
264
In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If two QS want to get connected, they need to buy two
network adapter...
分类:
Web程序 时间:
2015-08-17 12:03:17
阅读次数:
183
题目大意:有N个点,M条有向边。现在要求你以1为根,构造出一棵最小生成树,问这棵最小生成树能否被构造出来,如果可以,总权值是多少解题思路:朱刘算法的裸题,我只想吐槽一下POJ,用的是double型的,输出时是%.2lf,结果是WA
换成了%.2f就A了。。这什么情况,白白花费了1个多小时去调错。。#include
#include
#include <cmat...
分类:
编程语言 时间:
2015-08-17 01:06:03
阅读次数:
153