当前位置:网站首页>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
边栏推荐
- Realizing deep learning framework from zero -- Introduction to neural network
- 《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
- First acquaintance with P4 language
- The 5th Blue Bridge Cup single chip microcomputer provincial competition
- 《动手学深度学习》(二)-- 多层感知机
- 如何解决在editor模式下 无法删除物体的问题
- How to solve the code error when storing array data into the database
- 向数据库中存入数组数据,代码出错怎么解决
- Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
- 【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
猜你喜欢

Go语言介绍

The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup

【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证

手撕——排序

Nacos 配置中心整体设计原理分析(持久化,集群,信息同步)

蓝桥杯单片机第六届温度记录器

Flutter中深入了解MaterialApp,常用属性解析

Fluent icon demo

The first practical project of software tester: web side (video tutorial + document + use case library)

How to model noise data? Hong Kong Baptist University's latest review paper on "label noise representation learning" comprehensively expounds the data, objective function and optimization strategy of
随机推荐
XSS prevention
软件测试人的第一个实战项目:web端(视频教程+文档+用例库)
Oracle viewing locked tables and unlocking
Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
Www 2022 | rethinking the knowledge map completion of graph convolution network
How to solve the code error when storing array data into the database
《动手学深度学习》(二)-- 多层感知机
[untitled]
5G時代全面到來,淺談移動通信的前世今生
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
Blue Bridge Cup single chip microcomputer sixth temperature recorder
5G时代全面到来,浅谈移动通信的前世今生
Fluent icon demo
Where can I buy cancer insurance? Which product is better?
Imageai installation
Force buckle 540 A single element in an ordered array
Target free or target specific: a simple and effective zero sample position detection comparative learning method
Sword finger offer II 006 Sort the sum of two numbers in the array
The confusion I encountered when learning stm32