首页 > 其他 > 详细

bitset实现位压加法

时间:2020-06-23 12:42:15      阅读:111      评论:0      收藏:0      [点我收藏+]
 1 #include<stdio.h>
 2 #include<string.h>
 3 #include<algorithm>
 4 using namespace std;
 5 typedef bitset<10000> bint;
 6 inline bint plus(bint a,bint b){
 7     return b.any()?plus(a^b,(a&b)<<1):a;
 8 }
 9 inline bint mul(bint a,bint b){
10     return b.any()?(b[0]?plus(a,mul(a<<1,b>>1)):mul(a<<1,b>>1)):0;
11 }
12 int main(){}

 

bitset实现位压加法

原文:https://www.cnblogs.com/tak-fate/p/13181170.html

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