Sum of first N natural numbers in binary representation

后端 未结 0 1105
轻奢々
轻奢々 2020-12-13 15:46

I need to find sum of first N natural numbers in binary form for example if N=3, 01+10+11=22 My problem is the constraint for N is too high: 1<=N<=10^18 Any tips on ap

相关标签:
回答
  • 消灭零回复
提交回复
热议问题