- 博客(9)
- 问答 (1)
- 收藏
- 关注
原创 Jupyter Notebook
目录hot key模式切换hot key模式切换两个模式:command mode 和 cell modecell 模式下:Enter -> command modecommand 模式下:Esc -> cell mode
2021-09-16 10:45:42
175
原创 常用基础算法
目录快速幂二分高精度快速幂typedef long long ll;// 常规快速幂ll qp(ll a, ll b) { ll ans = 1; while (b) { if (b & 1) ans *= a; a *= a; b >>= 1; } return ans;}// 模下快速幂ll qp(ll a, ll b, ll p) { ll ans = 1 % p; while (b) { if (b & 1) ans = ans
2021-09-04 19:43:42
146
原创 树状数组(BIT)
树状数组基本操作单点修改 + 区间查询struct BIT{ int len; int e[N]; BIT(int n, int *a) { len = n; memset(e, 0, sizeof e); rep(i, 1, n) { cin >> a[i]; add(i, a[i]); } } int lowbit(int x) { return x & (-x); } // 单点修改 void add(int x, int v
2021-08-30 14:12:41
171
原创 Codeforces Round #739 (Div. 3)
文章目录ABCDEAPolycarp doesn’t like integers that are divisible by 3 or end with the digit 3 in their decimal representation.t (1≤t≤100) k (1≤k≤1000)题意: 找出第 k 个既不是 3 的倍数,也不是以 3 结尾的正整数。思路: 打表 找出符合条件的前 1000 个数#include<bits/stdc++.h>using namespace s
2021-08-19 09:29:17
258
原创 常用代码模板 + 函数
#include<bits/stdc++.h>using namespace std;using ll = long long;using pll = pair<int, int>;
2021-08-18 16:19:35
111
原创 STL(Standrd Template Library)
引用 Reference// 节省空间,增强代码可读性const int & p = f[0]; // 函数传参(传地址)void _swap(int & a, int & b) { // _swap 与 swap 区分 a ^= b ^= a ^= b;}结构体 Structstruct _class { int num; }
2021-08-18 15:34:04
108
原创 并查集 DSU(Disjoint Set Union)
- 并查集 DSUstruct DSU { vector<int> f, siz; DSU(int n) : f(n), siz(n, 1) { iota(f.begin(), f.end(), 0); } int leader(int x) { while (x != f[x]) x = f[x] = f[f[x]]; return x; } bool same(int x, int y) { return leader
2021-08-17 19:17:02
190
空空如也
PTA-java-上三角数字三角形 运行超时怎么改善?
2021-03-12
TA创建的收藏夹 TA关注的收藏夹
TA关注的人