• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
FightingForWorldFinal
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 5 6 7 ··· 10 下一页
2013年10月13日
timus1558 最短循环节
摘要: #define DeBUG#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std ;#define zero {0}#define INF 2000000000#define EPS 1e-6typedef long long LL;const double PI = acos(-1.0);... 阅读全文
posted @ 2013-10-13 22:10 Sky-J 阅读(318) 评论(0) 推荐(0)
2013年10月11日
HDUOJ Pick-up sticks 判断线段相交
摘要: Pick-up sticksTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1771Accepted Submission(s): 672Problem DescriptionStan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to 阅读全文
posted @ 2013-10-11 20:14 Sky-J 阅读(427) 评论(0) 推荐(0)
2013年10月9日
POJ TOY叉乘+二分
摘要: #define DeBUG#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std ;#define zero {0}#define INF 2000000000#define EPS 1e-6typedef long long LL;const double PI = acos(-1.0);inline int sgn(double x){return fabs 阅读全文
posted @ 2013-10-09 00:00 Sky-J 阅读(309) 评论(0) 推荐(0)
2013年10月5日
Ural 1750 Pakhom and the Gully (线段交,最短路)
摘要: #define DeBUG#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std ;#define zero {0}#define INF 200000000#define EPS 1e-6#define MM 1typedef long long LL;inline int sgn(dou... 阅读全文
posted @ 2013-10-05 20:58 Sky-J 阅读(342) 评论(0) 推荐(0)
2013年10月4日
POJ2187旋转卡壳
摘要: // POJ 2187 Beauty Contest -- Andrew凸包算法 + 点对距离最长(旋转卡壳)// 大意:给你一堆点,让你求出相隔最远的两点距离并输出// 要求:最后结果不需要开平方 应为距离的平方///*test data51 32 14 15 33 5 == 17*/#include #include #include using namespace std;const double Pzero = 0.000001;const int MAXP = 50005;struct Point{ double x, y;//点对应坐标 Point() {} ... 阅读全文
posted @ 2013-10-04 19:59 Sky-J 阅读(248) 评论(0) 推荐(0)
2013年10月1日
KMP模板
摘要: int b[MAXM]=zero;//根据需要改charint a[MAXN]=zero;int next[MAXM];void GetNext(int len)//得到b的next{ int i,j; for(i=1,j=0;i<=len;) { if(j==0||b[i-1]==b[j-1]) { next[i]=j; j++; i++; } else { j=next[j]; } }}int kmp(int lena,int lenb){ int i,j; for(i=0,j=0;i<lena;) { if(j==0||a[i]==b[j]) { if(a[i]!=b[j]. 阅读全文
posted @ 2013-10-01 22:29 Sky-J 阅读(188) 评论(0) 推荐(0)
c语言中的代码优化《转》
摘要: 在性能优化方面永远注意80-20原则,即20%的程序消耗了80%的运行时间,因而我们要改进效率,最主要是考虑改进那20%的代码。不要优化程序中开销不大的那80%,这是劳而无功的。第一招:以空间换时间 计算机程序中最大的矛盾是空间和时间的矛盾,那么,从这个角度出发逆向思维来考虑程序的效率问题,我们就有了解决问题的第1招--以空间换时间。比如说字符串的赋值:方法A:通常的办法#define LEN 32char string1 [LEN];memset (string1,0,LEN);strcpy (string1,"This is a example!!");方法B:cons 阅读全文
posted @ 2013-10-01 20:34 Sky-J 阅读(757) 评论(0) 推荐(0)
2013年9月17日
HDU4741异面直线距离与中垂线交点
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std ;#define zero {0}#define INF 2000000000#define eps 1e-6typedef long long LL;struct Point3{ double x, y, z; Point3() {} Point3(double x, double y,... 阅读全文
posted @ 2013-09-17 00:17 Sky-J 阅读(390) 评论(0) 推荐(0)
2013年9月14日
暴力程序之回文子串
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std ;#define zero {0}#define INF 2000000000#define eps 1e-6typedef long long LL;int Max=0;char a[1000];int n;char it[100];int f(string s){ //cout<<s< 阅读全文
posted @ 2013-09-14 19:22 Sky-J 阅读(221) 评论(0) 推荐(0)
2013年9月12日
关于取消同步带来问题的样例
摘要: #include #include using namespace std;int main(){ios::sync_with_stdio(false); cout>a; cout>a; printf("%d",a); scanf("%d",&a); cout<<a; return 0;}取消同步可以加速cin和cout但是使用要谨慎 阅读全文
posted @ 2013-09-12 14:05 Sky-J 阅读(232) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 10 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3