touxi @ 2021-11-05 19:29:41
#include<bits/stdc++.h>
using namespace std;
long long a,b;
long long sb(long long x)
{
if (x==1) return 1;
else return sb(x/2)+sb(x-x/2);
}
int main()
{
cin>>a>>b;
cout<<sb(a)+sb(b);
return 0;
}
怎么优化
by joy2010WonderMaker @ 2021-11-05 19:31:03
你是想干啥
by impuk @ 2021-11-05 19:34:12
这个为啥叫二分
by MatrixGroup @ 2021-11-05 19:34:47
这个为啥叫二分
by _NTT_ @ 2021-11-05 19:35:59
应该叫分治吧。。。
by dying @ 2021-11-05 19:37:45
这是分治?
by wrm123456x @ 2021-11-05 19:41:14
@LZY66666666
细节决定成败
by impuk @ 2021-11-05 19:43:32
记忆化,小于
复杂度可以做到根号
by Phartial @ 2021-11-05 19:58:32
这个为啥叫二分
by hexing23333 @ 2021-11-05 20:00:49
这个为啥叫二分
by yeshubo_qwq @ 2021-11-05 21:22:55
为什么你不直接输出a+b???