摘要: #include<bits/stdc++.h> using namespace std; #define pb push_back typedef long long ll; typedef unsigned long long ull; const int M=1e5+5; const int P 阅读全文
posted @ 2020-07-14 23:51 starve_to_death 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/G 题意:给定n个数的数组A,m个数的数组B,问在A中有多少个子数组满足Si>=Bi 分析:我们可以考虑记录合法子数组以数组A中的一个位置代表一个合法子数组(因为长度固定为m); 设bitset 的ans和tmp, 阅读全文
posted @ 2020-07-14 16:07 starve_to_death 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/J 题意:要求构造出序列P,让初始排列A={1,2,3,4....n}依照P序列跳转k次后得到给定排列。 分析:简单分析可发现,若存在合法情况的话,跳转的过程肯定在若干个简单环上; 我们可以简单模拟,设每个环大小为 阅读全文
posted @ 2020-07-14 14:19 starve_to_death 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/C 题意:选最少数量的“链”来覆盖整颗树,使树的每条边都至少被覆盖一次 分析:关键是理解证明过程: : #include<bits/stdc++.h> using namespace std; #define pb 阅读全文
posted @ 2020-07-14 14:07 starve_to_death 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/B 题意:给出n个二维平面点,问最多有多少个点和原点(0,0)同时在同一个圆的边上 分析:由三点确定圆心n^2枚举出所有圆心,最后求众数即可; 由于我们n^2枚举出来的圆心个数是由重复部分的,因为假设1,2,3,4 阅读全文
posted @ 2020-07-14 13:33 starve_to_death 阅读(171) 评论(0) 推荐(0) 编辑