怎么说呢 根据骗分导论的原则 一种学了两天能拿20 分的方法

program fly;
var
m,s,t,n,i:integer;
begin
read(m,s,t);
n:=m mod 10;
if n< t then
n:=t;
if s< n*60 then
begin
for i:=1 to n do
begin
if s < i* 60 then
begin
writeln('Yes');
writeln(i);
halt;
end;
end ;
end
else
begin
writeln('No');
writeln(n*60);
end;
end.

4 条评论

  • @ 2015-11-05 13:32:49

    大神帮我看看,只过8个点啊。。给跪了
    Free Pascal Compiler version 2.6.4 [2014/03/06] for i386
    Copyright (c) 1993-2014 by Florian Klaempfl and others
    Target OS: Win32 for i386
    Compiling foo.pas
    Linking foo.exe
    63 lines compiled, 0.0 sec , 28368 bytes code, 1644 bytes data

    测试数据 #0: Accepted, time = 15 ms, mem = 17212 KiB, score = 10

    测试数据 #1: Accepted, time = 15 ms, mem = 17208 KiB, score = 10

    测试数据 #2: Accepted, time = 0 ms, mem = 17208 KiB, score = 10

    测试数据 #3: Accepted, time = 15 ms, mem = 17208 KiB, score = 10

    测试数据 #4: Accepted, time = 15 ms, mem = 17204 KiB, score = 10

    测试数据 #5: WrongAnswer, time = 15 ms, mem = 17208 KiB, score = 0

    测试数据 #6: Accepted, time = 15 ms, mem = 17208 KiB, score = 10

    测试数据 #7: WrongAnswer, time = 15 ms, mem = 17208 KiB, score = 0

    测试数据 #8: Accepted, time = 31 ms, mem = 17208 KiB, score = 10

    测试数据 #9: Accepted, time = 3 ms, mem = 17212 KiB, score = 10

    WrongAnswer, time = 139 ms, mem = 17212 KiB, score = 80

    Program escape;

    Var m,s,t,i,j,maxs,maxt:longint;
    map:array[0..300000,0..13]of longint;

    procedure wj1;
    begin
    assign(input,'escape.in');
    assign(output,'escape.out');
    reset(input);
    rewrite(output);
    end;

    procedure wj2;
    begin
    close(input);
    close(output);
    end;

    function max(a,b:longint):longint;
    begin
    if a>b then exit(a) else exit(b);
    end;

    Begin
    //wj1;
    read(m,maxs,maxt);
    fillchar(map,sizeof(map),0);
    s:=0;t:=0;
    while m>=10 do begin
    inc(s,60);
    inc(t);
    dec(m,10);
    if s>=maxs then begin
    writeln('Yes');
    writeln(t);
    //wj2;
    halt;
    end;
    if t>=maxt then begin
    writeln('No');
    writeln(s);
    //wj2;
    halt;
    end;
    end;
    map[0,0]:=s;
    for i:=1 to maxt-t do
    for j:=0 to 13 do
    if j<10 then
    map[i,j]:=max(map[i-1,j]+17,map[i-1,j+4])
    else map[i,j]:=map[i-1,j-10]+60;

    for i:=1 to maxt-t do
    if map[i,m]>=maxs then begin

    writeln('Yes');
    writeln(t+i);
    //wj2;
    halt;
    end;
    writeln('No');
    writeln(map[maxt-t,m]);
    //wj2;
    End.

  • @ 2015-10-28 06:07:43

    其实偏分也很好的

  • @ 2015-10-27 23:19:00

    闪现。。。您打moba类的游戏打多了吧。。。

    • @ 2015-10-28 12:28:18

      你玩过魔兽么?这道题就是魔兽改版的NOIP普及组题。里面守望者技能就是闪烁,这是战役第二关= =

  • @ 2015-10-22 20:27:32

    你难道不知道骗分导论里有个叫做“贪心”的好东西么?而且有些题目就得要贪心= =骗分导论的实质其实只是教了一些简单的做题技巧罢了.....其实骗分导论还是在教你怎么编程。

    对于这题你可以枚举每一次选择。分别判断闪现和不闪现的结果。贪心把最优的记录下来。直到时间结束。

    而且这里使用这个贪心是能轻松AC的- -而且代码比你这个还短。。喏= =给你找到个。我就不打了
    ###pascal code
    var m,s,t,i,s1,s2:longint;
    begin
    read(m,s,t);s1:=0;s2:=0;
    for i:=1 to t do begin
    s1:=s1+17;
    if m>=10 then begin m:=m-10;s2:=s2+60;end else m:=m+4;
    if s2>s1 then s1:=s2;
    if s1>=s then begin writeln('Yes');writeln(i);halt;end;
    end;
    if s1>=s then begin writeln('Yes');writeln(i);halt;end;
    writeln('No');writeln(s1);
    end.

  • 1

信息

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