随笔分类 - 思维与代码
m/k场比赛
摘要:[#include<bits/stdc++.h> define lc p<<1 define rc p<<1|1 define INF 1e18 using namespace std; define lowbit(x) x&(-x) define endl '\n' using ll = long
阅读全文
a数组操作跟b数组一样
摘要:https://codeforces.com/problemset/problem/2061/D #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #defin
阅读全文
树删除两个点求最大联通分量数
摘要:https://codeforces.com/problemset/problem/2063/C #include<bits/stdc++.h> using namespace std; #define endl '\n' using ll = long long; using pii = pair
阅读全文
稻草人与乌鸦
摘要:https://codeforces.com/problemset/problem/2055/D #include<bits/stdc++.h> using namespace std; #define endl '\n' using ll = long long; using pii = pair
阅读全文
选择子序列再逆序
摘要:https://codeforces.com/problemset/problem/2063/B #include<bits/stdc++.h> using namespace std; #define endl '\n' using ll = long long; using pii = pair
阅读全文
模拟
摘要:天梯赛使用 OMS 监考系统,需要将参赛队员安排到系统中的虚拟赛场里,并为每个赛场分配一位监考老师。每位监考老师需要联系自己赛场内队员对应的教练们,以便发放比赛账号。为了尽可能减少教练和监考的沟通负担,我们要求赛场的安排满足以下条件: 每位监考老师负责的赛场里,队员人数不得超过赛场规定容量 C; 每
阅读全文
汉诺塔
摘要:题目: 堆宝塔游戏是让小朋友根据抓到的彩虹圈的直径大小,按照从大到小的顺序堆起宝塔。但彩虹圈不一定是按照直径的大小顺序抓到的。聪明宝宝采取的策略如下: 首先准备两根柱子,一根 A 柱串宝塔,一根 B 柱用于临时叠放。 把第 1 块彩虹圈作为第 1 座宝塔的基座,在 A 柱放好。 将抓到的下一块彩虹圈
阅读全文
双指针+回文数组
摘要:https://codeforces.com/problemset/problem/1610/B #include<bits/stdc++.h> using namespace std; #define endl '\n' using ll = long long; using pii = pair
阅读全文
贪心+区间端点
摘要:https://codeforces.com/problemset/problem/2051/E #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #defin
阅读全文
二维数组+和
摘要:https://codeforces.com/problemset/problem/2055/C #include<bits/stdc++.h> using namespace std; #define endl '\n' #define lowbit(x) x&(-x) using ll = lo
阅读全文
数组【吞并】
摘要:https://codeforces.com/gym/580226/problem/I #include<bits/stdc++.h> using namespace std; #define endl '\n' #define lowbit(x) x&(-x) using ll = long lo
阅读全文
字符串+图形
摘要:https://codeforces.com/gym/580226/problem/F #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #define end
阅读全文
图形
摘要:https://codeforces.com/gym/580226/problem/E #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #define end
阅读全文
循环
摘要:https://codeforces.com/gym/580226/problem/D #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #define end
阅读全文
字符串+匹配
摘要:https://codeforces.com/gym/580226/problem/C #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #define end
阅读全文
字符串+相邻
摘要:https://codeforces.com/gym/580226/problem/B #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #define end
阅读全文
字符串
摘要:https://codeforces.com/gym/580226/problem/A #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #define end
阅读全文
GCD相关
摘要:https://codeforces.com/gym/580226/problem/M #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #define end
阅读全文
数学【找规律】
摘要:https://codeforces.com/contest/2043/problem/B #include<bits/stdc++.h> #define lc p<<1 #define rc p<<1|1 #define INF 2e9 using namespace std; #define e
阅读全文