题解列表

筛选

题目 2808: 买房子

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main() { int N, K; double house_……

没有上司的晚会(树形DP)

摘要:解题思路:树形DP问题转化:将 "选择不相邻节点以获得最大价值" 的问题,转化为每个节点的两种状态决策选当前节点:则不能选任何子节点……

悠闲的漫步(DFS)

摘要:解题思路:树的表示:使用邻接表tree[N]存储树结构,tree[p]包含节点p的所有子节点。根节点查找:通过nop数组标记有父节点的节点,未被标记的节点即为根节点。深度计算:从根节点开始,通过 DF……

2025/8/6刷题记录

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; long long int sum……

2025/8/6刷题记录

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d&qu……

2025/8/6刷题记录

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b,d; char c;……

2025/8/7刷题记录

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d&qu……

2025/8/7刷题记录

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,b,m; scanf("%……

2025/8/7刷题记录

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,m; int arr[10];&nb……