文章分类 - 算法知识点
摘要:STL vector include set #include 去重 map include 离散化计数 queue(队列) 先进先出 #include stack(栈) include iterator(迭代器) include
阅读全文
摘要:位运算 按位与 两数相同位都为1则为1,否则为0 a&b > 二进制 如3&4 > 0010&0011 >0010 >3 用途 清零 与0按位与 取一个数的指定位 比如取10101110的低四位,只需要找到低四位都为1,其余为0的数按位与 判断奇偶 根据末位0还是1判断,1为奇数,0为偶数可以使用a
阅读全文
摘要:分治、二分 分治: 就是分解成若干小规模问题解决 分治的步骤: 示例:汉诺塔问题、归并排序 归并排序求逆序对 #include<iostream> using namespace std; int n; int a[50010]; int b[50010]; long long ans = 0; v
阅读全文