作业

百万皇后

jxtxzzw · 4月11日 · 2018年 1062次已读

本文写于 2018年04月11日,距今已超过 1 年,距 2018年11月02日 的最后一次修改也已超过 3 个月,部分内容可能已经过时,您可以按需阅读。如果图片无法显示或者下载链接失效,请给我反馈,谢谢!


此区域的内容仅评论后可见

Thanks to 10175102128 for his pointing out a potential bug in his submit #1293284.

/**
 * 检查交换给定的两个皇后会不会减少冲突数
 * @param i 第i行
 * @param j 第j行
 * @return 交换后的冲突数的变化量,小于0表示冲突减少
 */
int swapWillReduceCollisions(int i, int j) {
    // This function is ill-implemented
    // Bugs: swapWillReduceCollisions(i, i) => 8, i = 1, 2, ...
    // UTD: When A and B are located in the same diagonal, whether major or minor
    // the computation may fall into errors.

 

50 条回应
    Kuroko 2019-9-11 · 18:55
    Chrome 76.0.3809.132 Windows 10

    666 tql!

    mizunashi 2019-9-10 · 22:51
    Chrome 76.0.3809.132 Mac OS X 10_14_6
    #include
    
    using namespace std;
    
    int main()
    {
        cout< <"tql"<
    		
    AAN 2019-9-10 · 10:54
    Chrome 65.0.3325.181 Windows 10

    TQL

    111 2019-9-8 · 9:33
    Chrome 76.0.3809.132 Windows 10

    tql

    我裂开了 2019-9-7 · 11:44
    Chrome 75.0.3770.142 Windows 10

    太强了,获益良多

    tql 2019-5-10 · 8:35
    Chrome 74.0.3729.131 Windows 10

    奥里给

    oaoa 2019-4-28 · 16:17
    Safari 605.1.15 Mac OS X 10_14_3

    ttttql

    nihouze 2019-4-17 · 20:23
    Chrome 73.0.3683.103 Windows 10

    ttttttttql

    Geofront 2019-4-3 · 9:22
    Chrome 72.0.3626.81 Windows 10

    tql

    hua 2019-1-18 · 21:46
    Chrome 71.0.3578.98 Windows 10

    good

    znbsf 2019-1-17 · 13:53
    Chrome 71.0.3578.98 Windows 10

    tql

    sleepwalkerg 2019-1-16 · 20:07
    Firefox 64.0 Windows 10

    tql

    CCC 2019-1-16 · 19:34
    Chrome 71.0.3578.98 Windows 10

    TQL

    6 2019-1-9 · 14:44
    Firefox 64.0 Windows 10

    6

    phenom 2019-1-3 · 22:11
    Chrome 71.0.3578.98 Windows 8

    tql

    manor 2018-12-29 · 15:24
    Safari 605.1.15 Mac OS X 10_13_6

    666

    manor 2018-12-29 · 15:24
    Safari 605.1.15 Mac OS X 10_13_6

    tql

    Zoey 2018-12-20 · 19:44
    Chrome 64.0.3282.186 Windows 10

    tql

    xzx1 2018-12-17 · 21:22
    Firefox 64.0 Windows 10

    666

    xzx 2018-12-17 · 8:59
    Safari 604.1 iPhone iPhone OS 12_1 like Mac OS X) AppleWebKit

    tql

    12 2018-12-10 · 13:31
    Chrome 70.0.3538.110 Mac OS X 10_11_6

    tql

    tql 2018-12-8 · 14:25
    Chrome 70.0.3538.77 Windows 10

    tql

    czc 2018-12-7 · 22:22
    Chrome 62.0.3202.94 Windows 10

    tql

    moore 2018-12-7 · 12:54
    Chrome 66.0.3359.181 Windows 10

    tql

    lincoln 2018-12-2 · 18:16
    Chrome 70.0.3538.77 Windows 10

    tqlb

    deerbean 2018-11-28 · 5:05
    Chrome 70.0.3538.102 Windows 10

    orz

    young 2018-11-26 · 12:26
    Chrome 70.0.3538.110 Windows 10

    tql

    dong233 2018-11-15 · 14:04
    Chrome 67.0.3396.99 Windows 10

    tql

    13 2018-11-5 · 19:20
    Chrome 67.0.3396.99 Windows 10

    1

    yyy 2018-10-29 · 19:58
    Chrome 69.0.3497.100 Windows 10

    tql

    2018-10-17 · 23:20
    Safari 604.1 iPhone iPhone OS 12_0 like Mac OS X) AppleWebKit

    Wothank

    3123123 2018-10-14 · 14:02
    Chrome 69.0.3497.100 Mac OS X 10_14_0

    eee

    Master X 2018-10-10 · 22:00
    Chrome 69.0.3497.100 Windows 10

    666

    _ 2018-9-27 · 23:51
    Chrome 69.0.3497.100 Windows 10

    tql%%%

    佬中佬 2018-9-27 · 0:15
    Chrome 67.0.3396.99 Windows 10

    tql

    Griffith_Fu 2018-9-26 · 19:55
    Chrome 69.0.3497.100 Windows 10

    tql

    ABC666 2018-9-24 · 16:23
    QQ浏览器 6.2 Android 8.0 | MI 6

    tql

    nanfeng 2018-9-22 · 20:35
    Chrome 68.0.3440.106 Windows 10

    tql

    k 2018-9-20 · 19:52
    Firefox 61.0 Windows 10

    tql

    compute 2018-9-8 · 22:22
    Chrome 68.0.3440.106 Windows 10

    tql

    tangming 2018-8-9 · 19:33
    Chrome 67.0.3396.99 Windows 10

    edge浏览器被黑得最惨的一次

      jxtxzzw 2018-8-10 · 16:33
      Chrome 68.0.3440.84 Windows 10

      ie更惨(逃

    hhh 2018-7-17 · 12:30
    Firefox 61.0 Windows 10

    tql

    cyy 2018-7-11 · 11:09
    Chrome 67.0.3396.99 Mac OS X 10_13_5

    tql

    Robin 2018-7-6 · 16:42
    Chrome 67.0.3396.99 Windows 10

    评论

    233 2018-7-5 · 23:59
    Firefox 60.0 Windows 10

    tql

    陆 轩韬 2018-4-11 · 21:06
    Chrome 60.0.3112.101 Windows 10

    行数显示有问题

      jxtxzzw 2018-4-11 · 22:12
      Chrome 65.0.3325.181 Windows 10

      并没有看出哪里有问题

        jxtxzzw 2018-4-16 · 14:02
        Chrome 65.0.3325.109 Linux

        我知道了,屏幕缩小以后,三位数显示不下,就会被挤到下一行,不影响使用,以后空了再修复吧

          668 2019-9-8 · 17:51
          Chrome 63.0.3239.132 Windows 10

          668