上一页 1 ··· 10 11 12 13 14
摘要: Description Edward 得到了一个长度为 N 的整数序列,他想找出这里面有多少个“幸运的”连续子序列。一个连续子序列被称为“幸运的”,当且仅当该子序列内的整数之和恰好是 K 的整数倍数。他请求你写一个程序来计算他喜欢的连续子序列个数. Edward 得到了一个长度为 N 的整数序列,他 阅读全文
posted @ 2016-04-03 19:47 Lweleth 阅读(451) 评论(0) 推荐(0) 编辑
摘要: <!-- 正文内容 --> 问题描述 给你三个数a,b,c,求a的b次的前c位数(不够c位输出全部即可) 输入 输入数据有多组,每组占一行,有三个整数,之间有空格。(0<a,b<2147483648,0<c<10) 输出 对于每组输入数据,输出一行. 样例输入 55 20 6 10 5 2 样例输出 阅读全文
posted @ 2016-04-02 15:27 Lweleth 阅读(202) 评论(0) 推荐(0) 编辑
摘要: C. Pearls in a Row There are n pearls in a row. Let's enumerate them with integers from 1 to n from the left to the right. The pearl number i has the 阅读全文
posted @ 2016-04-02 13:57 Lweleth 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=3068 Problem Description 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等 Input 输 阅读全文
posted @ 2016-04-02 13:31 Lweleth 阅读(556) 评论(0) 推荐(0) 编辑
摘要: Description Input Output Sample Input Sample Output 阅读全文
posted @ 2016-04-02 13:06 Lweleth 阅读(342) 评论(0) 推荐(0) 编辑
摘要: Given two integers, a and b, you should check whether a is divisible by b or not. We know that an integer a is divisible by an integer b if and only i 阅读全文
posted @ 2016-04-02 12:43 Lweleth 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 1 void daa() 2 { 3 int k=0; 4 for(int i=2;i<100000;i++) 5 { 6 if(x[i]==0) 7 { 8 prime[k]=i; 9 for(int j=i*2; j<100000; j+=i) 10 x[j]=1; 11 k++; 12 } 1 阅读全文
posted @ 2016-03-01 12:54 Lweleth 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 1 void makeNext(const char P[],int next[]) 2 { 3 int q,k;//q:模版字符串下标;k:最大前后缀长度 4 int m = strlen(P);//模版字符串长度 5 next[0] = 0;//模版字符串的第一个字符的最大前后缀长度为0 6 f 阅读全文
posted @ 2016-02-13 15:14 Lweleth 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 1 typedef long long ll; 2 ll mod_pow(ll x, ll n, ll mod){ 3 ll res = 1; 4 while( n > 0 ){ 5 if( n & 1 ) res = res * x % mod; 6 ... 阅读全文
posted @ 2015-11-28 10:04 Lweleth 阅读(169) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14