摘要: 时间限制:10000ms 单点时限:2000ms 内存限制:512MB 描述小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为一段数构成的数列。现在小Hi想知道一部作品中出现了多少不同的旋律?#include#include#include#define rg reg... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(122) 评论(0) 推荐(0) 编辑
摘要: string string string Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 801 Accepted ... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(74) 评论(0) 推荐(0) 编辑
摘要: Chip Factory Time Limit: 18000/9000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 3409 Accepted Subm... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 转: http://blog.csdn.net/xzxxzx401/article/details/52196950 题意很明确是线段树,需要三种操作:区间更新(加值),区间开根号,区间求和。区间开根号就是区间内部每一个值开根号。思路先膜吧:我和这个大佬的代码风格很像,所以看的很舒服... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 1239 欧拉函数之和 基准时间限制:3 秒 空间限制:131072 KB 分值: 320 难度:7级算法题 对正整数n,欧拉函数是小于或等于n的数中与n互质的数的数目。此函数以其首名研究者欧拉命名,它又称为Euler’s totient function、φ函数、欧拉商数等。例如:... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(96) 评论(0) 推荐(0) 编辑
摘要: lyk有两序列a和b。 lyk想知道存在多少对x,y,满足以下两个条件。 1:gcd(x,y)=1。 2: abxabx = baybay 。例如若a={1,1,1},b={1,1,1}。那么存在7对,因为除了x=2,y=2或x=3,y=3外都满足条件。 Input 第一行一个数... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 莫比乌斯函数,由德国数学家和天文学家莫比乌斯提出。梅滕斯(Mertens)首先使用μ(n)(miu(n))作为莫比乌斯函数的记号。具体定义如下: 如果一个数包含平方因子,那么miu(n) = 0。例如:miu(4), miu(12), miu(18) = 0。 如果一个数不包含平方因... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(126) 评论(0) 推荐(0) 编辑
摘要: bool book[N]; int prime[N],euler[N]; int res; void eratosthenes_sieve() { res=0; memset(book,false,sizeof(book)); for(int i=2;i<m... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(75) 评论(0) 推荐(0) 编辑
摘要: Claris loves painting very much, so he painted a tree with beautiful colors. The tree is a rooted tree with nn nodes which are conveniently la... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(108) 评论(0) 推荐(0) 编辑
摘要: As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:... 阅读全文
posted @ 2017-09-19 21:17 黑码的博客 阅读(196) 评论(0) 推荐(0) 编辑