题解列表
3060: 合并石子 区间DP
摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"
using namespace std;
// 定义全局变量n和数组a、dp
int n, a[110], dp[1……
利用等比数列前n项和公式来解决问题
摘要:解题思路:利用等比数列前n项和公式注意事项:该等比数列的项数为n-1个项参考代码:#include <stdio.h>#include <math.h>int main(){ double ti……
3059: 开餐馆 DP DP DP DP
摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"
using namespace std;
int t,n,k,m[110],p[110],dp[1100];
int……
递归7行解决猴子吃桃
摘要:参考代码:n=eval(input())def peach(m): if m==n: return 1 else: return 2*(peach(m+1)+1……
数据结构-链表的基本操作--C语言
摘要:解题思路:保存题解注意事项:需要确保即使初始元素数量为 0,链表仍然有一个有效的头结点。这样可以避免在后续操作中因为 L 为 NULL 而导致的问题参考代码:#include <stdio.h>
#……
字符菱形的c语言解法
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ char a; scanf("%c",&a); printf( " %c \n %c%c%……