167 条题解

  • 0
    @ 2013-06-03 23:02:52

    help again!
    改了两三行,变50了
    测试数据 #0: Accepted, time = 0 ms, mem = 464 KiB, score = 10
    测试数据 #1: Accepted, time = 0 ms, mem = 468 KiB, score = 10
    测试数据 #2: TimeLimitExceeded, time = 1014 ms, mem = 468 KiB, score = 0
    测试数据 #3: Accepted, time = 0 ms, mem = 468 KiB, score = 10
    测试数据 #4: TimeLimitExceeded, time = 1014 ms, mem = 468 KiB, score = 0
    测试数据 #5: TimeLimitExceeded, time = 1014 ms, mem = 472 KiB, score = 0
    测试数据 #6: TimeLimitExceeded, time = 1014 ms, mem = 472 KiB, score = 0
    测试数据 #7: WrongAnswer, time = 0 ms, mem = 464 KiB, score = 0
    测试数据 #8: Accepted, time = 15 ms, mem = 472 KiB, score = 10
    测试数据 #9: Accepted, time = 0 ms, mem = 468 KiB, score = 10
    TimeLimitExceeded, time = 4071 ms, mem = 472 KiB, score = 50
    代码
    #include <cstdlib>
    #include <iostream>

    using namespace std;

    int main(int argc, char *argv[])
    {
    int m,s,t,dis,time;
    time=0;
    dis=0;
    cin>>m>>s>>t;
    while (1)
    {
    if (dis>=s)
    {
    cout<<"Yes"<<endl;
    cout<<time;
    break;
    }
    else
    {
    if (time<t)
    {
    if (m>=10)
    {
    m-=10;
    time+=1;
    dis+=60;
    }
    else
    {
    if ((s-dis)>=60 and (t-time)>=((10-m)-(10-m)%4)/4+1+1)
    {
    m+=4;
    time++;
    }
    else
    {
    time++;
    dis+=17;
    }
    }
    }
    else
    {
    cout<<"No"<<endl;
    cout<<dis;
    }
    }
    }

    return EXIT_SUCCESS;
    }

  • 0
    @ 2013-06-03 22:50:06

    help!
    测试数据 #0: Accepted, time = 0 ms, mem = 468 KiB, score = 10
    测试数据 #1: Accepted, time = 0 ms, mem = 464 KiB, score = 10
    测试数据 #2: TimeLimitExceeded, time = 1014 ms, mem = 468 KiB, score = 0
    测试数据 #3: WrongAnswer, time = 0 ms, mem = 468 KiB, score = 0
    测试数据 #4: TimeLimitExceeded, time = 1014 ms, mem = 464 KiB, score = 0
    测试数据 #5: TimeLimitExceeded, time = 1014 ms, mem = 468 KiB, score = 0
    测试数据 #6: TimeLimitExceeded, time = 1014 ms, mem = 468 KiB, score = 0
    测试数据 #7: Accepted, time = 0 ms, mem = 468 KiB, score = 10
    测试数据 #8: TimeLimitExceeded, time = 1014 ms, mem = 468 KiB, score = 0
    测试数据 #9: Accepted, time = 0 ms, mem = 468 KiB, score = 10
    #include <cstdlib>
    #include <iostream>

    using namespace std;

    int main(int argc, char *argv[])
    {
    int m,s,t,dis,time;
    time=0;
    dis=0;
    cin>>m>>s>>t;
    while (1)
    {
    if (dis>=s)
    {
    cout<<"Yes"<<endl;
    cout<<time;
    break;
    }
    else
    {
    if (time<t)
    {
    if (m>=10)
    {
    m-=10;
    time+=1;
    dis+=60;
    }
    else
    {
    if ((s-dis)>=60 and (t-time)>=((10-m)-(10-m)%4)/4+1+1)
    {
    m+=(((10-m)-(10-m)%4)/4+1)*4;
    m-=10;
    time+=1+((10-m)-(10-m)%4)/4+1;
    dis+=60;
    }
    else
    {
    time+=1;
    dis+=17;
    }
    }
    }
    else
    {
    cout<<"No"<<endl;
    cout<<dis;
    }
    }
    }
    return EXIT_SUCCESS;
    }

  • 0
    @ 2012-11-09 23:54:47

    oo

  • 0
    @ 2012-11-08 22:03:33

    轻微水题。。。倒是我WA4次才过

    点这查里看程序源码+详细题解

  • 0
    @ 2009-11-09 00:18:48

    这题可以二分么?

  • 0
    @ 2009-11-04 17:52:13

    program escape(imput,output);

    var

    m,s,t,a,b,c,max,lth:integer;

    ans:string;

    begin

    assign(input,'escape.in');reset(input);

    assign(output,'escape.out');rewrite(output);

    read(m,s,t);

    ans:='no';

    for a:=0 to t do

    for b:=0 to t do

    for c:=0 to t do

    begin

    if a+b+c=t then

    begin

    if (m+4*c)/10>=a then

    begin

    lth:=a*60+b*17;

    ans:='yes';

    if lth>max then

    max:=lth;

    end

    else

    begin

    lth:=b*17+((m+c*4)div 10)*60;

    if lth>max then

    max:=lth;

    end;

    end;

    end;

    write(ans,max);

    close(input);

    close(output);

    end.

  • 0
    @ 2009-11-02 20:33:07

    sd

  • 0
    @ 2009-11-01 16:04:48

    program shztl;

    var

    m,s,t,i,j,max,min:longint;

    a,f:array[0..300001] of longint;

    begin

    readln(m,s,t);

    i:=0;f[0]:=0;

    while i=10 then

       begin

       i:=i+1;

       f[i]:=f+60;

       m:=m-10;

       end

      else

       begin

       i:=i+1;

       f[i]:=f;

       m:=m+4;

       end;

      a[i]:=i;

    end;

    max:=0;min:=t+1;

    for i:=1 to t do

    begin

      while (f[i]=s then

       begin

       if a[i]max then max:=f[i];

    end;

    if min

  • 0
    @ 2009-10-28 20:14:27

    模拟。

    #include

    int m,s,t,mt=0,ms=0;

    FILE *f;

    int count()

    { return ((10-m)/4+((10-m)%4==0?0:1));

    }

    void print(int i){

    if(i==1)fprintf(f,"Yes\n%d",mt);

    else fprintf(f,"No\n%d",ms);

    exit(0);

    }

    int main(){

    int i,j,k;

    f=stdin;

    fscanf(f,"%d %d %d",&m,&s,&t);

    f=stdout;

    while(m>=10 && s>0 && t>0)

    { mt++;

    ms+=60;

    m-=10;

    t--;

    s-=60;}

    if(s=6 && t>=2 && s>=34){m=m+4-10;t-=2;mt+=2;ms+=60;s-=60;}

    if(s=2 && t>=3 && s>=51) {m=m+8-10; t-=3; mt+=3;ms+=60;s-=60;}

    if(s=119 && t>=7){mt+=7;ms+=120;t-=7;s-=120;}

    if(ss){mt+=s/17+1;print(1);}

    else {ms+=17*t;print(0);}

    return 0;

    }

  • 0
    @ 2009-10-25 09:33:48

    请各位牛们帮忙看看,我的程序那里有问题。

    #include

    using namespace std;

    int max(int x,int y)

    {

    if (x>y)

    {

    return x;

    }

    else

    {

    return y;

    }

    }

    int main(void)

    {

    int m,s,t,i,j,x,most=0,least;

    cin>>m>>s>>t;

    int f[t+1][m+1];

    f[1][m]=0;

    for (i=0;i=4)

    {

    f[i][j]=max(f[j-4],f[j]+17);

    }

    else

    {

    f[i][j]=f[j]+17;

    }

    }

    }

    least=t+1;

    for (i=1;i

  • 0
    @ 2009-10-22 21:05:53

    弱弱的题目,一次就AC

    #include

    long m,s,t;

    void work()

    {

    long i,a=0,b=0;

    for(i=1;i=10)

    {b=b+60;m=m-10;}

    else

    m=m+4;

    if(b>a+17)a=b;else a=a+17;

    if(a>=s){printf("Yes\n%ld",i);break;}}

    if(i>t)printf("No\n%d",a);

    }

    int main()

    {

    scanf("%ld%ld%ld",&m,&s,&t);

    work();

    return 0;

    }

  • 0
    @ 2009-10-23 07:27:24

    program noip2007a4;

  • 0
    @ 2009-10-18 21:11:29

    仅仅是个模拟。。

    DP也行,感觉有点小题大作

  • 0
    @ 2009-10-11 21:42:35

    看了牛人的程序。。。。。。。。。。。。思想太精妙了(模拟法)。。。。

    Orz Orz Orz Orz Orz Orz Orz Orz Orz Orz Orz

    Orz Orz Orz Orz Orz Orz Orz Orz Orz Orz Orz

    Orz Orz Orz Orz Orz Orz Orz Orz Orz Orz Orz............

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

  • 0
    @ 2009-10-06 11:36:03

    那个初始魔法值甚是麻烦,加了n多特判(时间是否够耗完魔法值,不够耗完的情况下能否逃出)

    此题最关键的一点是有足够魔法一定要立刻用(不用白不用啊)

  • 0
    @ 2009-09-23 21:51:19

    哇哈哈哈哈!!!!

    program escape;

    var

    m,s,t,l,i,g1,k:longint;

    begin

    readln(m,s,t);

    l:=0; i:=0;

    repeat

    if (m div 10)>0 then

    begin

    m:=m-10;

    s:=s-60;

    t:=t-1;

    i:=i+1;

    l:=l+60;

    end

    else begin

    g1:=((s div 60)*10-m) div 4+(s div 60);

    k:=s div 17;

    if (s>51)and((4*t+m-4)>=10)and(g1

  • 0
    @ 2009-09-16 23:06:37

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    WA了4次 哎

  • 0
    @ 2009-09-16 17:05:17

    AC!!!超精简!!

    program XX3_shouwang;

    var i,m,s,t,k1,k2:longint;

    begin

    read(m,s,t);k1:=0;k2:=0;

    for i:=1 to t do

    begin

    if m>=10 then begin m:=m-10;k1:=k1+60;end else m:=m+4;

    if k2+17>k1 then k2:=k2+17 else k2:=k1;

    if k2>=s then begin writeln('Yes');writeln(i);halt;end;

    end;

    writeln('No');writeln(k2);

    end.

    • @ 2015-10-07 17:39:54

      楼上的只AC了四组数据!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • 0
    @ 2009-09-13 13:25:26



    交了3遍...

  • 0
    @ 2009-09-12 19:41:21

    通过100题

    庆祝!!

信息

ID
1431
难度
5
分类
动态规划 | 背包 点击显示
标签
递交数
6158
已通过
1917
通过率
31%
被复制
22
上传者