Tourists 时间限制: 5 Sec 内存限制: 64 MB 题目描述 In Tree City, there are n tourist attractions uniquely labeled 1 to n. The attractions are connected by a set of ...
分类:
其他好文 时间:
2016-10-25 14:32:17
阅读次数:
249
思路:建出虚树然后treedp即可,f[i]表示将以i为根的子树与根隔绝的最小代价,f[i]=min(val[i],Σf[son[i]])(val[i]表示将点i与根隔绝的代价),需要注意的是如果i就是关键点那么f[i]=val[i]。 ...
分类:
其他好文 时间:
2016-10-24 13:24:13
阅读次数:
161
题目描述 Farmer John's cows like to play coin games so FJ has invented with a new two-player coin game called Xoinc for them. Initially a stack of N (5 <= ...
分类:
其他好文 时间:
2016-10-23 14:34:44
阅读次数:
408
题目链接:借教室 题意:给出n天得教室数目,m个借教室得单子,按顺序借教室,问哪个单子不满足并输出 分析:可以用线段树做,会T,常数比较大,选择用差分序列维护前缀和,二分答案即可 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> ...
分类:
其他好文 时间:
2016-10-22 21:19:56
阅读次数:
393
[hihoCoder#1381]Little Y's Tree 试题描述 小Y有一棵n个节点的树,每条边都有正的边权。 小J有q个询问,每次小J会删掉这个树中的k条边,这棵树被分成k+1个连通块。小J想知道每个连通块中最远点对距离的和。 这里的询问是互相独立的,即每次都是在小Y的原树上进行操作。 小 ...
分类:
其他好文 时间:
2016-10-22 00:00:41
阅读次数:
487
http://blog.csdn.net/ahjxly/article/details/8494217 http://blog.csdn.net/b_h_l/article/details/7581519 http://blog.chinaunix.net/uid-339069-id-3402668 ...
分类:
其他好文 时间:
2016-10-13 14:26:26
阅读次数:
189
#include "stdafx.h" #include <windows.h> #include <wininet.h> #include <tchar.h> #include <conio.h> #include <time.h> DWORD WriteDataToFile(LPSTR lpFi ...
分类:
编程语言 时间:
2016-10-06 12:40:12
阅读次数:
250
1 2 3 4 5 6 7 8 9 转成 3 6 9 2 5 8 1 4 7 #include "stdafx.h" #include <iostream> #include <vector> using namespace std; int _tmain(int argc, _TCHAR* arg ...
分类:
其他好文 时间:
2016-09-27 18:09:24
阅读次数:
218
在学习第一个C++程序的时候发现控制台程序的入口函数是int _tmain而不是main,查了资料才发现_tmain()是为了支持unicode所使用的main一个别名,宏定义在<stdafx.h>,有这么两行#include <stdio.h>#include <tchar.h>可以在头文件<tc ...
分类:
编程语言 时间:
2016-09-20 11:42:29
阅读次数:
131