最普通的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,a,b,c=0,d=0,e=0; scanf("%d",&n); while(n)…… 题解列表 2024年11月22日 0 点赞 0 评论 455 浏览 评分:0.0
最复杂的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>long f1(int a){ long y; y=(long)a*a; return y;}long f2(int …… 题解列表 2024年11月22日 0 点赞 0 评论 394 浏览 评分:4.0
比较复杂,不建议参考 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int t,n; while(scanf("%d",&t)!=EOF) { n=…… 题解列表 2024年11月22日 0 点赞 0 评论 556 浏览 评分:0.0
混合背包 C语言网最阴的题! 摘要:解题思路:注意事项: 不要被题目骗了,数组要开大一点,样例输出也是错的,服了这题目!参考代码:#include"bits/stdc++.h" using namespace std; // 定…… 题解列表 2024年11月22日 0 点赞 0 评论 375 浏览 评分:0.0
多重背包,嘿嘿嘿嘿嘿 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义全局变量n和m,分别表示物品数量和背包容量 int n, m; …… 题解列表 2024年11月22日 0 点赞 0 评论 372 浏览 评分:0.0
2073 安之 亲和串训练 摘要:解题思路:在s1字符串后连接一个s1,用find()函数进行搜索即可。注意事项:参考代码:#include <iostream>#include <string>using namespace std…… 题解列表 2024年11月22日 0 点赞 0 评论 449 浏览 评分:0.0
关于 混合背包(完全背包、多重背包、01背包) 的解题思路(C语言) 注意:观看本篇文章需要一定基础,如果你不会解决背包问题,这里建议先去学习一下。解题思路:与多重背包差不多,不过要加入一个判断:当物品数量为0时,使用完全背包;如果不为0,则使用多重背包(当物品数量为1时就是01背包)。下面是参考代码,我进行了优化,使用一维数组解决。 题解列表 2024年11月22日 0 点赞 0 评论 710 浏览 评分:9.9
普普通通的解题方法(for循环) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,a[10],t; for (i = 0;i < 10;i++) { scanf("%d",&a[…… 题解列表 2024年11月22日 0 点赞 0 评论 979 浏览 评分:0.0
移动路线,简单递推 摘要:解题思路:转换成从左上到右下注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义全局变量m和n,以及二维数组k并初始化为0 i…… 题解列表 2024年11月22日 0 点赞 0 评论 399 浏览 评分:0.0
一种一懂的另类写法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include <math.h>int main(){ int n,t; scanf("%d",&n); double d = sqr…… 题解列表 2024年11月22日 0 点赞 0 评论 561 浏览 评分:9.9