首页 > 其他 > 详细

[CF959E]Mahmoud and Ehab and the xor-MST题解

时间:2019-05-20 20:48:44      阅读:137      评论:0      收藏:0      [点我收藏+]

解法
又是一道结论题?
我的做法比较奇怪且没有证明

#include <cstdio>
#include <cmath>
#define ll long long

int main(){
    ll ans = 0;
    ll n, bs = 1;
    scanf("%I64d", &n);
    while (n > 1){
        ans += (n >> 1) * bs;
        n -= (n >> 1);
        bs <<= 1;
    }
    printf("%I64d", ans);
    return 0;
}

如果没看懂,请去
CF官方题解及其证明

[CF959E]Mahmoud and Ehab and the xor-MST题解

原文:https://www.cnblogs.com/linzhengmin/p/10895963.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!