159 条题解

  • 0
    @ 2008-11-13 11:50:17

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    program expand;

    var

    s:string;

    x,y:char;

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

    function testok(p,q:longint):boolean;

    begin

    x:=s[p];

    y:=s[q];

    if (x>='a') and (x='a') and (y

  • 0
    @ 2008-11-12 21:15:25

    "减号两侧同为小写字母或同为数字"

    ignore 这句话

    Wa 4次`\`\

  • 0
    @ 2008-11-11 17:59:20

    跟下面的人 学的 `\声明下

  • 0
    @ 2008-11-11 11:08:27

    var

    ch,ch1,ch2,k:char;

    p1,p2,p3,i,j:integer;

    begin

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

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

    readln(p1,p2,p3);ch1:='1';

    while ord(ch1)>20 do

    begin ch:=ch2;

    repeat

    read(ch1);

    if ord(ch1)

  • 0
    @ 2008-11-10 19:43:29

    program expand;

    type

    int=integer;

    var

    str1:string;

    p1,p2,p3:int;

    i,j,l:int;

    procedure turn1(h,t:int;str:string);

    var i1,j1,h1,t1:int;

    begin

    h1:=ord(str[h]);t1:=ord(str[t]);

    if h1>t1 then begin

    dec(h1);inc(t1);

    for i1:=h1 downto t1 do

    for j1:=1 to p2 do begin

    if p1=1 then write(chr(i1));

    if p1=2 then write(chr(i1-32));

    if p1=3 then write('*');end;

    end

    else begin

    dec(t1);inc(h1);

    for i1:=h1 to t1 do

    for j1:=1 to p2 do begin

    if p1=1 then write(chr(i1));

    if p1=2 then write(chr(i1-32));

    if p1=3 then write('*');end;

    end;

    end;

    procedure turn2(h,t:int;str:string);

    var i2,j2:int;

    begin

    if p3=1 then turn1(h,t,str)

    else turn1(t,h,str);

    end;

    begin

    assign(input,'D:\expand11.txt');

    assign(output,'D:\expand22.txt');

    reset(input);rewrite(output);

    readln(p1,p2,p3);

    readln(str1);

    l:=length(str1);

    for i:=1 to l do

    begin

    if i=1 then begin write(str1[i]);continue; end;

    if i=l then begin writeln(str1[i]);exit;end;

    if str1[i]='-'then

    begin

    if str1='-' then begin write('-');continue;end;

    if ord(str1)=97)or(ord(str1)

  • 0
    @ 2008-11-09 14:51:23

    program expand;

    var

    p1,p2,p3:integer;

    s:string;

    i,j,k:integer;

    begin

    readln(p1,p2,p3);

    readln(s);

    for i:=1 to length(s) do begin

    if(s[i]='-')and(i>1)and(i='a')and(s='0')and(s

  • 0
    @ 2008-11-07 21:42:43

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    void tc (int sign)

    {

    char b;

    char x=s[sign-1],y=s[sign+1];

    if (x==y-1) return;

    if (x>='a'&&p1==2) {x=x-'a'+'A';y=y-'a'+'A';}

    int i,j;

    if (p1==3)

    {

    for (i=0;i

  • 0
    @ 2008-11-06 18:58:37

    #include

    #include

    main()

    {

    long p1,p2,p3,i,num,j,flag,k;

    scanf("%ld%ld%ld",&p1,&p2,&p3);

    char a[10000];

    char b[50000];

    scanf("%s",a);

    num=strlen(a);

    k=0;

    for(i=0;i

  • 0
    @ 2008-11-05 21:03:30

    program expand;

    var s:ansistring;

    p1,p2,p3,be,en,i,len:integer;

    procedure print1(be,en:integer);

    var i,j:integer;

    begin if p3=1 then

    for i:=be to en do

    begin

    for j:=1 to p2 do

    write(chr(i));

    end

    else

    for i:=en downto be do

    begin

    for j:=1 to p2 do

    write(chr(i));

    end;

    end;

    procedure print0(be,en:integer);

    var i,j:integer;

    begin for i:=be to en do

    for j:=1 to p2 do

    write('*');

    end;

    procedure panduan;

    var f,b:integer;

    begin

    f:=ord(s);

    b:=ord(s);

    if f=97) and (f=97) and (b

  • 0
    @ 2008-11-05 16:40:59

    编译通过...

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

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

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

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

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

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

     ├ 错误行输出

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

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

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

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

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

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

  • 0
    @ 2008-11-04 17:36:05

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    去年只有70

    这次第一次提交没看见 p1=3 填* 又尴尬了

    很简单的模拟类题。

  • 0
    @ 2008-11-03 20:01:38

    第七个点一开始没过,大家注意字符串的第一位和最后一位是否为‘-’啊

  • 0
    @ 2008-11-03 11:29:08

    编译通过...

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

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

    ├ 馐允?03:答案正确... 0ms

    ???/这是什么?

  • 0
    @ 2008-11-01 22:48:43

    郁闷...居然交了三次才过....- -\

  • 0
    @ 2008-10-31 21:37:01

    program expand;

    const maxn=100;

    var s,s1:string;

    start,tt,p1,p2,p3,i,j,k,temp:longint;

    begin

    readln(p1,p2,p3);

    read(s);

    start:=1;

    fillchar(s1,sizeof(s1),'{');

    for i:=1 to maxn do if s[i]'-' then begin tt:=i; break; end;

    for i:=tt to maxn do

    if (s[i]='-')and not ((ord(s)>ord('9')) and (ord(s)ord('9')))

    then s1[j]:=chr(ord(s1[j])+ord('A')- ord('a'))

    else if (p1=1) and ((ord(s1[j])ord('9')))

    then s1[j]:=chr(ord(s1[j])-ord('A')+ord('a'))

    else if p1=3 then s1[j]:='*';

    end;

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

    if p3=1 then for j:=1 to temp do

    for k:=1 to p2 do write(s1[j])

    else for j:=temp downto 1 do

    for k:=1 to p2 do write(s1[j]);

    start:=i+1;

    end;

    if start

  • 0
    @ 2008-10-30 21:08:00

    program expend(input,output);

    var

    st,st2:string;

    a:array [1..1000] of boolean;

    k,i,l,p1,p2,p3,l2,j,los:integer;

    wr:boolean;

    procedure out(ch:char; i:integer);

    begin

    if not a[i] then begin write(ch); a[i]:=true; end;

    end;

    function work(t,w:char):string;

    var

    st3:string;

    ch:char;

    l,i,j:integer;

    begin

    st3:='';

    if (p1=2) then begin if (ord(t)>64) then ch:=chr(ord(t)-32) else ch:=t; end

    else if p1=1 then ch:=t

    else ch:='*';

    l:=ord(w)-ord(t)+1;

    for i:=1 to l do

    begin

    for j:=1 to p2 do st3:=st3+ch;

    if p13 then ch:=succ(ch);

    end;

    work:=st3;

    end;

    begin

    fillchar(a,sizeof(a),false);

    readln(p1,p2,p3);

    readln(st);

    i:=1;

    while st[i]='-' do inc(i);

    delete(st,1,i-1);

    for j:=1 to i-1 do write('-');

    l:=length(st); i:=l;

    while st[i]='-' do dec(i);

    delete(st,i+1,l-i);

    los:=l-i;

    l:=length(st);

    st:=st+'*'; k:=0; wr:=false;

    for i:=1 to l do

    begin

    if k0 then

    begin

    k:=k-1;

    if wr then out(st[i],i);

    if k=0 then wr:=false;

    if k0 then continue;

    end;

    if st'-' then begin out(st[i],i); continue; end;

    if st='-'

    then if (abs(ord(st)-ord(st[i]))>35) or (ord(st)

  • 0
    @ 2009-05-15 21:30:44

    30 -> 40 -> 50 -> 60 -> 80 -> 70

    细节 细节 细节 细节 头尾的'-' else后没加';'

    -> 100(AC!) 汗!

    看了C|2banban的温馨提示之后....太恶了!我的AC率!

    最后一个错误的地方:存在连续的'-'

    调了30分钟,囧..

    写法上有待调整,看了下面一次AC的牛,Orz!!

    细节 + 特殊情况 = 简单弱题无法AC

  • 0
    @ 2008-10-28 15:05:55

    PROGRAM str1;

    VAR

    a:string;

    p1,p2,p3:integer;

    i,j,k:integer;

    BEGIN

    readln(p1,p2,p3);

    readln(a);

    write(a[1]);

    for i:=2 to length(a) do

    if (a[i]'-')or(a='-')or(a='-') then write(a[i]) else

    {}

    if(a>=a)or

    ( (ord(a)=58) )or

    ( (ord(a)>=58)and(ord(a)

  • 0
    @ 2008-10-27 21:11:29

    ansistring不能用,自己开字符数组。。。

    其实这道题出奇的简单,只是逻辑判断的先后决定了程序的长短

    像我的程序加空行总共就41行。。。顺便,LS的很有耐心

    这是我见到的NOIP2007第二题最长的标程。。。。

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

  • 0
    @ 2008-10-27 18:57:57

    #include

    #include

    char s[200];

    void prin(int p1,int p2,int p3)

    { int i=0,j=0,k=0;

    char temp;

    while(s[i]!='\0')

    ( if(s!='-')

    printf("%c",s[i]);

    else

    {

    if((s[i]+1)==s) { printf("%c",s[i]);i+=2;}

    else

    if(s[i]>=s){ printf("%c%c",s[i],s);i+=2;} /*情况5不需展开*/

    else

    if((s[i]+1='0')&&(s[i]='a')&&(s[i]>='z')))

    {

    if(p3==1) { temp=s[i];

    while(temp=s[i])

    {for(k=1;k'9')

    { if(p1==1) printf("%c",temp;

    if(p1==2) printf("%c",temp-32);

    if(p1==3) printf("*");

    )

    else

    printf("%c",temp);

    }

    temp--;

    }

    }

    i+=2; /*展开*/

    }

    } /*else*/

    ) /*while*/

    }

    int main()

    {

    int p1,p2,p3;

    scanf("%d%d%d",&p1,&p2,&p3);

    prin(p1,p2,p3);

    gets(s);

    return 0;

    }

信息

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