07 2022 档案
test
摘要:[NOI2001] 炮兵阵地 题目描述 司令部的将军们打算在 的网格地图上部署他们的炮兵部队。 一个 的地图由 行 列组成,地图的每一格可能是山地(用 表示),也可能是平原(用 表示)
阅读全文
P2704 [NOI2001] 炮兵阵地 -状态压缩dp -省选
摘要:#include <bits/stdc++.h> #define debug(x) std::cerr << "Line: " << __LINE__ << \ "," << #x << "=" << x << "\n" using ll = long long; constexpr int N =
阅读全文
[template]二元一次方程组整数解 -math
摘要:#include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; #define int i64 void exgcd(int &gcd, int a, int b,
阅读全文
高斯消元法 -math
摘要:#include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; const int N = 105; std::vector<double> f[N]; void o
阅读全文
蓝桥杯2022省赛I题 -数的拆分 -math
摘要:#include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; int tot; int prime[100005], vis[100005]; const doub
阅读全文
蓝桥杯2022省赛J题 - 推导部分和 -带权并查集datastructure
摘要:#include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; const int N = 1e5 + 9; i64 val[N]; int fa[N]; int f
阅读全文
蓝桥杯2022省赛H题 - 扫描游戏 math
摘要:-51 33 2 #include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; struct node { i64 x, y, w; int id, circle,
阅读全文
P3959 [NOIP2017 提高组] 宝藏 --状态压缩dp,dfs
摘要:#include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; constexpr int N = 15; int n, m, lim, ans = 2e9, G[N
阅读全文
P2024食物链 - 种类并查集datastructure
摘要:#include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; constexpr int N = 100005; int fa[N * 3]; int find(i
阅读全文
City - 并查集路径压缩与按秩合并 datastructure
摘要:#include <bits/stdc++.h> using i64 = long long; #define dbg(x) std::cerr << #x << "=" << x << "\n" struct node{ int u,v,w; }; int fa[100005], rank[100
阅读全文
P1892团伙 -- 并查集datastructure
摘要:#include <bits/stdc++.h> using i64 = long long; int fa[1000005],b[1000005]; int find(int x){ return (fa[x] == x ? x : (fa[x] = find(fa[x]))); } void m
阅读全文
数独填充 -- dfs,bitmasks
摘要:#include <bits/stdc++.h> using i64 = long long; struct node { int x,y,row,col,grid,vis[3]; node():x(0),y(0),row(0),col(0),grid(0){ memset(vis,0,sizeof
阅读全文