BestCoder
fa茶
这个作者很懒,什么都没留下…
展开
-
HDU 4908——BestCoder Sequence
BC原创 2014-08-04 08:20:43 · 1245 阅读 · 0 评论 -
HDU5171GTY's birthday gift——矩阵快速幂裸题
http://acm.split.hdu.edu.cn/showproblem.php?pid=5171s(n)=s(n-1)+f(n-1)+f(n-2) f(n)=f(n-1)+f(n-2)#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>#define N 3#define ll long lo原创 2015-02-12 20:11:21 · 655 阅读 · 0 评论 -
HDU5175Misaki's Kiss again——数论
http://acm.split.hdu.edu.cn/showproblem.php?pid=5175若gcd(a,b)= a xor b=c,则b=a-c (打表发现的)c是a的因子,则枚举a的所有因子判断b是否满足a^b=c93MS 1104K 893 B#include<iostream>#include<cstring>#include<cstdio>#include<原创 2015-02-15 14:38:09 · 880 阅读 · 0 评论 -
HDU5172GTY's gay friends——区间查询(区间内的数互不相同)
http://acm.split.hdu.edu.cn/showproblem.php?pid=5172官方题解 一个区间是排列只需要区间和为len(len+1)2(len为区间长度),且互不相同,对于第一个问题我们用前缀和解决,对于第二个问题,预处理每个数的上次出现位置,记它为pre,互不相同即区间中pre的最大值小于左端点,使用线段树或Sparse Table即可在O(n)/O(nlogn)的原创 2015-02-15 16:46:16 · 1097 阅读 · 0 评论 -
BC#31.1002beautiful number——数位DP/暴力
http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=569&pid=1002先离线暴力出1~1e9中所有的美丽数,总共1299个#include<iostream>#include<cstring>#include<cstdio>const int maxn=2000;using namespace std;原创 2015-03-07 16:58:03 · 2627 阅读 · 0 评论 -
BC#31.1001 pairs——二分
http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=569&pid=1001#include<iostream>#include<cstring>#include<cstdio>#include<string>#include<algorithm>#include<set>#include<map>#i原创 2015-03-07 16:16:03 · 548 阅读 · 1 评论 -
BestCoder Round #32.Negative and Positive (NP)——哈希
http://acm.split.hdu.edu.cn/showproblem.php?pid=5183sigma(a[i],a[j])=sum[j]-sum[i-1]=K;枚举起点: 设起点为x,分两种情况: 1.起点x为奇,a[j]-a[x-1] = K,即a[j] = a[x-1]+K。 2.起点x为偶,a[j]-(-K) = a[x-1],即a[j] = a[x-1]-K。由于枚举到一个原创 2015-03-09 20:37:51 · 457 阅读 · 0 评论