unsigned long long cal(unsigned long long n){ unsigned long long sum = 0; do { if (n % 2 == 0) { sum += (long long)(n/2)*(n / 2); n = n / 2; } else { sum += n; n = n - 1; } } while (n != 1); return sum + 1; }
点赞 2

相关推荐

牛客279957775号:铁暗恋
点赞 评论 收藏
分享
牛客网
牛客企业服务