完全背包问题,记忆化搜索,不能暴力了呜呜呜呜呜 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义全局变量,m表示背包容量,n表示物品数量,h初始化为-1 int…… 题解列表 2024年11月21日 0 点赞 0 评论 233 浏览 评分:0.0
通过将三位数转换为字符串直接for循环输出数组即可 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<string>using namespace std;int main(){ int a; cin>>a; …… 题解列表 2024年11月21日 0 点赞 0 评论 318 浏览 评分:0.0
2038: 简化型背包,暴力搜索 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义全局变量v, m和h,并初始化h为-1 int v,m,h=-1…… 题解列表 2024年11月21日 0 点赞 0 评论 243 浏览 评分:0.0
二维数组的转置 摘要:#include<bits/stdc++.h> using namespace std; void f(int a[4][4]) { for(int i=1;i<=3;i++) { …… 题解列表 2024年11月21日 1 点赞 0 评论 436 浏览 评分:9.9
自定义函数处理素数 摘要:#include<bits/stdc++.h> using namespace std; bool is_prime(int x) { if(x<=1)return false; …… 题解列表 2024年11月21日 2 点赞 0 评论 905 浏览 评分:9.9
求矩阵的两对角线上的元素之和 摘要:#include<bits/stdc++.h> using namespace std; int main() { int a[12][12]; int n;cin>>n; …… 题解列表 2024年11月21日 0 点赞 0 评论 382 浏览 评分:9.9
矩阵对角线求和 摘要:#includeusing namespace std; int main() { int a[10][10]; for(int i=1;i<=3;i++) for(int…… 题解列表 2024年11月21日 0 点赞 0 评论 719 浏览 评分:9.9
格式化输出用printf #2609: 蓝桥杯2021年第十二届省赛真题-时间显示 摘要:``` #define _CRT_SECURE_NO_WARNINGS 1 #include #include #include #include #include #include …… 题解列表 2024年11月21日 0 点赞 0 评论 340 浏览 评分:0.0
数组插入处理 摘要:#includeusing namespace std; int main() { int a[10]; for(int i=0;i>a[i]; int x,m;…… 题解列表 2024年11月21日 1 点赞 0 评论 630 浏览 评分:9.9
3022: 流感传染 呜呜呜呜呜呜呜呜呜呜 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){ // 定义变量n和m,以及sum用于计数 …… 题解列表 2024年11月20日 0 点赞 0 评论 400 浏览 评分:0.0