题解

72 条题解

  • 0
    @ 2013-08-05 23:53:45

    测试数据 #0: Accepted, time = 0 ms, mem = 2788 KiB, score = 10
    测试数据 #1: Accepted, time = 0 ms, mem = 2788 KiB, score = 10
    测试数据 #2: Accepted, time = 0 ms, mem = 2780 KiB, score = 10
    测试数据 #3: Accepted, time = 0 ms, mem = 2784 KiB, score = 10
    测试数据 #4: Accepted, time = 0 ms, mem = 2784 KiB, score = 10
    测试数据 #5: WrongAnswer, time = 62 ms, mem = 2788 KiB, score = 0
    测试数据 #6: Accepted, time = 140 ms, mem = 2792 KiB, score = 10
    测试数据 #7: Accepted, time = 171 ms, mem = 2784 KiB, score = 10
    测试数据 #8: WrongAnswer, time = 93 ms, mem = 2788 KiB, score = 0
    测试数据 #9: Accepted, time = 78 ms, mem = 2788 KiB, score = 10
    c的评测器有bug,无法输出long double……
    强烈要求换数据或换编译器……

  • 0
    @ 2013-07-21 11:50:03

    坑啊,我用状态转移,开两个数组,记录上一时间跨度内,每一个时间的最小值,o(︶︿︶)o 唉,错了错了,不可以用DP啊,因为时间可以小于一秒,状态转移所需的条件不足,不过,用二分求答案这神技我倒是第一次见识,还是新手,需要多多训练啊...

  • 0
    @ 2009-11-09 19:09:34

    Accepted 有效得分:100 有效耗时:0ms

    var

    i,n:longint;

    mid,f,l:extended;

    x,y,s:array[0..200000]of longint;

    function check(k:extended):boolean;

    var

    i:longint;

    t:extended;

    begin

    t:=0;

    for i:=1 to n do

    begin

    t:=s[i]/k+t;

    if ty[i] then exit(false);

    end;

    exit(true);

    end;

    begin

    readln(n);

    for i:=1 to n do readln(x[i],y[i],s[i]);

    f:=0;l:=1000000000;

    while l-f>0.0005 do

    begin

    mid:=(f+l)/2;

    if check(mid) then l:=mid

    else f:=mid;

    end;

    writeln(l:0:2);

    end.

  • 0
    @ 2009-11-08 13:36:48

    路过

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 56ms

    ├ 测试数据 07:答案正确... 88ms

    ├ 测试数据 08:答案正确... 212ms

    ├ 测试数据 09:答案正确... 150ms

    ├ 测试数据 10:答案正确... 166ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:672ms

  • 0
    @ 2009-11-07 13:52:59

    囧了~

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案错误... 

    ├ 标准行输出 ...1039.00...

     ├ 错误行输出 ...1038.99...

    ├ 测试数据 10:答案正确... 9ms

    我觉得很纯粹,是我太信任Double类型了。。

    用了Extended类型就过了

    今天做了套模拟赛也是,Extended就过了。。

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    秒杀

  • 0
    @ 2009-11-07 09:09:17

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 72ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:72ms

    学到一点东西.......

    不二分还能怎么写?一开始居然想算出来........囧

    同意 oimaster 大牛的意见:如果我们没有计算机,那这题可不简单……

  • 0
    @ 2009-11-06 18:26:43

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 9ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:9ms

    第一次没过样例

    居然没有发现 就提交了

    AC率--

  • 0
    @ 2009-10-28 18:30:53

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 72ms

    ├ 测试数据 08:答案正确... 134ms

    ├ 测试数据 09:答案正确... 25ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:231ms

    强调精度问题降了我的人品啊

  • 0
    @ 2009-10-20 15:09:46

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 103ms

    ├ 测试数据 07:答案正确... 166ms

    ├ 测试数据 08:答案正确... 384ms

    ├ 测试数据 09:答案正确... 338ms

    ├ 测试数据 10:答案正确... 416ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:1407ms

    二分无敌啊

  • 0
    @ 2009-07-29 10:55:30

    递推当然是错的。

    比如:

    3

    2 2 1

    3 4 1

    5 5 1

    答案应为2/3(0.67),用递推算出来是1。

    ---|---|---|---|---|偶素分割线---|---|---|---|---|

    2次AC

    有一条语句:if t-1e-8>y[i] then exit(false);结果WA了2个点

    改成:if t-1e-10>y[i] then exit(false);AC...

  • 0
    @ 2009-05-31 08:42:06

    水题就要一次AC,干脆利落。

    不过遇上VAG就不能秒杀了。。。。。。

    program vijos;

    var i,n:longint;

    boo:boolean;

    v,vmax,vmin,t:extended;

    x,y,s:array[1..200000] of longint;

    begin

    readln(n);

    for i:=1 to n do

    readln(x[i],y[i],s[i]);

    vmax:=10000000;

    vmin:=0.0000001;

    while abs(vmax-vmin)>0.0001 do

    begin

    v:=(vmax+vmin)/2;

    t:=0;

    boo:=true;

    for i:=1 to n do

    begin

    t:=t+s[i]/v;

    if t>y[i] then

    begin

    boo:=false;

    break;

    end;

    if t

  • 0
    @ 2009-05-03 08:59:08

    在提交了n次以后,发现了一些问题:

    1.二分的时候应该要二分得更细一些,差不多到0.001就可以了。

    2.别用real用extended,切记,不然第九个点过不了。

  • 0
    @ 2009-03-16 17:14:21

    第九个点就是过不了,

    情况和题解里写得一摸一样

    无奈cheat了

  • 0
    @ 2009-01-29 19:27:27

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:运行超时...

    ├ 测试数据 07:运行超时...

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:运行超时...

    ├ 测试数据 10:运行超时...

    ---|---|---|---|---|---|---|---|-

    Unaccepted 有效得分:60 有效耗时:0ms

  • 0
    @ 2008-11-05 22:30:00

    #include

    #include

    #include

    #include

    using namespace std;

    struct xing

    {double x;

    double y;

    double s;

    };

    xing a[200001];

    int ok(double v,int n)

    {double t=0;int w=1;

    for(int i=1;i>n;

    for(int i=1;i>x>>y>>s;

    a[i].x=x;

    a[i].y=y;

    a[i].s=s; }

    double vmax=1e4;

    double v=5000;

    while(vmax-v>0.001)

    { if(ok(v,n)==0 )

    {v=(vmax+v)/2;

    }

    else

    {vmax=v;v=v/2;

    }

    }

    cout

  • 0
    @ 2008-10-21 21:25:49

  • 0
    @ 2008-10-20 20:38:53

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:584ms

    如何秒杀?

    PS:刚开始为了单步调试,数组开到200,WA了N次以后。。。才发现。。囧。。我的AC率啊!!!冤啊!!!

    PPS:简单的二分。枚举速度v。

  • 0
    @ 2008-10-03 19:30:20

    总觉得是个递推的,就是找不出来公式.下边那个一维递推太强大了.

  • 0
    @ 2008-09-29 22:01:51

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 9ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 9ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:25ms

    如何秒杀??

  • 0
    @ 2008-09-29 13:46:56

    首先……

    编译通过...

    ├ 测试数据 01:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 07:答案正确... 41ms

    ├ 测试数据 08:答案正确... 56ms

    ├ 测试数据 09:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 10:答案正确... 41ms

    ---|---|---|---|---|---|---|---|-

    Unaccepted 有效得分:70 有效耗时:138ms

    数据范围不够!

    然后……

    编译通过...

    ├ 测试数据 01:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 02:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 03:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 04:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 05:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 06:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 07:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 08:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 09:运行时错误...| 错误号: 207 | 无效浮点运算

    ├ 测试数据 10:运行时错误...| 错误号: 207 | 无效浮点运算

    ---|---|---|---|---|---|---|---|-

    Unaccepted 有效得分:0 有效耗时:0ms

    接着……

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 25ms

    ├ 测试数据 08:答案正确... 88ms

    ├ 测试数据 09:答案正确... 41ms

    ├ 测试数据 10:答案正确... 41ms

    ---|---|---|---|---|---|---|---|-

    Unaccepted 有效得分:90 有效耗时:195ms

    最后……

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 9ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 88ms

    ├ 测试数据 09:答案正确... 72ms

    ├ 测试数据 10:答案正确... 25ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:194ms

    栽在0上了!

信息

ID
1450
难度
7
分类
其他 | 二分查找 点击显示
标签
递交数
2952
已通过
508
通过率
17%
被复制
11
上传者