上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 47 下一页

2012年4月19日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2143除数为0re一次,用除法wa一次,加减互逆,乘除互逆,二者有一即可,这道题用除法会出问题。View Code #include <stdio.h>#include <string.h>#include <math.h>#include <stdlib.h>__int64 a,b,c;int gao(){ if(a*b==c||a*c==b||b*c==a||a+b==c||a+c==b||b+c==a)return 1; if(a!=0) if(b%a== 阅读全文
posted @ 2012-04-19 16:34 LegendaryAC 阅读(207) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2148View Code #include <stdio.h>#include <string.h>#include <math.h>#include <stdlib.h>int main(){ int t,n,l; int i; int s[1100]; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&l); for(i=1;i<=n;i++) s 阅读全文
posted @ 2012-04-19 16:07 LegendaryAC 阅读(148) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1847如果j-A[i]是必败态,j就是必胜态,显然0必败,一个dp的过程#include #include #include using namespace std;int A[15], win[1005];int... 阅读全文
posted @ 2012-04-19 15:46 LegendaryAC 阅读(222) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2192求出现的最多的那个数字出现的次数参考祖宗的方法搞的,排序+扫。View Code #include <stdio.h>#include <string.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)a-*(int*)b;}int a[11000];int main(){ int t,n,i; int s,ans; scanf("%d",&t); 阅读全文
posted @ 2012-04-19 15:39 LegendaryAC 阅读(195) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1691博客里面不好骂人,所以就不说太多了。有几点注意:1、象可能跑到不可能达到的位置2、兵要判断后退这种情况View Code 1 #include <stdio.h> 2 3 int map[20][20]; 4 int Kinga,Kingb;//红王坐标 5 int Kingc,Kingd;//黑王坐标 6 int abs(int a){return a>0?a:-a;} 7 int KingFaceToFace()//两王是否相对 8 { 9 int i; 10 ... 阅读全文
posted @ 2012-04-19 11:46 LegendaryAC 阅读(392) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3352View Code #include <stdio.h>int gcd(int a,int b){ return a%b==0?b:gcd(b,a%b);}__int64 lcg(int a,int b){ return (__int64)a*(__int64)b/(__int64)gcd(a,b)/(__int64)gcd(a,b);} int main(){ int a,b; while(scanf("%d%d",&a,&b),(a||b)) prin 阅读全文
posted @ 2012-04-19 01:55 LegendaryAC 阅读(217) 评论(0) 推荐(0) 编辑

2012年4月18日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1673阅读题View Code #include <stdio.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)a-*(int*)b;}int main(){ int t,n,i; int x[30]; scanf("%d",&t); while(t--) { scanf("%d",&n); for(i=0;i<n;i++) sca 阅读全文
posted @ 2012-04-18 21:29 LegendaryAC 阅读(263) 评论(0) 推荐(0) 编辑

2012年4月17日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1279按要求模拟View Code #include <stdio.h>int main(){ int t,n,p,f,f1; scanf("%d",&t); while(t--) { f=f1=1; scanf("%d",&n); p=n; while(n) { if(n%2&&n!=1){ f1=0; break; ... 阅读全文
posted @ 2012-04-17 00:13 LegendaryAC 阅读(204) 评论(0) 推荐(0) 编辑

2012年4月16日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1071按要求求出面积即可View Code #include <stdio.h>int main(){ int t; double x0,y0,x1,y1,x2,y2; double k,b; double a; double s; scanf("%d",&t); while(t--) { scanf("%lf%lf%lf%lf%lf%lf",&x0,&y0,&x1,&y1,&x2,&y2); k=(y 阅读全文
posted @ 2012-04-16 23:39 LegendaryAC 阅读(186) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4218不用删最后的空格,fuckView Code #include <stdio.h>#include <math.h>int main(){ int t,r,a; int i,j; int nCase=1; scanf("%d",&t); while(t--) { scanf("%d",&r); a=2*r+1; printf("Case %d:\n",nCase++); for(i=0;i<a;i+ 阅读全文
posted @ 2012-04-16 21:51 LegendaryAC 阅读(165) 评论(0) 推荐(0) 编辑
上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 47 下一页