题意:给定一个集合,含有n个数。浙理工先生和杭电先生各自有计算这个集合美丽值的方法。
浙理工先生的计算方法是:对于这个n个数的某个排列,此排列的美丽值为这个排列所有的区间最大公约数之和。然后这个集合的美丽值为n个数的所有排列的美丽值之和。
杭电先生的计算方法是:在这个n个数中选出k(1 ≤ k ≤ n)个数,对于某种选取方案,这种方案的美丽值为k个数的最大公约数乘上k。然后这个集合的美丽值为所...
分类:
其他好文 时间:
2015-07-29 19:30:58
阅读次数:
221
The most beautiful thing we can experience is the mysterious. It is the source of all true art and science.Albert Einstein, What I believe, 1930About ...
分类:
其他好文 时间:
2015-07-29 18:51:11
阅读次数:
136
题目链接:hdu 5316 Magician
线段树,区间合并,每个节点维护两端位置分别为奇奇,奇偶,偶奇,偶偶的beautiful 子串,合并的时候注意不能为空即可。
#include
#include
#include
using namespace std;
typedef long long ll;
const int maxn = 100005;
const...
分类:
其他好文 时间:
2015-07-28 21:04:28
阅读次数:
128
Problem F. Door LockTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100500/attachmentsDescriptionIt was a beautiful night at Yekat...
分类:
其他好文 时间:
2015-07-27 20:30:48
阅读次数:
149
Coco MonkeyThis is the story of a time long ago. There were these sailors stranded on a beautiful island full offcoconut trees. And what do ...
分类:
其他好文 时间:
2015-07-27 10:49:13
阅读次数:
95
I hope you know the beautiful Union-Find structure. In this problem, you're to implement something similar, but not identical.
The data structure you need to write is also a collection of disjoint ...
分类:
其他好文 时间:
2015-07-26 11:10:15
阅读次数:
93
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing e...
分类:
移动开发 时间:
2015-07-26 00:26:11
阅读次数:
245
题意:统计区间 [1,n] 中含有 '13' 且模 13 为 0 的数字有多少个。分析:由(HDU 2089 不要62)和(CF 55D - Beautiful numbers)想到该题做法,dp[i][j][f][mod],长度为i,前缀是否为1,是否已符合条件,余数为mod的数字个数。#incl...
分类:
其他好文 时间:
2015-07-25 12:07:06
阅读次数:
99
题意:如果一个数能被自己各个位的数字整除,那么它就叫 Beautiful numbers。求区间 [a,b] 中 Beautiful numbers 的个数。分析:先分析出,2~9 的最大的最小公倍数是 2520({5,7,8,9}),先预处理出所有可能的最小公倍数m[c]dp[i][d][c]表示...
分类:
其他好文 时间:
2015-07-25 11:58:11
阅读次数:
93
Beautiful GardenTime Limit: 15000msCase Time Limit: 8000msMemory Limit: 65536KB64-bit integer IO format:%lld Java class name:MainThere are n trees pla...
分类:
其他好文 时间:
2015-07-24 17:25:39
阅读次数:
98