上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 50 下一页
摘要: 题意:裸kmp思路:kmp模板#include#include#includeusing namespace std;#define MaxSize 10005int s[1000005],t[10005];int next2[MaxSize];void GetNext(int t[],int le... 阅读全文
posted @ 2015-08-14 11:28 gongpixin 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 题意:统计单串中从某个位置以前有多少重复的串思路:kmp模板#include#include#includeusing namespace std;#define MaxSize 1000005char str[MaxSize];int next2[MaxSize];void GetNext(cha... 阅读全文
posted @ 2015-08-14 11:26 gongpixin 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 题意:小数大数加法思路:大数模板#include#include#includeusing namespace std;void plu(char *a,char *b){//注意存储方式:整数倒着存,小数正着存,看代码需注意 int i,j,k,lena,lenb,lena1,lena2,l... 阅读全文
posted @ 2015-08-14 11:20 gongpixin 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 题意:整数大数加法思路:大数模板#include#include#include#includeusing namespace std;#define MAXN 9999//万进制#define DLEN 4//4位class BigNum{private: int a[500];//可以控制... 阅读全文
posted @ 2015-08-14 11:18 gongpixin 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 题意:整数大数加法思路:大数模板#include#include#include#includeusing namespace std;#define MAXN 9999//万进制#define DLEN 4//4位class BigNum{private: int a[500];//可以控制... 阅读全文
posted @ 2015-08-14 11:16 gongpixin 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 题意:整数大数乘法思路:大数模板#include#include#include#includeusing namespace std;#define MAXN 9999//万进制#define DLEN 4//4位class BigNum{private: int a[50000];//可以... 阅读全文
posted @ 2015-08-14 11:12 gongpixin 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 题意:整数大数加法思路:大数模板#include#include#include#includeusing namespace std;#define MAXN 9999//万进制#define DLEN 4//4位class BigNum{private: int a[500];//可以控制... 阅读全文
posted @ 2015-08-14 11:08 gongpixin 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Description输入二个正整数x0,y0(2#include#includeusing namespace std;int gcd(int a,int b){ return b==0?a:gcd(b,a%b);}int main(){ int x,y,v,k,m=0,i;... 阅读全文
posted @ 2015-08-10 14:41 gongpixin 阅读(988) 评论(0) 推荐(2) 编辑
摘要: 设两个数为x和y,其最大公约数为a,则最小公倍数为(x/a)*(y/a)*a=xy/a,最大公约数和最小公倍数的乘积为xy/a*a=xy得证 阅读全文
posted @ 2015-08-10 11:51 gongpixin 阅读(895) 评论(0) 推荐(0) 编辑
摘要: 题意:N种糖果,不能把一样的放在一起吃,即第一次吃一种,下一次吃另一种。思路:找到个数最多的糖果种类(最大的数目记作 ma,该糖果种类记为a),首先把这n个糖果放到n个抽屉里面,然后把剩余的N-1种糖果往抽屉里面放。因为n是最大的数目,即剩余的N-1种糖果的放置过程中,每一种糖果都可以分别放到不同的... 阅读全文
posted @ 2015-06-04 16:41 gongpixin 阅读(400) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 50 下一页