01背包(动态规划) 解题思路:动态规划对于01背包问题选择方法的集合可以分成2种:①不选第i个物品,并且总体积不大于j的集合所达到的最大值:f[i-1][j]②选择1~i个物品,并且总体积不大于j的集合所达到的最大值f[i][j]对于第二种情况我们很难计算,因此需要思考从另一个角度解决问题。 题解列表 2022年12月01日 0 点赞 0 评论 939 浏览 评分:9.9
2789: 骑车与走路 摘要:解题思路:注意事项:参考代码:a = int(input())if a / 3 + 50 < a / 1.2: print('Bike')elif a / 3 + 50 == a…… 题解列表 2022年12月01日 0 点赞 0 评论 765 浏览 评分:9.9
1040: [编程入门]实数的打印 最简方法 摘要:解题思路:简单的输入输出问题,首先定义float类型,然后输入,并按要求输出。注意事项:1.由题意输入为float类型,输入scanf注意%f。2.输出部分 “6.2f”格式是指数字整体长度包括小数点…… 题解列表 2022年12月01日 0 点赞 0 评论 710 浏览 评分:9.9
最笨的方法 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int a,b,c,d,e,f; scanf("%d",&a); if(a>9999){ …… 题解列表 2022年12月01日 0 点赞 2 评论 501 浏览 评分:9.9
三位数分解 摘要:注意事项:换行符\n 参考代码: ###### #include using namespace std; int main(){ int a; scanf("%d",&a); …… 题解列表 2022年12月01日 0 点赞 0 评论 925 浏览 评分:9.9
(小白板)矩阵交换行 解题思路:很简单啊,就是一个循环直接做一个交换,但中间要用到一个交换变量注意事项:就是数组要从1开始输入,而不是从0开始,因为不符合我们数学的常规思想#includeintmain(){inta[100][100];inti,j;for(i=1;i 题解列表 2022年12月01日 0 点赞 3 评论 1372 浏览 评分:9.9
c语言3010: 奇偶数之和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i = 1; int n; int sum1 = 0; int sum2 = 0; scanf("%d"…… 题解列表 2022年12月01日 0 点赞 0 评论 677 浏览 评分:9.9
题解 2900: 螺旋加密 摘要:解题思路:用a数组螺旋填写,b数组记录字符串代表的数字,d数组表示数字对应的五位二进制,c数组用来标记是否填写过。注意事项:利用了位运算参考代码:#include <algorithm>#includ…… 题解列表 2022年12月02日 0 点赞 0 评论 816 浏览 评分:9.9
2911: 连续出现的字符 ```cpp#include#includeusingnamespacestd;intmain(){intk,s=0;charch[100000],che;cin>>k>>ch;for(inti=0;i 题解列表 2022年12月02日 0 点赞 0 评论 701 浏览 评分:9.9
2912: 最长平台 摘要:```cpp #include using namespace std; int main() { int n,count=1,max=1,a[1001]; cin>>n;…… 题解列表 2022年12月02日 0 点赞 0 评论 796 浏览 评分:9.9