自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 二分迭代求等比数列和

首先说明一下,为什么不直接套公式呢?因为(A/B)%C需要求B%C的模逆元,然后B,C还不一定是互素的,不互素,就没法把除法逆向为乘法了(至少我没听说过)。等比数列求和也可以用矩阵来写,这个主要看人。用二分来写比较简单,下面是代码int quik_sum(int a,int x){ int res = 1; while(x) { if(x&1) res = r

2015-08-16 00:33:44 442

原创 POJ 1170 暴搜+dp剪枝优先队列+状压

DescriptionIn a shop each kind of product has a price. For example, the price of a flower is 2 ICU (Informatics Currency Units) and the price of a vase is 5 ICU. In order to attract more cus

2015-08-15 23:46:18 296

原创 归并排序求逆序

LL inverse(int *arr, int len){ if (len==1)return 0; LL inverseLeft=inverse(arr, len/2); LL inverseRight=inverse(arr+len/2, len-len/2); if(inverseRight>=mod) inverseRight %= mod; i

2015-08-15 23:42:09 229

转载 矩阵快速幂模板

struct mat{ ll s[N][N]; mat(){ memset(s,0,sizeof s); } mat operator *(const mat c){ mat ans ; memset(ans.s,0, sizeof ans.s); for(int i=0;i<N;i++) for(int j=0;j<N;j++)

2015-08-15 23:37:34 316

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除