会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
LH2000
qq :1319787679
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
12
下一页
2021年1月12日
DIV3E 基环树
摘要: #include<bits/stdc++.h> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define rush! ios::sync_with_stdio(false);cin.tie(0); c
阅读全文
posted @ 2021-01-12 15:57 _LH2000
阅读(145)
评论(0)
推荐(0)
2021年1月10日
Codeforces Round #663 (Div. 2) D.505
摘要: https://codeforces.ml/contest/1391/problem/D 位运算,绝妙的一个题 #include <iostream> #include <cstring> #include <cstdio> #include <vector> using namespace std
阅读全文
posted @ 2021-01-10 18:45 _LH2000
阅读(92)
评论(0)
推荐(0)
统计2进制中1的数量
摘要: int lowbit(int x){ return x & -x; } 上面的代码可以统计x 的二进制中1 的数量; lowbit(x ^ y) 上面的代码则可以统计x和y中不同位的数量
阅读全文
posted @ 2021-01-10 18:38 _LH2000
阅读(92)
评论(0)
推荐(0)
bitset 用法笔记
摘要: C++的 bitset 在 bitset 头文件中,它是一种类似数组的结构,它的每一个元素只能是0或1,每个元素仅用1bit空间。 下面是具体用法 bitset<4> bitset1; //无参构造,长度为4,默认每一位为0 bitset<8> bitset2(12); //长度为8,二进制保存,前
阅读全文
posted @ 2021-01-10 13:44 _LH2000
阅读(116)
评论(0)
推荐(0)
2021年1月1日
扩展欧几里得
摘要: int exgcd(int a,int b,int&x,int&y) { if(b==0){ x=1,y=0; return a; } int r=exgcd(b,a%b,y,x); y-=a/b*x; return r; }
阅读全文
posted @ 2021-01-01 21:45 _LH2000
阅读(74)
评论(0)
推荐(0)
2020年12月17日
KM算法(二分图最大权匹配)
摘要: #include <bits/stdc++.h> #define N 1500 #define inf 999999999 using namespace std; int a[N],bs[N],nx=0,ny=0,k; int linky[N],lx[N],ly[N],slack[N]; int
阅读全文
posted @ 2020-12-17 22:05 _LH2000
阅读(123)
评论(0)
推荐(0)
2020年12月7日
C1. Errich-Tac-Toe (Easy Version) 米奇妙妙屋
摘要: #include<bits/stdc++.h> #include<cstdio> #include<cstring> #include<cstdlib> #include<iostream> #include<algorithm> using namespace std; #define lson
阅读全文
posted @ 2020-12-07 12:58 _LH2000
阅读(261)
评论(0)
推荐(0)
2020年10月8日
求逆元
摘要: 费马小定理 #include<cstdio> #include<cstring> using namespace std; int Quick_Power(int a,int b,int c) { int ans=1; while(b) { if(b&1) ans=(1ll*ans*a)%c; a=
阅读全文
posted @ 2020-10-08 19:54 _LH2000
阅读(123)
评论(0)
推荐(0)
欧拉函数
摘要: #define Max 1000001 int euler[Max]; void Init(){ euler[1]=1; for(int i=2;i<Max;i++) euler[i]=i; for(int i=2;i<Max;i++) if(euler[i]==i) for(int j=i;j<M
阅读全文
posted @ 2020-10-08 19:25 _LH2000
阅读(105)
评论(0)
推荐(0)
2020年10月3日
求组合数
摘要: ll f[N],invf[N]; ll fpow(ll a,ll k){ ll res=1; while(k){ if(k&1) res=(res*a)%mod; k>>=1; a=a*a%mod; //cout<<1<<endl; } return res; } void init(int n){
阅读全文
posted @ 2020-10-03 23:26 _LH2000
阅读(112)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
12
下一页
公告