题解列表
2038: 简化型背包,暴力搜索
摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"
using namespace std;
// 定义全局变量v, m和h,并初始化h为-1
int v,m,h=-1……
1116: IP判断 java基础语法
摘要:import java.util.Scanner;
public class Main {
public static boolean ipValid(String ip) {
……
利用math中的求余
摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <math.h>double a, b, r;int main() { scanf("%lf%lf", &a, &b……
通过将三位数转换为字符串直接for循环输出数组即可
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<string>using namespace std;int main(){ int a; cin>>a; ……
2048: 多重背包一眼丁真
摘要:解题思路: 在01背包的基础上再套多一层循环以表示该物品的个数注意事项:参考代码:#include<stdio.h>
#define max(x,y) ((x)>(y)?(x):(y)……
完全背包问题,记忆化搜索,不能暴力了呜呜呜呜呜
摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"
using namespace std;
// 定义全局变量,m表示背包容量,n表示物品数量,h初始化为-1
int……