10 2021 档案
摘要:https://www.luogu.com.cn/problem/P2118 分析 枚举即可,因为。 #include <bits/stdc++.h> using namespace std; #define LL long long #define INF 0x3fffffff i
阅读全文
摘要:https://www.luogu.com.cn/problem/P2239 分析 先剥掉层再做。特判时。 #include <bits/stdc++.h> using namespace std; #define LL long long int main() { int n,
阅读全文
摘要:https://www.luogu.com.cn/problem/P2141 #include <bits/stdc++.h> using namespace std; #define LL long long int a[110]; int main() { int n,cnt=0; cin>>n
阅读全文
摘要:https://www.luogu.com.cn/problem/P7911?contestId=54994 #include <bits/stdc++.h> using namespace std; #define LL long long #define P pair<string,int> s
阅读全文
摘要:https://www.luogu.com.cn/problem/P7910?contestId=54994 分析 排序做成复杂度即可。 #include <bits/stdc++.h> using namespace std; #define LL long long struct s
阅读全文
摘要:https://www.luogu.com.cn/problem/P7909?contestId=54994 分析 无。 #include <bits/stdc++.h> using namespace std; #define LL long long LL n,l,r; int main() {
阅读全文
摘要:https://codeforces.com/contest/1593/problem/D2 分析 枚举选中的个数中最小的数,然后枚举大于其的数的所有因子,如果拥有某个因子的数的个数大于,则选中,求符合条件的最大的因子即可。 #include <bits/stdc++.h> us
阅读全文
摘要:https://codeforces.com/contest/1593/problem/D1 分析 求最大公因子。 #include <bits/stdc++.h> using namespace std; #define LL long long int t,n,a[45],d[45]; int
阅读全文
摘要:https://codeforces.com/contest/1593/problem/C 分析 考虑到必须首先移动距离最近的,因为,如果需要为了避免距离近的被吃掉而去移动它,那么最后必然面临着“差一步即追及”的局面,最终这种局面会变成$c
阅读全文
摘要:https://codingcompetitions.withgoogle.com/kickstart/round/00000000004362d6/00000000008b3771 分析 签到题。 按照题意模拟。 #include <bits/stdc++.h> using namespace s
阅读全文
摘要:https://www.luogu.com.cn/problem/P2822 分析 杨辉三角 + 模运算 + 前缀和 #include <bits/stdc++.h> using namespace std; int t,k,n,m,ans,y[2010][2010],done=1,s[2010][
阅读全文
摘要:https://www.luogu.com.cn/problem/P1967 分析 题意为求任意两城市之间能够联通的线路中所有单个线路中最小值的最大值。 首先做最大生成树生成数组,然后每棵树获得数组(表示节点在所属的树中的深度,根节点深度为$
阅读全文
摘要:https://www.luogu.com.cn/problem/P3379 分析 模板题。 #include <bits/stdc++.h> using namespace std; int N,M,S,deep[500010],p[500010][21],fa[500010],x,y,maxde
阅读全文
摘要:https://leetcode-cn.com/problems/min-cost-to-connect-all-points/ 分析 模板题。 #define P pair<int, int> #define PI pair<int, P> class Solution { public: vec
阅读全文
摘要:https://www.luogu.com.cn/problem/P1546 分析 模板题。 #include <bits/stdc++.h> #define P pair<int, int> #define PI pair<int, P> //路径长度,路径端点 using namespace s
阅读全文
摘要:https://leetcode-cn.com/problems/er-cha-shu-ran-se-UGC/ 分析 dp做法, 表示以为根节点的子树中,根节点联通个蓝色点(包括它本身),这种情况下最大和是,那么转移方程就有如下分析: 1、$f[x]
阅读全文
摘要:https://codeforces.com/contest/1592/problem/A 分析 就最大两张卡牌轮流上。 #include <bits/stdc++.h> using namespace std; int t,n,h,a,maxf,maxs; int main() { scanf("
阅读全文
摘要:https://codeforces.com/contest/1592/problem/C ##分析 本题从“异或”的性质出发,已知一棵树若能符合题意地被分割成 i(2~k)个部分,那么它就可以被符合题意地分割成 i-2 个部分,则只需要考虑原来的树能否被符合题意地分割成 2 或 3 个部分。当 k
阅读全文
摘要:https://codingcompetitions.withgoogle.com/kickstart/round/00000000004361e3/000000000082b933#problem 分析 由题意可知是有一些区间,求最多砍刀能够把他们分成的区间个数,那么只需要记录各个区间的起点
阅读全文
摘要:https://codeforces.com/contest/1592/problem/B 分析 由本题题意得知,假设有,是开头结尾,是需要交换的逆序对,则时可以直接交换,时只需要保证以及之间能够
阅读全文
摘要:https://www.luogu.com.cn/problem/P3367 分析 模板题。 #include <bits/stdc++.h> using namespace std; int N,M,fa[10010]={0},z,x,y; int find(int n) { return n==
阅读全文
摘要:https://leetcode-cn.com/problems/DFPeFJ/ 分析 #define P pair<int, int> #define PP pair<int,P> //时间 城市 电量 class Solution { public: //f[i][j]表示从start到i城市且
阅读全文
摘要:https://www.luogu.com.cn/problem/P3958 ##分析 把奶酪下表面看作点0,中间n个洞看作点1n,上表面看作点n+1,由于数据范围较小,可以直接先判断出点与点之间的联通状态,然后判断0n+1点之间有无联通路径。 #include <bits/stdc++.h> us
阅读全文