码迷,mamicode.com
首页 >  
搜索关键字:reverse bits    ( 8842个结果
【LeetCode】338. 比特位计数
题目链接:https://leetcode-cn.com/problems/counting-bits/ 本题使用动态规划 根据二进制的规则,满二进一,因此,如果一个数的是二的次方数,那么该数的二进制中,1的个数一定为1 根据位运算的相关规则,在程序中将一个数左移一位,相当于将该数乘以2,由于左移一 ...
分类:其他好文   时间:2021-03-03 12:36:19    阅读次数:0
Gym-102411C
C - Cross-Stitch tag: 构造, 欧拉回路 题意 十字绣穿针引线,保证 'X' 八联通 思路 这样构造,然后正反跑欧拉回路 #include<bits/stdc++.h> using namespace std; const int N = 3e5 + 10; typedef lo ...
分类:其他好文   时间:2021-03-03 12:15:26    阅读次数:0
后缀排序模板
题链 sa $sa[i]$表示排名$i$的开头 $rk[i],x[i]$表示$i$后缀所在的排名 $y[i]$表示的第二段排名为$i$的开头 $c[i]$为桶 倍增 #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int ...
分类:编程语言   时间:2021-03-02 12:00:38    阅读次数:0
C++语言
typedef type newname; // 为已有的类型取一个新名字 // 枚举类型 enum color {red, green=5, yellow}; // color: 枚举名 // red, green, yellow: 标识符 // 默认,第一个标识符的值为0,第二个标识符的值为1, ...
分类:编程语言   时间:2021-03-01 13:50:41    阅读次数:0
最短路
一、单源最短路径 1.朴素Dijkstra算法 #include <bits/stdc++.h> using namespace std; const int N = 1000; //数组g为邻接矩阵用于存放权值, 数组dis[i]表示起点到节点i的距离, n代表点的个数, m代表边的个数 int ...
分类:其他好文   时间:2021-03-01 13:48:57    阅读次数:0
并查集
#include <bits/stdc++.h> using namespace std; const int N = 1000; int n; int p[N + 1], s[N + 1]; //数组p用于存储祖先节点,数组s用于存储当前祖先节点下并查集的元素个数 //并查集初始化, 给所有祖先节 ...
分类:其他好文   时间:2021-03-01 13:35:27    阅读次数:0
省选前的数据结构和字符串训练合编
虚树 [SDOI2011]消耗战 板题,基本上是对着网上的板子敲的 #include <bits/stdc++.h> using namespace std; inline int read() { int out = 0; register char cc = getchar(); while ( ...
分类:其他好文   时间:2021-03-01 12:59:52    阅读次数:0
树状数组
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef ...
分类:编程语言   时间:2021-02-27 13:27:43    阅读次数:0
AtCoder Beginner Contest 145
A - Circle #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int r; int main(){ cin >> r; cout << r * r << end ...
分类:其他好文   时间:2021-02-24 13:15:50    阅读次数:0
leetcode 404,530,543,563,572,589,617,637,700
404 按理说也可以递归做。 public static int sumOfLeftLeaves(TreeNode root) { int total = 0; LinkedList<TreeNode> stack = new LinkedList<>(); stack.push(root); wh ...
分类:其他好文   时间:2021-02-23 14:11:21    阅读次数:0
8842条   上一页 1 ... 13 14 15 16 17 ... 885 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!