T1267-01背包问题 摘要:解题思路:滚动数组—— 一维dp数组遍历:for( ) 物品 for( 逆序) 背包递推公式: dp[ j ] = max( dp[ j ] , dp[ j -w[ i ] ] + …… 题解列表 2024年11月07日 0 点赞 0 评论 217 浏览 评分:0.0
每一行都有解释的c++代码(组合的输出) 摘要:参考代码:#include<bits/stdc++.h>//c++万能头文件using namespace std;//可以不写,不写的话在前面加上std::int m, n;//定义两个变量用于承载…… 题解列表 2024年11月07日 1 点赞 0 评论 540 浏览 评分:7.3
题解,标记 摘要:```c #include int main() { int n; scanf("%d", &n); int arr[n]; for (int i =…… 题解列表 2024年11月07日 0 点赞 0 评论 235 浏览 评分:0.0
循环+一维数组解决水仙花 摘要:解题思路:分割出每一位数,求立方和,相加跟原数比较注意事项:***0,1不算,要从2开始遍历****注意刷新和(res),数组序号i参考代码:#include <stdio.h> int main()…… 题解列表 2024年11月07日 0 点赞 0 评论 594 浏览 评分:9.9
汽水瓶,简单递归法 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 全局变量,用于记录最终结果,及换了多少汽水喝 int c=0; v…… 题解列表 2024年11月07日 0 点赞 1 评论 241 浏览 评分:9.9
2832: 第n小的质数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int n,j,i,k=0; scanf("%d",&n); …… 题解列表 2024年11月07日 0 点赞 0 评论 319 浏览 评分:0.0
2937: 短信计费 摘要:解题思路:注意事项:注意刚好能被70除的情况就行参考代码:#include <iostream>#include <cmath>using namespace std;int main(){ i…… 题解列表 2024年11月08日 0 点赞 0 评论 324 浏览 评分:0.0
没有太多解释的代码 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main ( ){ double h ,h1 ,h2 ,h3 ; doub…… 题解列表 2024年11月08日 0 点赞 0 评论 281 浏览 评分:0.0
不懂可评论 摘要:解题思路:注意事项:参考代码:a,b,c=map(int,input().strip().split()) print(a+b+c)sum=0 num=input().split() for i…… 题解列表 2024年11月08日 0 点赞 0 评论 216 浏览 评分:0.0
不懂可评论 摘要:解题思路:注意事项:参考代码:import java.util.Scanner; public class Main{ public static void main(String[] a…… 题解列表 2024年11月08日 0 点赞 0 评论 292 浏览 评分:9.9