题解

128 条题解

  • 0
    @ 2010-04-13 19:34:22

    双向BFS

  • 0
    @ 2009-11-07 20:22:48

    双向BFS+优化。。。

  • 0
    @ 2009-11-04 19:25:37

    单向可以秒杀,加hash

  • 0
    @ 2009-11-03 19:37:30

    编译通过...

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

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

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

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

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

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

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

  • 0
    @ 2009-11-03 18:43:39

    写这种题目有时真的想自杀....

  • 0
    @ 2009-11-02 10:10:46

    编译通过...

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

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

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

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

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

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

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

    双向BFS

  • 0
    @ 2009-10-29 19:09:24

    全秒。。学到双向BFS了。。不会的去百度百科查双向广搜吧

  • 0
    @ 2009-10-28 21:21:46

    编译通过...

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

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

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

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

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

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

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

    VIJOS EASY~~~

    发觉BKDRHASH更为简单实用(H:=(H*131+ORD(S))

  • 0
    @ 2009-10-27 19:08:21

    单向BFS+Hash可以秒

    如果有人最后一个点是答案错误...程序输出比正确答案长……

    那么就回去把你的hash函数多乘一个 i ……

    Hash:

    function hash_ok(t:string):boolean;

    var

    i,k:longint;

    begin

    if t=s then show;

    k:=0;

    for i:=1 to length(t) do

    k:=(k+(ord(t[i])-prime[i])*i*i*prime[i]) mod prime[0];

    if hash[k] then exit(false)

    else

    begin

    hash[k]:=true;

    exit(true);

    end;

    end;

  • 0
    @ 2009-10-27 09:07:51

    var s1,s2,ss:string;x,n,w,wb,l,fl,aal,bbl,p:longint;aa,bb,a,b,g,gb,f,c:array[0..1000] of string;

    function check(s:string;e:integer):boolean;

    var r:longint;

    begin

    if e=1 then

    begin

    for r:=1 to w do

    if g[r]=s then

    begin

    check:=false;

    exit;

    end;

    check:=true;

    w:=w+1;

    g[w]:=s;

    end;

    if e=2 then

    begin

    for r:=1 to wb do

    if gb[r]=s then

    begin

    check:=false;

    exit;

    end;

    wb:=wb+1;

    gb[wb]:=s;

    end;

    end;

    procedure fuck;

    var r,j:longint;

    begin

    for r:=1 to aal do

    for j:=1 to bbl do

    if aa[r]=bb[j] then

    begin

    write(p);

    close(input);

    close(output);

    halt;

    end;

    end;

    function change(sn:string;e:integer):string;

    var r:longint;s,sm:string;

    begin

    fillchar(c,sizeof(c),0);

    l:=0;

    if e=1 then

    for r:=1 to n do

    begin

    sm:=sn;

    repeat

    s:=sn;

    x:=pos(a[r],sm);

    if (x0)and(length(sn)-length(a[r])+length(b[r])

  • 0
    @ 2009-10-25 11:22:10

    Orz 我囧了。。。

    NO ANSWER!写成了 NO ANSWER……

    第一次就得80分……一直到第5次才AC……

    PS:我才明白格式错误是啥意思。。。

    单向广搜+hash=秒杀

    双向广搜是当年的standard

  • 0
    @ 2009-10-24 21:53:09

    编译通过...

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

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

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

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

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

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

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

    BkdrHash+BST+单向BFS=AC

    这种题目写的时候脑子千万要清醒!!!!

  • 0
    @ 2009-10-13 21:24:33

    我都受不了了,

    DFS60分,2组超时,

    BFS80分,1组超时。

    最后!!!!!!!

    逼我用双向BFS

    Finally

    Accepted!!!

  • 0
    @ 2009-10-13 01:04:27

    编译通过...

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

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

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

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

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

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

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

    搞了三个小时,从十点到现在。

    星星星的真星星星的累啊!!!

    蛮值的~会写双向BFS了……还附带训练了Hash+背了个ElfHash

  • 0
    @ 2009-10-09 00:27:33

    双向BFS,hash都不用了......

  • 0
    @ 2009-09-28 17:38:20

    双向BDS,秒杀,爽。虽然调了一下午- -

  • 0
    @ 2009-09-27 15:30:39

    编译通过...

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

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

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

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

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

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

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

    ELF哈希+BST储存哈希值+单向BFS……

    ELFHash的函数:

    unsigned long elfhash(string& hs)

    {

    unsigned long hash=0;

    unsigned long x=0;

    long hn=hs.length();

    long hi;

    for (hi=0;hi 24);

    hash&=~x;

    }

    }

    return (hash & 0x7FFFFFFF);

    }

  • 0
    @ 2009-09-20 10:39:02

    编译通过...

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

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

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

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

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

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

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

    140 行 单向BFS 抄袭了LRJ的 elfhs

    2小时 一次AC

    真是锻炼我的字符串函数啊 copy delete insert 以前都不会用的#17

  • 0
    @ 2009-09-15 21:14:55

    编译通过...

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

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

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

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

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

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

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

    =.=

  • 0
    @ 2009-09-09 17:11:09

    好吧 双向宽搜 很好很强大

    散列表Hash ASCII码+位数的乘积mod大质数

    居然过了.....本想写个ELF....

信息

ID
1124
难度
7
分类
搜索 | 搜索与剪枝 点击显示
标签
递交数
3886
已通过
784
通过率
20%
被复制
14
上传者