• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
FightingForWorldFinal
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 5 6 7 8 9 10 下一页
2013年7月31日
HDU1848取牌博弈与模板
摘要: 出处http://blog.csdn.net/mishifangxiangdefeng/article/details/7187215Fibonacci again and againTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3408Accepted Submission(s): 1412Problem Description任何一个大学生对菲波那契数列(Fibonacci numbers)应该都不会陌生,它是这样定义的:F(1)=1;F 阅读全文
posted @ 2013-07-31 22:21 Sky-J 阅读(273) 评论(0) 推荐(0)
HDU1791三点确定一个圆
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 using namespace std ;15 #ifdef DeBUG16 #define bug assert17 #else18 #define bug //19 #endif20 #define zero {0}21 #define INF 200000000022 #de... 阅读全文
posted @ 2013-07-31 15:30 Sky-J 阅读(315) 评论(0) 推荐(0)
2013年7月28日
筛选法求素数
摘要: C++ Code123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051筛法素数产生器语法:result=prime(inta[],intn);参数:a[]:用于返回素数的数组n:产生n以内的素数,按升序放入a[]中返回值:n以内素数的个数注意:其中W[],B[]已知,W[i]>0且W[i]与W[j]互质,求a源程序:intprime(inta[],intn){inti,j,k,x,num,*b;n++;n/=2;b=(int*)malloc(sizeof(i 阅读全文
posted @ 2013-07-28 21:56 Sky-J 阅读(174) 评论(0) 推荐(0)
最小生成树算法合集
摘要: 1 kruskal 1 struct seg 2 { 3 int a; 4 int b; 5 int p; 6 }; 7 seg v[100];//边的最大值 8 int father[30];//最大限为点的最大值 9 int cmp(seg a,seg b)10 {11 return a.pD[j])29 {30 min=D[j];31 k=j;32 }33 }34 visit[k]=1;35 len... 阅读全文
posted @ 2013-07-28 16:33 Sky-J 阅读(228) 评论(0) 推荐(0)
2013年7月27日
HDU1875prim算法求最小生成树
摘要: 畅通工程再续Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10363Accepted Submission(s): 3152 Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建 阅读全文
posted @ 2013-07-27 20:38 Sky-J 阅读(201) 评论(0) 推荐(0)
2013年7月26日
计算几何公式集锦
摘要: 1---计算多边形重心方法:(1)划分多边形为三角形:以多边形的一个顶点V为源点(V可取输入的第一个顶点),作连结V与所有非相邻顶点的线段,即将原N边形或分为(N-2)个三角形;(2)求每个三角形的重心和面积:设某个三角形的重心为G(cx,cy),顶点坐标分别为A1(x1,y1),A2(x2,y2),A3(x3,y3),则有cx = (x1 + x2 + x3)/3.同理求得cy。求面积的方法是s = ( (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1) ) / 2,当A1,A2,A3顺时针排列时取-,否则取正(此定理不证)。事实上,在求每个三角形时. 阅读全文
posted @ 2013-07-26 10:21 Sky-J 阅读(771) 评论(0) 推荐(0)
2013年7月24日
母函数模板
摘要: HDU1398#includeusing namespace std;int main(){ //freopen("C:\\Users\\Sky\\Desktop\\1.in","r",stdin);//PLEASE DELETE IT!!!!!!!!!!!!!!!!!!!!!!!! int a[350],b[350],i,j,k,n; while(cin>>n&&n) { for(i=0; i#includeconst int N=102;int min[N],max[N],c1[N],c2[N];int main(){ i 阅读全文
posted @ 2013-07-24 20:42 Sky-J 阅读(223) 评论(0) 推荐(0)
常用函数集锦
摘要: atof(将字符串转换成浮点型数)atoi(将字符串转换成整型数)atol(将字符串转换成长整型数)strtod(将字符串转换成浮点数)strtol(将字符串转换成长整型数)strtoul(将字符串转换成无符号长整型数)toascii(将整型数转换成合法的ASCII 码字符)toupper(将小写字母转换成大写字母)tolower(将大写字母转换成小写字母) 阅读全文
posted @ 2013-07-24 17:13 Sky-J 阅读(197) 评论(0) 推荐(0)
HDU1212加深下对取模运算的理解
摘要: Big NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3771Accepted Submission(s): 2586 Problem DescriptionAs we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to cal 阅读全文
posted @ 2013-07-24 16:36 Sky-J 阅读(285) 评论(0) 推荐(0)
HDU1022 queue和vector模拟
摘要: Train Problem ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15571Accepted Submission(s): 5772 Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(becau 阅读全文
posted @ 2013-07-24 16:08 Sky-J 阅读(252) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3