bestcoder#55

这几个礼拜忙着实习离职和研究生开学的事情,so。。没打比赛
bc#55这场也错过了(其实去打台球了。。逃~)
hdu5432
简单题,二分

#include<stdio.h>
#include<string.h>
#include<math.h>
const double eps=1e-8;
int t,n;
int h[10010],w[10010];
int bsearch(int l,int r,double s)
{
    int i;
    while(l<=r)
    {
        int m=(l+r)>>1;
        double ss=0;
        for(i=1;i<=n;i++)
        {
            double tmp=w[i]*(h[i]-m)*1.0/h[i];
            if(m<=h[i]) ss+=tmp*tmp*(h[i]-m);
        }
        if(ss*2-s>eps) l=m+1;
        else if(ss*2-s<-eps) r=m-1;
        else return m;

    }
    return r;
}
int main()
{
    int i,j;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        double s=0;
        int maxh=-1;
        for(i=1;i<=n;i++)
        {
            scanf("%d",&h[i]);
            if(h[i]>maxh) maxh=h[i];
        }
        for(i=1;i<=n;i++) scanf("%d",&w[i]);
        for(i=1;i<=n;i++) s+=w[i]*w[i]*h[i];
        printf("%d\n",bsearch(0,maxh,s));
    }

    return 0;
}

hdu5433
待补
hdu5434
待补
hdu5435
待补
hdu5436
待补

Node.js资料临时记录

文档:http://docs.run.pivotal.io/starting/index.html
web应用控制台:https://console.run.pivotal.io
关于manifest.yml文件:http://docs.run.pivotal.io/devguide/deploy-apps/manifest.html#minimal-manifest
node.js的事件循环:http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/
node.js的初步入门:http://ourjs.com/detail/529ca5950cb6498814000005
pivotal Cloud Foundry:https://console.run.pivotal.io/organizations/0c2e2745-b6fd-4bd1-a2ec-291beb58c84e/spaces/d2b83c2c-d217-4c7a-a662-6fc3a41205e2
Cloud Foundry的Environment variable:http://docs.run.pivotal.io/devguide/deploy-apps/environment-variable.html

http://www.atatech.org/

https://github.com/alsotang/node-lessons