2014年10月11日
摘要: Problem DescriptionGiven a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A ... 阅读全文
posted @ 2014-10-11 14:14 Blundering_Chen 阅读(134) 评论(0) 推荐(0) 编辑
  2014年10月9日
摘要: #include#includeusing namespace std;/*用最小表示法求字符串S的最小字典序返回字典序最小的串的首字母位置*/int minstr(char s[]){ int len=strlen(s); int i=0,j=1; while(i=len) ... 阅读全文
posted @ 2014-10-09 09:15 Blundering_Chen 阅读(296) 评论(1) 推荐(0) 编辑
  2014年9月19日
摘要: 题意:给你n个数,m个查询,查询中包括一个数和一个最大编辑距离d,问n个数中和这个数的编辑距离不超过d的有多少个 编辑距离:http://baike.baidu.com/view/2020247.htm?from_id=792226&type=syn&fromtitle=Levenshtein... 阅读全文
posted @ 2014-09-19 14:25 Blundering_Chen 阅读(154) 评论(0) 推荐(0) 编辑
  2014年9月16日
摘要: 题意:两个操作:c l r x l到r之间的颜色变成x q l r 询问l到r有多少种颜色思路:记一个整数表示哪种颜色是否取了 这里真的是煞笔了,看到这一题第一直觉是异或,但是A^A=0,相同的肿么办..然后搜题解....反应了一个下午,发现有按位或这样神气的存在 1|1=1 1|0=1 0|1=1... 阅读全文
posted @ 2014-09-16 15:11 Blundering_Chen 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 题意:给你一个数组a,降序排序后,求sum+=0.95^(i-1)*ai 这题wa了两发,因为我没看清题意,要排序! 精度上面通过a^(i-1)=e^((i-1)*log(a)) 提到精度,就要想到底数 代码 1 #include "stdio.h" 2 #include "string.h" 3... 阅读全文
posted @ 2014-09-16 11:22 Blundering_Chen 阅读(115) 评论(0) 推荐(0) 编辑