上一页 1 ··· 43 44 45 46 47
摘要: 原题链接 题解 1.字典树 虽然此做法时间效率空间效率代码效率都不占优,但是必须要了解一下。 阅读全文
posted @ 2023-11-30 15:28 纯粹的 阅读(5) 评论(0) 推荐(1) 编辑
摘要: 原题链接 详解见题解区,个人见解见代码,蒟蒻真的折服于dalao的思路 #include<bits/stdc++.h> #define ll long long using namespace std; ll dp[20][210][1026]={0}; ll counts(int now) { l 阅读全文
posted @ 2023-11-29 20:59 纯粹的 阅读(9) 评论(0) 推荐(1) 编辑
摘要: 原文链接 枚举即可 #include<bits/stdc++.h> #define ll long long using namespace std; int s[14]={0}; int main() { ll n; scanf("%lld",&n); for(int i=1;i<=9;i++)s 阅读全文
posted @ 2023-11-28 20:50 纯粹的 阅读(17) 评论(0) 推荐(1) 编辑
摘要: 原题链接 非常详细的题解见洛谷,个人见解见代码 方法一:倍增法 #include<bits/stdc++.h> using namespace std; #define N 500005 vector<int> G[N];//链树,以链上的元素为根节点的树 void add(int x,int y) 阅读全文
posted @ 2023-11-28 19:15 纯粹的 阅读(15) 评论(0) 推荐(1) 编辑
摘要: 原题链接 题解 每次从所有果子堆中选重量最小的两堆并累加,观察到只需要找出 最小 因此考虑用堆,而当你对于堆的理解足够深之后,可以用c++ 的 priority_queue 代码 #include<bits/stdc++.h> using namespace std; int pile[10005] 阅读全文
posted @ 2023-11-26 16:58 纯粹的 阅读(18) 评论(0) 推荐(1) 编辑
摘要: 1. 利用map实现速查,优点是代码简洁,缺点是速度慢,内存大 #include<bits/stdc++.h> using namespace std; int a[200005]={0}; int main() { int n,c; scanf("%d%d",&n,&c); map<int,int 阅读全文
posted @ 2023-11-26 16:28 纯粹的 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 原题链接 a56爆大奖在线娱乐曾经写题时有个疑惑,那就是会不会算力恢复之后大于最大算力? 其实不会,把消耗的算力想象成占领,恢复算力想象成撤离,不管怎么恢复,领地都是那个领地。 #include<bits/stdc++.h> using namespace std; int power[200005]={0}; st 阅读全文
posted @ 2023-11-22 22:54 纯粹的 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题解已经讲的足够好了,a56爆大奖在线娱乐想来补充一点a56爆大奖在线娱乐在思考过程中遇到的“小石子”(此处dalao可以跳过) 1.逆序对和线性代数里的逆序数有点不一样,逆序数 是指一段排列中所有逆序对的数量(蒟蒻当时卡在这里好久) 2.每进行一次交换,最多 能消除一个逆序对 a56爆大奖在线娱乐为了消除所有的逆序对,最少交换次数就等于逆 阅读全文
posted @ 2023-11-21 23:34 纯粹的 阅读(20) 评论(3) 推荐(0) 编辑
上一页 1 ··· 43 44 45 46 47