震惊,Dev居然如此辣鸡

P3391 【模板】文艺平衡树

misinclair @ 2018-09-20 11:46:24

脑子抽了,split 这么写的

Node split(Node *o, int k, Node *&x, Node *&y) {
    if(o == null) x = y = null;
    else {
        down(o);
        if(o->ch[0]->siz >= k) {
            y = o; split(o->ch[0], k, x, o->ch[0]);
        } else {
            x = o; split(o->ch[1], k - o->ch[0]->siz - 1, o->ch[1], y);
        }
        o->maintain();
    }
}

而你dev居然说警告0

warning: no return statement in function returning non-void

emmmm.....而且居然还能过样例


by StudyingFather @ 2018-09-20 12:10:56

@AK_583 警告没问题啊,你都没写return语句,而且返回值还不是void


by 览遍千秋 @ 2018-09-20 12:13:31

@StudyingFather 应该是dev没给警告但洛谷给了


by StudyingFather @ 2018-09-20 12:14:23

好吧,那只能说明你编译的时候没开-Wall选项了


by Ghoster @ 2018-09-20 12:41:06

Dev 开的警告比洛谷少一点。。。我写的快读每次洛谷都给警告但Dev不给,但是并不影响(然而您这个是没开Wall吧)


by misinclair @ 2018-09-20 13:56:20

@StudyingFather 啥意思啊


by misinclair @ 2018-09-20 13:56:36

-wall 是什么鬼啊


by misinclair @ 2018-09-20 14:09:55

哦,我知道了,可能我之前都是用的假的dev吧

emmmm......


|