当前位置:网站首页>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
边栏推荐
- Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
- [personal notes] PHP common functions - custom functions
- Demonstration description of integrated base scheme
- [tips] use Matlab GUI to read files in dialog mode
- Www2022 | know your way back: self training method of graph neural network under distribution and migration
- 如何解决在editor模式下 无法删除物体的问题
- Fourier series
- Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)
- Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
- regular expression
猜你喜欢

The 8th Blue Bridge Cup single chip microcomputer provincial competition

Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
![[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)](/img/5e/81e613370c808c63665c14298f9a39.png)
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)

Hands on deep learning (II) -- multi layer perceptron

Lei Jun wrote a blog when he was a programmer. It's awesome

Fluent icon demo

Failed to upgrade schema, error: “file does not exist

The fourth provincial competition of Bluebridge cup single chip microcomputer

The 9th Blue Bridge Cup single chip microcomputer provincial competition

【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
随机推荐
Flutter中深入了解MaterialApp,常用属性解析
The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition
Li Kou interview question 02.08 Loop detection
MySQL advanced SQL statement 2
C语言:逻辑运算和判断选择结构例题
Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
蓝桥杯单片机第六届温度记录器
The 7th Blue Bridge Cup single chip microcomputer provincial competition
Www2022 | know your way back: self training method of graph neural network under distribution and migration
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
Nacos 配置中心整体设计原理分析(持久化,集群,信息同步)
QT designer plug-in implementation of QT plug-in
Class design basis and advanced
Opencv learning example code 3.2.4 LUT
pip 安装第三方库
向数据库中存入数组数据,代码出错怎么解决
Oracle viewing locked tables and unlocking
Vite: configure IP access
【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!