摘要: A 分析 我们可以尝试依次把每一只小猫分配到一辆已经租用的缆车上,或者租用一辆缆车安置这种小猫 AC代码 #include<iostream> #include<algorithm> #define N 20 using namespace std; int n,m; int cat[N],sum[ 阅读全文
posted @ 2022-01-28 13:04 szf45 阅读(78) 评论(0) 推荐(0)
摘要: A 分析 下边比上边大就换 AC代码 #include<iostream> #include<algorithm> using namespace std; const int N=10010; int n,t,max1,max2; int a[N],b[N]; int main() { cin>> 阅读全文
posted @ 2022-01-28 13:01 szf45 阅读(28) 评论(0) 推荐(0)
摘要: A 分析 1.写一个结构体排序,把内存小的放前面,相等时,把对应附増的内存量大的放前面。 2.最后输出最大的内存量 AC代码 ​ #include<iostream> #include<algorithm> using namespace std; struct nm { int a,b; }s[1 阅读全文
posted @ 2022-01-24 13:03 szf45 阅读(62) 评论(1) 推荐(0)
摘要: ​ A 分析 排序+中位数性质 AC代码 #include<iostream> using namespace std; int a[100010]; void sort(int l,int r) { if(l>=r) return ; int i=l-1,j=r+1,mid=a[l+r>>1]; 阅读全文
posted @ 2022-01-20 10:52 szf45 阅读(54) 评论(2) 推荐(0)
摘要: A 分析 统计前缀个数,一想到字符串的前缀,我们就应该想到字典树,这个和字典一样的前缀树.这道题目是字典树模板的略微改动,我们发现这道题目和一般字典树的查询不一样,字典树一般查询是看这个字符串是否出现,而这道题目这是统计这个字符串出现的次数. AC代码 #include<iostream> usin 阅读全文
posted @ 2022-01-20 10:51 szf45 阅读(33) 评论(0) 推荐(0)