随笔分类 - 天梯赛
摘要:L2-1 点赞狂魔 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const LL N=200200,M=2020,INF=0x3f3f3f3f; LL n; s
阅读全文
摘要:L1-6 整除光棍(思维题) #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const LL N=100200,M=2020; const double PI=3
阅读全文
摘要:L1-1 寻找250 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const LL N=100200,M=2020; const double PI=3.141
阅读全文
摘要:https://pintia.cn/problem-sets/994805046380707840/exam/problems/994805050709229568 输入样例: 7 5 4 1 2 2 3 3 1 4 5 5 6 1 4 5 7 输出样例: 2 6 4 0 #include<bits
阅读全文
摘要:https://pintia.cn/problem-sets/994805046380707840/exam/problems/994805052626026496 输入样例: 3 4 5 2 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 0 1
阅读全文
摘要:https://pintia.cn/problem-sets/994805046380707840/exam/problems/994805053141925888 题目大意: 当你在社交网络平台注册时,一般总是被要求填写你的个人兴趣爱好,以便找到具有相同兴趣爱好的潜在的朋友。一个“社交集群”是指部
阅读全文
摘要:https://pintia.cn/problem-sets/994805046380707840/exam/problems/994805053695574016 输入样例: 17 Pop PeekMedian Push 3 PeekMedian Push 2 PeekMedian Push 1
阅读全文
摘要:https://pintia.cn/problem-sets/994805046380707840/exam/problems/994805054207279104 题目大意: 给定n个硬币,总共需要我们凑出m块钱。 问我们能凑出的硬币的最小字典序是什么? 可以的话输出最小的字典序数列,不可以的话输
阅读全文
摘要:https://pintia.cn/problem-sets/994805046380707840/exam/problems/1518582268930473984 ###L2-041 插松枝 题目意思: 人造松枝加工场的工人需要将各种尺寸的塑料松针插到松枝干上,做成大大小小的松枝。他们的工作流程
阅读全文
摘要:###L2-026 小字辈 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const LL MAXN=1e18; const LL N=100020,M=4002
阅读全文
摘要:https://pintia.cn/problem-sets/994805046380707840/exam/problems/1518582383141380096 题目大意: 给定n个工作的时间段,每个时间段都在 00:00:00 到 23:59:59 这个范围内,说明不会跨天数,也不会发生重叠
阅读全文
摘要:###L2-036 网红点打卡攻略 题目不难,但是需要仔细解读题目所给条件是什么意思 我们需要在所给的每个打卡点打卡只一次,说明每个网红店都只能经过一次 从家出发,顺着道路所给的网红打卡点一直走,说明一直就看这两者之间的道路值就行了,没有就是走不通的,走完最后一个打卡点直接回家 #include<b
阅读全文
摘要:###L2-031 深入虎穴 这个题目我疑惑了好久,因为它说只有一个入口,但是却没有告诉我们哪个是入口,并且需要我们找出距离入口最远的那扇门 所以我们在做题时要一一判断哪个是入口,然后再进行寻找 #include<bits/stdc++.h> using namespace std; typedef
阅读全文
摘要:###L2-021 点赞狂魔 如果有并列,则输出标签出现次数平均值最小的那个 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const LL MAXN=1e18;
阅读全文
摘要:###L2-016 愿天下有情人都是失散多年的兄妹 这题一开始我没有标注爸爸妈妈是男的是女的直接卡了半天 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const
阅读全文
摘要:###L2-011 玩转二叉树 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const LL MAXN=1e18; const LL N=500200,M=40
阅读全文
摘要:###L2-006 树的遍历 先序遍历:根→左→右 中序遍历:左→根→右 后序遍历:左→右→根 层序遍历:按照每层顺序遍历 根据后序遍历和中序遍历,可以知道: 1.后序遍历的最后一个值,一定是根节点; 2.此根节点在中序遍历中,将左右子树划分开来; 3.在左右子树中,对应的区间结点数一定是相同的,于
阅读全文
摘要:###L2-001 紧急救援 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const LL MAXN=1e18; const LL N=2002,M=520;
阅读全文