题解

184 条题解

  • 0
    @ 2009-07-12 19:52:54

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    var

    s:string;

    a:array[1..100] of integer;

    b,m,k,j,h,g:longint;

    p:boolean;

    procedure kuai(n,m:longint);

    var

    g,l,v,x,y:longint;

    begin

    if n>=m then exit;

    x:=n; y:=m;

    g:=a[n];

    repeat

    while (g>a[y])and(x

  • 0
    @ 2009-07-07 22:24:09

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    program p1495;

    var s:string;

    a:array[1..26] of integer;

    i,max,min:integer;

    zhi:boolean;

    begin

    zhi:=true;

    min:=maxint;

    readln(s);

    for i:=1 to length(s) do inc(a[ord(s[i])-ord('`')]);

    for i:=1 to 26 do

    begin

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

    if (a[i]

  • 0
    @ 2009-07-07 17:48:24

    program monkey;

    var s:string;

    a:array[1..26]of longint;

    i,max,min,j:integer;

    f:boolean;

    begin

    readln(s);

    for i:=1 to length(s) do

    inc(a[ord(s[i])-96]);

    max:=0;min:=100;

    for i:=1 to 26 do

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

    for i:=1 to 26 do

    if (a[i]

  • 0
    @ 2009-07-04 09:58:39

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

    Accepted 有效得分:100 有效耗时:0msprogram c1;

    var

    a:array[1..26]of integer ;

    b:array['a'..'z']of char;

    st:string;

    i,j,c,d,n,m,max,min:integer;

    f:boolean;

    begin

    readln(st);

    c:=length(st);

    for i:=1 to 26 do

    a[i]:=0;

    d:=0;

    for i:=1 to c do

    a[ord(st[i])-96]:=a[ord(st[i])-96]+1;

    min:=101;

    max:=0;

    for i:=1 to 26 do

    begin

    if a[i]>max then

    max:=a[i];

    if (a[i]0)and(a[i]

  • 0
    @ 2009-07-04 08:43:25

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    var

    a:string;

    b,c:array [0..25] of integer;

    maxn,i,f,max,min,minn,s:integer;

    begin

    readln(a);

    s:=length(a);

    for i := 1 to s do

    if a[i]>='a' then

    b[ord(a[i])-98]:=b[ord(a[i])-98]+1

    else

    c[ord(a[i])-65]:=c[ord(a[i])-65]+1;

    min:=1000;max:=-1;maxn:=-1;minn:=1000;

    for i := 0 to 25 do

    begin

    if (b[i]max) and (b[i]0) then max:=b[i];

    if (c[i]maxn) and (c[i]0)then maxn:=c[i];

    end;

    if (maxnmin) and (min0) then minn:=min;

    minn:=maxn-minn;

    if minn=1 then begin writeln('No Answer');write(0);f:=1;end;

    if minn=2 then begin writeln('Lucky Word');write(2);f:=1;end;

    if minn=0 then begin writeln('No Answer');write(0);f:=1;end;

    for i := 2 to minn-1 do

    if (minn mod i = 0) then begin writeln('No Answer');write(0);f:=1;end;

    if f1 then begin writeln('Lucky Word');write(minn);end;

    end.

    为什么?!明明在RQNOJ上可以过的啊!

  • 0
    @ 2009-07-03 14:17:09

    var

    a:array[1..26] of integer;

    s:string[100];

    i,j,t:integer;

    begin

    read(s);

    i:=1;

    fillchar(a,sizeof(a),0);

    j:=length(s);

    for i:=1 to j do

    begin

    t:=ord(s[i])-96;

    a[t]:=a[t]+1;

    end;

    for i:=1 to 26 do

    for j:=26 downto i+1 do

    if a[j]>a[j-1] then

    begin

    t:=a[j-1];

    a[j-1]:=a[j];

    a[j]:=t;

    end;

    for i:=26 downto 2 do

    if a[i]0 then break;

    t:=a[1]-a[i];

    if (t=2) or (t=3) or (t=5) or (t=7) or (t=11) then

    begin

    writeln('Lucky Word');

    write(t);

    end

    else

    if (t=13) or (t=17) or (t=23) or (t=29) or (t=31) then

    begin

    writeln('Lucky Word');

    write(t);

    end

    else

    if (t=37) or (t=41) or (t=43) or (t=47) or (t=53) then

    begin

    writeln('Lucky Word');

    write(t);

    end

    else

    if (t=59) or (t=61) or (t=67) or (t=71) or (t=73) then

    begin

    writeln('Lucky Word');

    write(t);

    end

    else

    if (t=19) or (t=83) or (t=89) or (t=97) then

    begin

    writeln('Lucky Word');

    write(t);

    end

    else

    begin

    writeln('No Answer');

    write('0');

    end;

    end.

  • 0
    @ 2009-06-29 21:24:22

    这么简单的提高组的题。。。。就用它来过第100道吧。这种题不过对不起父母啊。。

  • 0
    @ 2009-06-29 13:27:19

    编译通过...

    ├ 测试数据 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-06-25 20:25:19

    编译通过...

    ├ 测试数据 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-06-23 16:00:53

    编译通过...

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

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

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

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

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

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

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

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

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

     ├ 错误行输出

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

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

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

  • 0
    @ 2009-06-13 16:44:22

    汪洋大海——水啊

  • 0
    @ 2009-06-06 17:07:56

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    var

    str:string;

    a:array[1..26]of longint;

    sum,l,max,min,i:longint;

    begin

    readln(str);

    l:=length(str);

    for i:=1 to l do

    inc(a[ord(str[i])-96]);

    min:=100000;max:=0;

    for i:=1 to 26 do

    if a[i]>0 then

    begin

    if maxa[i] then

    begin

    min:=a[i];

    end;

    end;

    sum:=max-min;

    if (sum=0)or(sum=1) then

    begin

    writeln('No Answer');

    writeln(0);

    halt;

    end;

    for i:=2 to trunc(sqrt(sum)) do

    if (sum mod i=0) then

    begin

    writeln('No Answer');

    writeln(0);

    halt;

    end;

    writeln('Lucky Word');

    writeln(sum);

    end.

    忘记了0和1不是质数!!!!

    AC率↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

  • 0
    @ 2009-06-04 22:34:09

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    Var

    a:array [1..26] of Longint;

    s:string;

    i,j,max,min,k,t:Longint;

    f:Boolean;

    Begin

    Readln(s);

    For i:=1 to length(s) do inc(a[ord(s[i])-96]);

    max:=1-maxLongint;

    min:=maxLongint;

    For i:=1 to 26 do Begin

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

    if a[i]=0 then a[i]:=maxLongint;

    if a[i]

  • 0
    @ 2009-06-03 17:39:37

    难得一遍AC 感动(不过这个太水了)…………………………

    编译通过...

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

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

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

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

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

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

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

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

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

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

    var

    a:string;

    b:array[32..135] of integer;

    i,k,j,n,m:integer;

    function pd(z:integer):boolean;

    var count:integer;

    begin

    if zn then n:=b[i];

    end;

    procedure min;

    begin

    m:=999;

    for i:=97 to 135 do if (b[i]>0) and (b[i]

  • 0
    @ 2009-05-27 22:01:31

    program temp;

    var

    s:string;

    l,j,maxn,minn,x:integer;

    i:char;

    b:boolean;

    a:array [1..26] of integer;

    begin

    maxn:=0; minn:=10000; b:=true;

    readln(s);

    l:=length(s);

    for i:='a' to 'z' do

    for j:=1 to l do if s[j]=i then inc(a[ord(i)-96]);

    for j:=1 to 26 do

    if a[j]>maxn then maxn:=a[j];

    for j:=1 to 26 do

    if (a[j]

  • 0
    @ 2009-05-25 15:01:23

    var st:string; a:array['a'..'z'] of integer; b,i,j,minn,maxn:longint;

    begin

    readln(st); minn:=100;

    for i:=1 to length(st) do

    begin

    inc(a[st[i]]);

    if a[st[i]]>maxn then maxn:=a[st[i]];

    if a[st[i]]

  • 0
    @ 2009-05-18 21:06:53

    狂顶楼下!!

    郁闷死了!!Lucky word 打成 lucky word.

    原来一直以为最大值最小值有问题... AC率白降百分之5

    虽然大牛们也许不会犯本菜的低级错误 但还是要说:对于水题来说 细节决定成败

  • 0
    @ 2009-05-15 20:18:07

    弱弱的模拟题最需要的就是:

    细节细节!

  • 0
    @ 2009-05-03 22:03:26

    pascal 我只打了90 哪位看看是哪错了?

    var s:string[100] ;

    max,min,i,j,k,m:integer;

    b:array['a'..'z'] of integer;

    ch:char;

    begin

    readln(s);

    for i:=0 to length(s) do

    inc(b[s[i]]);

    max:=0 ; min:=100;

    for ch:='a' to 'z' do

    begin

    if b[ch]>max then max:=b[ch];

    if (b[ch]

  • 0
    @ 2009-04-29 20:58:28

    #include

    #include

    #include

    int main(void)

    {

    int ss[25]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};

    int t=0,tj[25]={0},max=0,min=100,c=0;

    char tmp[100];

    scanf("%s",&tmp);

    while(t

信息

ID
1495
难度
5
分类
模拟 点击显示
标签
递交数
9604
已通过
3484
通过率
36%
被复制
16
上传者