随笔分类 -  洛谷

菜鸡的题库
P2014 [CTSC1997] 选课 -树形dp
摘要:#include <bits/stdc++.h> #define debug(x) std::cerr << "[" << __LINE__ << "]: " << #x << " = " << x << "\n" using i64 = long long; const int N = 300 + 阅读全文
posted @ 2022-08-10 22:16 OopsOops 阅读(22) 评论(0) 推荐(0) 编辑
数码个数 -数位dp
摘要:#include <bits/stdc++.h> #define debug(x) std::cerr << "Line: " << __LINE__ << ", " << #x << " = " << x << "\n" using i64 = long long; constexpr int N 阅读全文
posted @ 2022-08-03 17:35 OopsOops 阅读(38) 评论(0) 推荐(0) 编辑
P2704 [NOI2001] 炮兵阵地 -状态压缩dp -省选
摘要:#include <bits/stdc++.h> #define debug(x) std::cerr << "Line: " << __LINE__ << \ "," << #x << "=" << x << "\n" using ll = long long; constexpr int N = 阅读全文
posted @ 2022-07-31 11:54 OopsOops 阅读(20) 评论(0) 推荐(0) 编辑
高斯消元法 -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 阅读全文
posted @ 2022-07-23 12:02 OopsOops 阅读(41) 评论(0) 推荐(0) 编辑
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 阅读全文
posted @ 2022-07-15 23:17 OopsOops 阅读(58) 评论(0) 推荐(0) 编辑
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 阅读全文
posted @ 2022-07-15 12:15 OopsOops 阅读(21) 评论(0) 推荐(0) 编辑
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 阅读全文
posted @ 2022-07-14 20:24 OopsOops 阅读(17) 评论(0) 推荐(0) 编辑
数独填充 -- 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 阅读全文
posted @ 2022-07-13 18:31 OopsOops 阅读(31) 评论(0) 推荐(0) 编辑
P1025 数的划分 --dp,dfs
摘要:1 #include <bits/stdc++.h> 2 using i64 = long long; 3 using namespace std; 4 #define repk(i,s,t,k) for(int i = s; i <= t; i += k) 5 #define rep(i,s,t) 阅读全文
posted @ 2022-05-11 14:45 OopsOops 阅读(18) 评论(0) 推荐(0) 编辑

 
点击右上角即可分享
微信分享提示