摘要: upper_bound 大于找上界lower_bound 大于等于找下界 阅读全文
posted @ 2015-08-12 20:58 Painting、时光 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 原文地址 http://blog.sina.com.cn/s/blog_76b0cde40100t32r.html被2整除的数是偶数。被3整除的数必须各个位数上的数加起来为三的倍数,比如136,1+3+6=10不行,147=1+4+7=12,就可以。被5整除个位为0或者5.能被7整除的数的特征一个数... 阅读全文
posted @ 2015-08-12 20:49 Painting、时光 阅读(4325) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5371/*先用Manacher算法得出最长回文子串,然后用set维护ans的值对所有回文的长度进行排序, 那么之后的点如果覆盖了最接近的点那么那么点肯定是覆盖了当前点,用二分得到最近不大于u的距离S.upper_b... 阅读全文
posted @ 2015-08-12 20:44 Painting、时光 阅读(105) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5233/*用map和set进行离散化,离散化就是对于大数据进行重新编号*//************************************************* Author :Powa... 阅读全文
posted @ 2015-08-12 18:40 Painting、时光 阅读(144) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5340/*Manacher算法:O(n) 实现最长回文子串算法实现:先向原字符串中插入一个原来串不存在的字符,一般用'#',再O(n)遍历一遍,用一个数组p[i]来记录以str[i]为中心的回文半径(注意str[i... 阅读全文
posted @ 2015-08-12 15:59 Painting、时光 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 格雷值与二进制转化公式,G[i] = B[i]^B[i-1],二进制前面补0dp[i][j]定义为当前是第i个格雷值,值是j的和* Author :powatr* Created Time :2015-8-11 13:19:46* File Name :1007.cpp **... 阅读全文
posted @ 2015-08-12 11:17 Painting、时光 阅读(151) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5373/************************************************* Author :Powatr* Created Time :2015-8-12 9:23:... 阅读全文
posted @ 2015-08-12 11:07 Painting、时光 阅读(129) 评论(0) 推荐(0) 编辑