• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
FightingForWorldFinal
博客园    首页    新随笔    联系   管理    订阅  订阅
2013年7月11日
高效大数模板
摘要: 1 #include 2 #include 3 4 using namespace std; 5 6 const unsigned int MAX = 10000; //整型数组的最大长度 7 const long long WIDTHMAX = 1000000000; //整型数组val[MAX]的元素上限 8 const unsigned int WIDTH = 9; //输出整型数组val[MAX]的元素时的格式宽度,即整型数组val[MAX]的元素的最多位数 9 10 typedef struct node 11 { 12 long long ... 阅读全文
posted @ 2013-07-11 21:44 Sky-J 阅读(288) 评论(0) 推荐(0)
HDUOJ2298三分加二分
摘要: 首先这题是一道物理题,需要我们根据题意抽象一个函数出来。对物体的运动作分解后,可以得到:f(t)=x*tan(t)-g*x*x/(v*cos(t))^2/2,其中t表示v与x轴正向的夹角(弧度),f(t)表示物体的运动轨迹与直线x0=x的交点纵坐标。分析后可以得到该函数在区间(0,π/2)上先增后减,所以我们可以在该区间上三分,求出使函数取得极大值的角度t0。若f(t0)#include#includeusing namespace std;const double eps=1.0e-9;const double PI=acos(-1.0);const double g=9.8;double 阅读全文
posted @ 2013-07-11 16:47 Sky-J 阅读(196) 评论(0) 推荐(0)
HDUOJ PIE二分查找
摘要: #include #include #include #include #include #include #include #include #include #include#includeusing namespace std ;#ifdef DeBUG#define bug assert#else#define bug //#endif#define eps 1e-6int m,n;double pie[11000];bool test(double x)//判断是否每个都分成出x体积大的蛋糕的块数>=人数,=人数那最好了^_^{int sum=0;for(int i=0;i=( 阅读全文
posted @ 2013-07-11 15:10 Sky-J 阅读(411) 评论(0) 推荐(0)
HDUoj 3714三分查找
摘要: #include #include #include #include #include #include #include #include #include #include#includeusing namespace std ;#ifdef DeBUG#define bug assert#else#define bug //#endif#define eps 1e-10double a[10010],b[10010],c[10010];int m;inline double f(double x){int i;double maxx=a[0]*x*x+b[0]*x+c[0];for(i 阅读全文
posted @ 2013-07-11 13:17 Sky-J 阅读(246) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3