[金银岛]自定义排序优先'均权'最大--我看题解都太复杂辣 摘要:# 贪心 自定义排序找均权值最大 #### 好久没发题解了。。。 ##### 核心思路:通过价值/重量 得到单位价值 ###### 按照单位价值从大到小得顺序装 直到装不下为止 ##…… 题解列表 2024年10月20日 0 点赞 1 评论 349 浏览 评分:9.9
优质题解 团伙(group) 并查集 摘要: #include using namespace std; int n,m; int o,p,q; int father[1001]; int…… 题解列表 2024年10月20日 173 点赞 0 评论 2537 浏览 评分:9.9
2878: 计算矩阵边缘元素之和 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N=2e3;ll a…… 题解列表 2024年10月20日 0 点赞 0 评论 765 浏览 评分:0.0
2881: 图像相似度 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N=2e3;ll a…… 题解列表 2024年10月20日 1 点赞 0 评论 271 浏览 评分:0.0
快速幂方法(需掌握) 摘要:参考代码:#include<bits/stdc++.h> using namespace std; #define int long long int fastPow(int a,int n,i…… 题解列表 2024年10月20日 1 点赞 0 评论 369 浏览 评分:0.0
1025: [编程入门]数组插入处理 摘要:解题思路:从后往前比较数组中的数值与目标数值的大小,若目标数值小于数组中的数,则数组中的数值向后移动,直到目标值大于数组中的数值,此时对应的数组中正好有一个空位,将目标值放入。然后遍历数组。注意事项:…… 题解列表 2024年10月20日 0 点赞 4 评论 412 浏览 评分:9.9
阶乘求和(自定义函数法) 摘要:解题思路:因为最后结果是由很多个阶乘相加,所以我们可以自定义一个阶乘函数,然后再利用循环将多个阶乘相加首先,自定义阶乘函数#include<iostream>using namespace std;l…… 题解列表 2024年10月20日 1 点赞 0 评论 679 浏览 评分:9.9
红与黑C++代码(程序不用回溯) 摘要:注意事项: 这个程序不用回溯,回溯过于浪费时间。参考代码:#include<bits/stdc++.h>using namespace std;int w,h,maxx;bool boo…… 题解列表 2024年10月20日 0 点赞 0 评论 240 浏览 评分:9.9
[编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:一个主函数外加一个被调用函数,被调用函数中运用辗转相除法求最大公约数,主函数利用数学公式最小公倍数=a*b/最大公约数,求出最小公倍数。注意事项:被调用函数中使用辗转相除法时用while循环…… 题解列表 2024年10月20日 0 点赞 1 评论 578 浏览 评分:10.0
只能说无意义的埋坑 摘要:参考代码:#include<bits/stdc++.h> using namespace std; int main() { string s; // cin>>s;有一个点…… 题解列表 2024年10月20日 0 点赞 1 评论 394 浏览 评分:0.0