10 2024 档案

bitset使用样例
摘要:bitset可将01字符串转换为01数组,快速进行位运算等操作 bitset<int>(string) //将01字符串转换为01数组 例题 https://ac.nowcoder.com/acm/contest/92972/D #include<bits/stdc++.h> #define end 阅读全文

posted @ 2024-10-28 21:03 TaopiTTT 阅读(9) 评论(0) 推荐(0) 编辑

Tarjan模板
摘要:模板题在此 https://ac.nowcoder.com/acm/contest/86639/B /* tarjan:求强联通分量,本题中运用该算法实现重新构图并toposort */ #include<bits/stdc++.h> #define IOS ios::sync_with_stdio 阅读全文

posted @ 2024-10-28 16:10 TaopiTTT 阅读(5) 评论(0) 推荐(0) 编辑

set.erase()立大功
摘要:set.erase(int x)可以将x删除,利用这个特性,可以做到一次性删除 https://atcoder.jp/contests/abc370/tasks/abc370_d #include<bits/stdc++.h> #define endl '\n' #define int long l 阅读全文

posted @ 2024-10-17 21:46 TaopiTTT 阅读(11) 评论(0) 推荐(0) 编辑

二进制凑数+路线规划构造题
摘要:妙啊妙啊 https://ac.nowcoder.com/acm/contest/92687/K #include<bits/stdc++.h> #define endl '\n' #define lowbit(x) (x&-x) using namespace std; const double 阅读全文

posted @ 2024-10-17 18:45 TaopiTTT 阅读(3) 评论(0) 推荐(0) 编辑

叉积法判断三点共线+重载运算符
摘要:https://ac.nowcoder.com/acm/contest/92687/G #include<bits/stdc++.h> #define endl '\n' #define int long long #define lowbit(x) (x&-x) using namespace s 阅读全文

posted @ 2024-10-16 20:10 TaopiTTT 阅读(10) 评论(0) 推荐(0) 编辑

set+并查集查无向图第k大的节点(启发式合并优化)
摘要:关于启发式合并https://oi-wiki.org/graph/dsu-on-tree/ 在这里,对于两个大小不一样的集合,我们将小的集合合并到大的集合中,而不是将大的集合合并到小的集合中。 为什么呢?这个集合的大小可以认为是集合的高度(在正常情况下),而我们将集合高度小的并到高度大的显然有助于我 阅读全文

posted @ 2024-10-15 17:05 TaopiTTT 阅读(8) 评论(0) 推荐(0) 编辑

三维前缀和
摘要:二维前缀和模板: 预处理:dp[i][j]=dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1]+map[i][j]; 查询:dp[x2][y2]+dp[x1-1][y1-1]-dp[x1-1][y2]-dp[x2][y1-1] 三维前缀和模板: 预处理: pre[i][j][k]= 阅读全文

posted @ 2024-10-14 21:47 TaopiTTT 阅读(31) 评论(0) 推荐(0) 编辑

总之是个找三元回文字符串的题
摘要:思路很妙 https://atcoder.jp/contests/abc375/tasks/abc375_d #include<bits/stdc++.h> #define endl '\n' #define int long long #define lowbit(x) (x&-x) using 阅读全文

posted @ 2024-10-14 19:17 TaopiTTT 阅读(4) 评论(0) 推荐(0) 编辑

二进制枚举
摘要:实现N(2N)的暴力枚举 核心代码: int n; for(int i=0;i<(1<<n);i++){ for(int j=0;j<i;j++){ if(i&(1<<j)) //可以枚举2^n的所有情况 else //如果有两种枚举(比如起点到终点 、终点到起点) } } 例题:htt 阅读全文

posted @ 2024-10-10 20:01 TaopiTTT 阅读(15) 评论(0) 推荐(0) 编辑

组合数与自动取模类(已封装)
摘要:using i64 = long long; template<class T> constexpr T power(T a, i64 b) { T res = 1; for (; b; b /= 2, a *= a) { if (b % 2) { res *= a; } } return res; 阅读全文

posted @ 2024-10-09 19:46 TaopiTTT 阅读(17) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

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