树型dp #信息学奥赛一本通T1578-战略游戏 摘要:`f[u][0] 表示 u点上不放士兵的最小花费` `f[u][1] 表示 u点上放士兵的最小花费` 如果u点不放士兵,那么其子节点必须放士兵,不然这两条边不能同时被瞭望 如果u点放…… 题解列表 2024年12月21日 0 点赞 0 评论 118 浏览 评分:0.0
我也想要能量项链 摘要:解题思路: 区间DP解法注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int…… 题解列表 2024年12月21日 0 点赞 0 评论 315 浏览 评分:0.0
c++,编写题解 3132: 重载函数练习1 摘要:主要是输入顺序不固定参考代码:#include<iostream> #include <string.h> using namespace std; int fun(char a[]) { …… 题解列表 2024年12月21日 0 点赞 0 评论 211 浏览 评分:0.0
三个循环嵌套搞定(第一个完成赋值输入,第二个完成转置,第三个完成输出)。 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,j,a[3][3],b[3][3]; for(i=0;i<=2;i++) { …… 题解列表 2024年12月21日 2 点赞 0 评论 476 浏览 评分:0.0
计算球体积 摘要:解题思路:注意事项:参考代码:import mathpi=math.pi //导入库while True: &n 题解列表 2024年12月21日 1 点赞 0 评论 534 浏览 评分:0.0
蓝桥杯算法训练VIP-比较字符串 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <string.h>int main(){ char b[101],a[101]; scanf("%s …… 题解列表 2024年12月21日 0 点赞 0 评论 113 浏览 评分:0.0
1866: 三位数反转 摘要:解题思路:这题有多行输入,可能会造成错误注意事项:参考代码:while True: try: a = list(input()) b = a[::-1] …… 题解列表 2024年12月21日 0 点赞 0 评论 260 浏览 评分:0.0
少年 无爱可破情局 无情方可破全局 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义全局变量 int n, m, a[110], sum[110];…… 题解列表 2024年12月21日 0 点赞 0 评论 131 浏览 评分:0.0
递归自然最好用-计算:t=1-1/(2*2)-1/(3*3)-...-1/(m*m) 摘要:解题思路:递归注意事项:参考代码:#include<stdio.h>double h(int i){ if(i==1) { return 1.0; } else …… 题解列表 2024年12月21日 0 点赞 0 评论 227 浏览 评分:0.0
递归自然最好用-计算t=1+1/2+1/3+...+1/n 摘要:解题思路:递归注意事项:参考代码:#include<stdio.h>double h(int i){ if(i==1) { return 1.0; } else …… 题解列表 2024年12月21日 0 点赞 0 评论 329 浏览 评分:0.0