摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1306思路:一开始还以为是求最长公共序列呢。。。仔细一看,orz.....就是求两个串匹配时公共部分字符最多相同的个数。。。View Code 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 int gcd(int a,int b){ 9 return a%b==0?b:gcd(b,a%b);10 }11 12 13 int m... 阅读全文
posted @ 2013-04-26 18:25 ihge2k 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2832坑爹的精度损失。。。。orz。。。。View Code 1 #define _CRT_SECURE_NO_WARNINGS 2 #include<iostream> 3 #include<cstdio> 4 #include<cstring> 5 #include<cmath> 6 using namespace std; 7 8 9 int main(){10 double n;11 while(~scanf("%lf",& 阅读全文
posted @ 2013-04-26 13:01 ihge2k 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1302思路:直接按着题目意思模拟就行了。。。View Code 1 #define _CRT_SECURE_NO_WARNINGS 2 #include<iostream> 3 #include<cstdio> 4 #include<cmath> 5 using namespace std; 6 7 int main(){ 8 double h,u,d,f; 9 while(~scanf("%lf",&h)&&h){10 阅读全文
posted @ 2013-04-26 12:28 ihge2k 阅读(671) 评论(0) 推荐(0) 编辑