159 条题解

  • 0
    @ 2009-08-31 14:18:46

    编译通过...

    ├ 测试数据 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-08-26 10:11:37

    #include

    #include

    using namespace std;

    int p1,p2,p3;

    string str;

    int main(){

    cin>>p1>>p2>>p3;

    cin>>str;

    cout

  • 0
    @ 2009-08-22 10:10:09

    基础太差,差点调试到吐血

  • 0
    @ 2009-08-16 17:32:47

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    不要用ANSISTRING用一串字符数组输出。输入可用STRING

  • 0
    @ 2009-08-13 22:05:15

    program expand;

    var

    p1,p2,p3:shortint;

    tmp,tmp2,s:ansistring;

    i,j,k:integer;

    begin

    readln (p1,p2,p3);

    readln (s);

    i:=1;

    repeat

    if (s[i]='-') and (i1) and (ilength(s)) then begin

    if (((s in ['a'..'z']) and (s in ['a'..'z'])) or

    ((s in ['0'..'9']) and (s in ['0'..'9']))) and (s>s) then begin

    if ord(s)-ord(s)=1 then delete(s,i,1) else begin

    tmp:='';

    for j:=ord(s)+1 to ord(s)-1 do for k:=1 to p2 do tmp:=tmp+chr(j);

    if (tmp[1] in ['a'..'z']) and (p1=2) then for j:=1 to length(tmp) do tmp[j]:=chr(ord(tmp[j])-32);

    if p1=3 then for j:=1 to length(tmp) do tmp[j]:='*';

    if p3=2 then begin

    tmp2:='';

    for j:=length(tmp) downto 1 do tmp2:=tmp2+tmp[j];

    tmp:=tmp2;

    end;

    delete (s,i,1);

    insert (tmp,s,i);

    end;

    end;

    end;

    inc(i);

    until i=length(s)+1;

    writeln (s);

    end.

    咱啥也不说了……

    注意长度。

  • 0
    @ 2009-08-13 14:56:35

    我错在这里

    一开始就

    L:=length(s1);

    for i:=1 to L do

    ........................................

    字符串的长度会变得啊 晕 每次应该都要更新L

  • 0
    @ 2009-08-13 10:22:39

    编译通过...

    ├ 测试数据 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-08-12 22:41:46

    哎,要细心呀。

    WA了3次。。

  • 0
    @ 2009-08-08 07:23:49

    program p1379;

    var a,p1,p2,p3,p,b,c:integer;

    s:ansistring;

    sma,num:set of char;

    procedure dao(l,r:integer);

    var a:integer;

    b:char;

    begin

    for a:=l to ((r-l+1)div 2)+l-1 do

    begin

    b:=s[a];

    s[a]:=s[r+l-a];

    s[r+l-a]:=b;

    end;

    end;

    begin

    sma:=['a'..'z'];

    num:=['0'..'9'];

    readln(p1,p2,p3);

    readln(s);

    p:=pos('-',s);

    if p=1 then

    for a:=p+1 to length(s) do

    if s[a]='-' then

    begin

    p:=a;

    break;

    end

    else if a=length(s) then p:=0;

    while p0 do

    begin

    c:=0;

    if (s[p-1] in num)and(s[p+1] in num) then

    begin

    if ord(s[p-1])+1

  • 0
    @ 2009-08-07 14:31:34

    program ex;

    var p1,p2,p3,t,i,j:longint;

    s:ansistring;

    c:array[1..200] of string;

    h:char;

    begin

    c[48]:='0';c[49]:='1';c[50]:='2';c[51]:='3';

    c[52]:='4';c[53]:='5';c[54]:='6';c[55]:='7';

    c[56]:='8';c[57]:='9';j:=64;

    for h:='A' to 'Z' do begin j:=j+1;c[j]:=h;end;

    j:=96;

    for h:='a' to 'z' do begin j:=j+1;c[j]:=h;end;

    readln(p1,p2,p3);

    readln(s);

    s:=s+'-';

    repeat

    t:=pos('-',s);

    for i:=1 to t-1 do write(s[i]);

    if ((ord(s[t-1])=97)and(ord(s[t+1])>=97)and(ord(s[t+1])-ord(s[t-1])>1))then

    begin

    if p1=1 then begin

    if p3=1 then begin

    for i:=ord(s[t-1])+1 to ord(s[t+1])-1 do

    for j:=1 to p2 do

    begin

    write(c[i]);

    end;

    end;

    if p3=2 then begin

    for i:=ord(s[t+1])-1 downto ord(s[t-1])+1 do

    for j:=1 to p2 do

    begin

    write(c[i]);

    end;

    end;end;

    if p1=2 then begin

    if p3=1 then begin

    for i:=ord(s[t-1])-31 to ord(s[t+1])-33 do

    for j:=1 to p2 do

    begin

    write(c[i]);

    end;end;

    if p3=2 then begin

    for i:=ord(s[t+1])-33 downto ord(s[t-1])-31 do

    for j:=1 to p2 do

    begin

    write(c[i]);

    end;end;end;

    if p1=3 then begin

    for i:=ord(s[t-1])+1 to ord(s[t+1])-1 do

    for j:=1 to p2 do write('*');

    end;

    delete(s,1,t);

    end

    else

    if ((ord(s[t-1])=97))or(ord(s[t+1])-ord(s[t-1])=0)

    or(ord(s[t+1])

  • 0
    @ 2009-08-06 21:12:30

    编译通过...

    ├ 测试数据 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;

    i,j,k,m,n,p1,p2,p3,p,l,r:longint;

    begin

    readln(p1,p2,p3);

    read(s);

    p:=1;

    while pos('-',s)>0 do

    begin

    while s[1]='-' do begin write(s[1]); s:=copy(s,2,255); end;

    if pos('-',s)96) and (ord(s[1])

  • 0
    @ 2009-08-05 22:47:24

    编译通过...

    ├ 测试数据 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-08-02 14:09:27

    第一次做花了45分钟,然后用了半个小时把程序改简洁了点

    看到大家都说数据怎么怎么变态,实际上我感觉,模拟就是尽可能的去按照题目的意思去做,大家都是为了使程序简单点才扭曲了题目的原意,才导致那么多的‘冤情’

    只要完全跟着题目走,哪怕程序复杂了点但肯定不会错的,模拟就是模拟!!

    还有就是要注意模拟是追求理解上的简洁而不是刻意的形式上的简洁

    var st:ansistring;

    i,n,k,p1,p2,p3:integer;

    u1,u2:set of char;

    z,y,ch1,ch2,ch:char;

    ok1,ok2:boolean;

    begin

    readln(p1,p2,p3);

    readln(st);

    n:=length(st);

    u1:=['a'..'z']; u2:=['0'..'9'];

    write(st[1]);

    for i:=2 to n-1 do begin

    ok1:=false;

    ok2:=false;

    if st[i]='-' then

    begin

    ch1:=st;

    ch2:=st;

    if ((ch1 in u1) and (ch2 in u1)) then ok1:=true;

    if ((ch1 in u2) and (ch2 in u2)) then ok2:=true;

    if (ok1 or ok2) and (ord(ch2)>ord(ch1)) then

    begin

    if ord(ch2)=ord(ch1)+1 then continue;

    z:=succ(ch1);

    y:=pred(ch2);

    case p1 of

    2:if ok1 then begin z:=upcase(z); y:=upcase(y); end;

    3:for k:=1 to p2*(ord(y)-ord(z)+1) do write('*');

    end;

    if p13 then

    if p3=1 then for ch:=z to y do

    for k:=1 to p2 do write(ch)

    else for ch:=y downto z do

    for k:=1 to p2 do write(ch);

    end else write(st[i]);

    end else write(st[i]);

    end;

    writeln(st[n]);

    end.

  • 0
    @ 2009-08-01 13:21:56

    找了半天没有看到数据范围,一开始开了1000的数组,80分,接着开5000的数组,90分,最后开了10000的数组终于ac了,晕!!!还好有小号......

  • 0
    @ 2009-07-28 21:31:33

    1.'*'没有字母,数字之分;

    2.数字没有小写,大写之分.

  • 0
    @ 2009-07-28 16:56:15

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    var

    n,p1,p2,p3,i,j,k:longint;

    st:string;

    ch1,ch2:char;

    begin

    readln(p1,p2,p3);

    readln(st);

    n:=length(st);

    write(st[1]);

    for i:=2 to n-1 do

    begin

    ch1:=st;ch2:=st;

    if st[i]'-' then write(st[i])

    else

    begin

    if ch1

  • 0
    @ 2009-07-24 19:43:36

    仔细再仔细看题,

  • 0
    @ 2009-07-23 15:27:32

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    var n,p1,p2,p3,i,j,k:longint; st:ansistring;

    begin

    readln(p1,p2,p3);

    readln(st);

    n:=length(st);

    write(st[1]);

    for i:=2 to n-1 do

    begin

    if st[i]'-' then write(st[i]) else

    begin

    if st='a')and(st='a')and(st='0')and(st='0')and(st='a')and(st

  • 0
    @ 2009-07-22 18:00:35

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    三次才AC。。。第一次把后继看成前趋。。。第二次明明一开始就提醒自己用ansistring的又弄成了string,还有注意“--”的情况。。。

  • 0
    @ 2009-07-19 21:14:24

    这题的数据和比赛的时候不一样啊

    比赛的时候我才70

    猥琐的输入第一个就是-

信息

ID
1379
难度
6
分类
模拟 点击显示
标签
递交数
5989
已通过
1615
通过率
27%
被复制
10
上传者