题解

58 条题解

  • 0
    @ 2009-08-23 21:05:10

    终于100以前了~

    第一次:

    打框框导致编译错误~

    第二次:

    40分~

    第三次把seekeof改成eof就A了~

    每次想要刷水题都被水题刷~

  • 0
    @ 2009-08-23 20:55:48

    撞墙ing。。。。。

    为什么我测的都对,交上去就0分。。。。。。。。555555555555

    我是栈的方法,用的也是ansistring。。。。难道我RP这么差么?TAT

  • 0
    @ 2009-08-23 20:33:30

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    错过了比赛~~很可惜啊……

    不过一次AC

    +100~~O(∩_∩)O~

  • 0
    @ 2009-08-23 20:33:23

    50分啊

    我用栈做

    悲剧啊

    发现了!!!!!!!!!!!!!!!!!!

    我把答案存在了一个string中!!!!!!!

    悲剧啊!!!

    我用rp的代价告诫大家,一定要看好数据范围阿!

    要用ansistring!

  • 0
    @ 2009-08-23 20:17:40

    不需要把答案存下来再输出~~递归找到根目录就可以直接输出了

    编译通过...

    ├ 测试数据 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-23 20:03:22

    50分,怎么回事哦!!!

  • 0
    @ 2009-08-23 19:48:24

    此题纠正一点。

    不保证每个文件一定在某个目录下。如样例的数据。

    可能有单独的文件,您也要把它输出来。

  • 0
    @ 2009-08-23 19:34:15

    此题甚为简单。。。

    思路是输入时采取递归性输入

    但当当前“输入行”为文件时判断与搜索的文件名是否吻合

    吻合的话就输出

    此外递归过程中要记录递归的路径

    完完全全的模拟

    没有A掉的是人品太差

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

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

    程序:

    http://lifeich1.spaces.live.com/blog/cns!9AB465A9D807BE22!130.entry

  • 0
    @ 2009-08-23 19:29:07

    咱10分的飘过。。(泪目中。。)

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

    我也50分...用ansistring=100

  • 0
    @ 2009-08-23 18:50:20

    50分求助

  • 0
    @ 2009-08-24 08:52:05

    hehe

  • 0
    @ 2009-08-23 17:09:20

    飘过

  • 0
    @ 2009-08-22 11:56:30

    。。。

  • 0
    @ 2009-08-17 21:16:40

    SF

  • -1
    @ 2015-05-31 13:37:01

    100 AC
    #include<iostream>
    #include<cmath>
    #include<cstdio>
    #include<cstdlib>
    #include<cstring>
    #include<algorithm>
    using namespace std;
    char str[30],file[10000][30];
    char s[10000][30];
    int n,obj,No[10000],m[10000];
    bool flag[10000];
    void search(int i)
    {
    if(!flag[i] && !strcmp(file[i],str))
    {
    for(int j=1;j<=n;j++) printf("%s\",s[j]);
    printf("%s\n",str);
    }
    else if(flag[i] && No[i])
    {
    strcpy(s[++n],file[i]);
    for(int l=1;l<=No[i];l++)
    {
    search(i+l+m[n]);
    }
    m[--n]+=No[i];
    m[n]+=m[n+1];
    m[n+1]=0;
    }
    obj=obj>i?obj:i;
    }
    int main()
    {
    //freopen("filesearch.in","r",stdin);
    //freopen("filesearch.out","w",stdout);
    gets(str);
    int num=0;
    while(gets(file[++num]))
    {
    int len=strlen(file[num]);
    for(int k=len-1;k>=0;k--)
    {
    if(48<=file[num][k] && file[num][k]<=57)
    {
    No[num]+=(file[num][k]-48)*pow((double)10,len-1-k);
    }
    else if(file[num][k]==' ')
    {
    flag[num]=true;
    file[num][k]='\0';
    break;
    }
    else break;
    }
    }
    num--;
    while(obj<num) search(obj+1);
    //fclose(stdin);
    //fclose(stdout);
    return 0;
    }

  • -1
    @ 2009-11-01 22:21:57

    楼下的算法 我自己加以改造 不行啊 样例可以过 可是就是不能AC

    var i,j,k:longint;

    s1:string;

    procedure dg(s:ansistring);

    var s2,ss:ansistring;

    a:longint;

    begin

    readln(s2);

    if pos(' ',s2)=0 then begin if s2=s1 then writeln(s+s2) end else

    begin

    ss:=copy(s2,pos(' ',s2)+1,length(s2)-pos(' ',s2));

    delete(s2,pos(' ',s2),length(s2)-pos(' ',s2)+1);

    val(ss,a);

    for i:=1 to a do dg(s+s2+'\');

    end;

    end;

    begin

    readln(s1);

    while not(eof) do

    dg('');

    end.

  • -1
    @ 2009-10-25 15:14:07

    program p1622(input,output);

    var str1:ansistring;

    procedure cl(lj:ansistring);

    var st,str2:ansistring;

    code,shu:integer;

    i,po,l:longint;

    begin

    readln(str2);

    po:=pos(' ',str2);

    if po=0

    then if str2=str1

    then writeln(lj+str2)

    else str2:=str2

    else begin

    l:=length(str2);

    st:=copy(str2,po+1,l-po);

    delete(str2,po,l-po+1);

    val(st,shu,code);

    for i:=1 to shu do

    cl(lj+str2+'\');

    end;

    end;

    begin

    readln(str1);

    while not eof(input) do

    begin

    cl('');

    end;

    end.

    so easy!!!

信息

ID
1622
难度
5
分类
模拟 | 数据结构 | 点击显示
标签
递交数
1826
已通过
613
通过率
34%
被复制
3
上传者