摘要: #include #include using namespace std;const int N = 10000;int main(){ int T,len,i,j,cnt; char str[N]; cin>>T; while(T--){ cnt=1... 阅读全文
posted @ 2016-05-30 20:46 Lawliet__zmz 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 如图,下面代码#include #include using namespace std;const int N=10005;int p,q,prime[N],ans[N],num=0;int primePrint(){ int i,j; memset(prime,0,sizeof(pr... 阅读全文
posted @ 2016-05-29 21:19 Lawliet__zmz 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 最少拦截系统 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 32503 Accepted Submission(s): 12778 Probl 阅读全文
posted @ 2016-05-25 20:36 Lawliet__zmz 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Common Subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 32838 Accepted Submission(s): 阅读全文
posted @ 2016-05-24 19:26 Lawliet__zmz 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 聪明的kk 时间限制:1000 ms | 内存限制:65535 KB 难度:3 阅读全文
posted @ 2016-05-23 20:06 Lawliet__zmz 阅读(156) 评论(0) 推荐(0) 编辑
摘要: The Triangle 时间限制:1000 ms | 内存限制:65535 KB 难度:4 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure 1 shows a number triangle. Write a program that calcula 阅读全文
posted @ 2016-05-21 17:58 Lawliet__zmz 阅读(128) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(){ cout inline const _Ty& (max)(const _Ty& _Left, const _Ty& _Right) { // return larger of _Left and _... 阅读全文
posted @ 2016-05-21 17:57 Lawliet__zmz 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 超级台阶时间限制:1000 ms | 内存限制:65535 KB难度:3描述 有一楼梯共m级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第m级,共有多少走法?注:规定从一级到一级有0种走法。输入输入数据首先包含一个整数n(1using namespace std;const int N... 阅读全文
posted @ 2016-05-21 16:22 Lawliet__zmz 阅读(156) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;const int N = 25;int F[25] = {1,1};int Fib(int n){ if(F[n]) return F[n]; return F[n]=Fib(n-1)+Fib(n-2); }int main()... 阅读全文
posted @ 2016-05-21 15:21 Lawliet__zmz 阅读(95) 评论(0) 推荐(0) 编辑
摘要: floor(x),有时候也写做Floor(x),其功能是“向下取整”,或者说“向下舍入”,即取不大于x的最大整数(与“四舍五入”不同,下取整是直接去掉小数部分),例如:[1] x=3.14,floor(x)=3y=9.99999,floor(y)=9与floor函数对应的是ceil函数,向上取整,一... 阅读全文
posted @ 2016-05-19 20:14 Lawliet__zmz 阅读(664) 评论(0) 推荐(0) 编辑
摘要: 函数名称: pow函数原型: double pow( double x, double y );函数功能: 计算x的y次幂所属文件: 这个例子中计算了8的2次方: double x=8, y=2; double z; z=pow(x,y);在codeblocs打出po... 阅读全文
posted @ 2016-05-19 20:11 Lawliet__zmz 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 小数化分数2Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3364 Accepted Submission(s): 1232 Problem D... 阅读全文
posted @ 2016-05-19 17:43 Lawliet__zmz 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 找新朋友Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3596 Accepted Submission(s): 1658Problem Desc... 阅读全文
posted @ 2016-05-17 20:38 Lawliet__zmz 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 数字N的因子就是所有比N小又能被N整除的所有正整数,如12的因子有1,2,3,4,6.你想知道你的另一半吗? Input输入数据的第一行是一个数字T(1#include using namespace std;#define N 500005int a[N+5];int main(){ int... 阅读全文
posted @ 2016-05-15 09:32 Lawliet__zmz 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Max Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 257953 Accepted Submission(s): 61290 Prob 阅读全文
posted @ 2016-05-14 15:49 Lawliet__zmz 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main() { int j,i,k,n,m,t; int a[100002]; scanf("%d",&t); for (j=1;j<=t;j++) { ... 阅读全文
posted @ 2016-05-14 15:21 Lawliet__zmz 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1.#include #include #include using namespace std;int main(){ char a[60]; char b[60]; int score; while(scanf("%s",a)!=EOF){ if (!str... 阅读全文
posted @ 2016-05-12 13:17 Lawliet__zmz 阅读(140) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;int main(){ int T; char s1[1010],s2[1010]; cin>>T; for(int q=1;q=l2) k=l1; else k=l2;... 阅读全文
posted @ 2016-05-11 23:54 Lawliet__zmz 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;#define N 1000char s1[N];char s2[N];int main(){ int k,i,j; int l1,l2; int a[N]={0}; int b[N]={0}; ... 阅读全文
posted @ 2016-05-11 21:09 Lawliet__zmz 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://acm.split.hdu.edu.cn/showproblem.php?pid=2136利用素数打表的筛选法#include #include #include using namespace std;int a[1000000];int main(){ int ans,... 阅读全文
posted @ 2016-05-07 01:04 Lawliet__zmz 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 算是一个小技巧的水题吧,关键要画图才能明白注意一定是首尾相连的形状情况,因为有两刀是重合的,以题目4,6为例,所以按照图中的标记全部切割是4+6-2,2是重合的切割标记数量,数学意义上是4,6的最大公约数,这样如果4人,则1+8 2+3 4+5 6+7,如果6人,则1+2 3+4 5+6......... 阅读全文
posted @ 2016-05-05 02:29 Lawliet__zmz 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1、cin 1、cin.get() 2、cin.getline() 3、getline() 4、gets() 5、getchar()1、cin>> 用法1:最基本,也是最常用的用法,输入一个数字:#include using namespace std; main () { in... 阅读全文
posted @ 2016-04-28 11:20 Lawliet__zmz 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;int main(){ int n,b,s,ans,i,j,flag; while(cin>>n) { ans=0; for(i=0;i>b; flag=1; for(j=2;j#include#incl... 阅读全文
posted @ 2016-04-27 00:42 Lawliet__zmz 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 下面是我看到的一个神牛对ACM的总结,借鉴一下。 先个人简述下:07级本科,软件学院,09-10年创新中心ACM组组长。ACM/ICPC亚洲区3银1铜,东北地区2次一等奖,辽宁省2次一等奖。3年国家奖学金,2010年9月至2011年5月在微软亚洲研究院(MSRA)实习。以下是本人在大学... 阅读全文
posted @ 2016-04-26 22:04 Lawliet__zmz 阅读(200) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(){ int a,b,c,k; int tmp,ans; while(cin>>a>>b){ k=a*b; if(a<b){ tmp=a; a=b; b... 阅读全文
posted @ 2016-04-25 21:16 Lawliet__zmz 阅读(151) 评论(0) 推荐(0) 编辑