题目 题目 分析 双向bfs,对着书打的,我还调了好久。 代码 cpp include include include include using namespace std; const int maxs=20,maxn=150; const ...
分类:
其他好文 时间:
2017-12-16 19:44:09
阅读次数:
164
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3593 题意: 给定4个n(1≤n≤4000)元素集合A, B, C, D,要求分别从中选取一个元 ...
分类:
其他好文 时间:
2017-12-16 18:35:53
阅读次数:
181
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4480 题意: 你的任务是设计一个包含若干层的联合国大楼,其中每层都是一个等大的网格。有若干国家需 ...
分类:
其他好文 时间:
2017-12-14 22:09:19
阅读次数:
142
【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 1.N/s1 s1 v2的话。 可以想见,如果第二种物品的数量超过了s1的话,显然可以把它占的体积都用来买物品1,因为那样更优。 则我们第二种物品最多只要枚举到s1就可以了。 同理s2 v1 【代码】 cpp / 1.Shoud ...
分类:
其他好文 时间:
2017-12-14 13:34:06
阅读次数:
172
【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 迭代加深搜索。 每次抽动操作最多只会让中间那一块的区域离目标的“距离”减少1. 以这个作为剪枝。 枚举最大深度。 就能过了。 【代码】 cpp include include include include include us ...
分类:
其他好文 时间:
2017-12-14 12:03:08
阅读次数:
113
题意:求$\sum_{i=1}^n \sum_{j=1}^n gcd(i,j),n<=1e10$ 之前刚好在UVA上也做过一个这样求和的题目,不过那个数据范围比较小,一开始用类似的方法 $ans=\sum_{i=1}^n \sum_{j=1}^i gcd(i,j)-\sum_{i=1}^n i$ 先 ...
分类:
其他好文 时间:
2017-12-13 23:59:18
阅读次数:
331
https://vjudge.net/problem/UVA-272 【分析】:标记一下。 【代码】: ...
分类:
其他好文 时间:
2017-12-13 17:23:18
阅读次数:
142
InputThe input consists of a sequence of matrix specifications. Each matrix specification consists of the rowand column dimensions in that order on a ...
分类:
其他好文 时间:
2017-12-10 15:58:41
阅读次数:
151
Input The program input is from a text file. Each data set in the file stands for a particular set of points. For each set of points the data set cont ...
分类:
其他好文 时间:
2017-12-09 22:37:26
阅读次数:
185
题目 题目 分析 很巧秒的一道题目,对着绿书瞎yy一会。 联一下必须要走的几条边,然后会形成几个联通分量,统计里面度数为奇数的点,最后再减去2再除以2。这样不断相加的和加上e再乘以t就是答案, 为什么呢?题目要求最短距离,那么必定是欧拉道路,那么为了构造出最短欧拉道路,要 ...
分类:
其他好文 时间:
2017-12-09 19:30:32
阅读次数:
213