当前位置:网站首页>Bitmap principle code record
Bitmap principle code record
2022-07-02 04:02:00 【Hong Dayu】
#include <iostream>
#include <string>
#include <cstdint>
#include <algorithm>
#include <vector>
// The conventional bit Bit setting
#define set_bit(x,y) y|=(1<<(x))
#define check_bit(x,y) (1<<(x)&(y))?1:0
int main(void){
std::vector<int32_t> sort = {
1,3,5,7,8,2,4,6};
int32_t bitmask=0;
//little
set_bit(8,bitmask); // The brand needs to be sorted for the first time
for(int32_t i = 0 ; i < 8 ; i++){
set_bit(sort[i],bitmask);
}
for(int32_t i = 0 ; i < 9 ; i++){
if(check_bit(i,bitmask)){
std::cout << i << " ";
}
}
std::cout << std::endl;
}
bitmap It can be used to remove weight and , Non duplicate allocation index
- linux pid The way of distribution
边栏推荐
- 0基础如何学习自动化测试?按照这7步一步一步来学习就成功了
- go 函数
- 【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
- L'avènement de l'ère 5G, une brève discussion sur la vie passée et présente des communications mobiles
- Flutter中深入了解MaterialApp,常用属性解析
- Influence of air resistance on the trajectory of table tennis
- Blue Bridge Cup SCM digital tube skills
- Qt插件之Qt Designer插件实现
- Oracle common SQL
- 5G时代全面到来,浅谈移动通信的前世今生
猜你喜欢
0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
First acquaintance with P4 language
【leetcode】34. Find the first and last positions of elements in a sorted array
文档声明与字符编码
初识P4语言
Fluent icon demo
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
The 7th Blue Bridge Cup single chip microcomputer provincial competition
Lei Jun wrote a blog when he was a programmer. It's awesome
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
随机推荐
蓝湖的安装及使用
Blue Bridge Cup single chip microcomputer sixth temperature recorder
[personal notes] PHP common functions - custom functions
Www2022 | know your way back: self training method of graph neural network under distribution and migration
Jetpack's livedata extension mediatorlivedata
Wpviewpdf Delphi and Net PDF viewing component
Vite: configure IP access
XSS prevention
pip 安装第三方库
Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map
Installation et utilisation du lac bleu
集成底座方案演示说明
Installation and use of blue lake
Monkey测试
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
Which product of anti-cancer insurance is better?
微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
毕设-基于SSM电影院购票系统
PIP installation of third-party libraries