1501: 蓝桥杯算法提高VIP-分苹果 这道题考察前缀和,差分-前缀和数组:定义一个数组,该数组记录了数列的前x个值的和-例如数列12345,前缀和数组为a[N]那么a[1]=1,a[2]=1+2,a[3]=1+2+3......a[5]=1+2+3+4+5如果要求[2,3]区间的和, 题解列表 2024年10月25日 0 点赞 4 评论 500 浏览 评分:0.0
DP入门 # 2809: 菲波那契数列 ```//注意这道题第一下项的下标为0,所以我们最后输出的是dp[n-1]#include#include#include#includeusingnamespacestd;constintN=50;intdp[N];intmain(){intk;cin>>k;if(k 题解列表 2024年10月25日 1 点赞 0 评论 577 浏览 评分:0.0
优质裁缝题解 摘要:#include int main() { int n; scanf("%d", &n); int sum = 0; int ok = 0; int val = 0; fo…… 题解列表 2024年10月25日 0 点赞 0 评论 420 浏览 评分:0.0
2016: 新生的入队仪式 摘要:#include int main() { long long n, m; scanf("%lld %lld", &n, &m); long long ok1 = 0,ok2=0; …… 题解列表 2024年10月25日 0 点赞 0 评论 340 浏览 评分:0.0
用啥写都一样 摘要:解题思路:e......注意事项:无参考代码:print(''' ******** ************ …… 题解列表 2024年10月25日 1 点赞 0 评论 704 浏览 评分:0.0
ctype优质实现 摘要:#include #include int main() { char ch; int ss=0,tt = 0; while (isalpha(ch = getchar())&&ch…… 题解列表 2024年10月25日 0 点赞 0 评论 372 浏览 评分:0.0
题解有点复杂(实际就是我太菜了),还是看看我这个小佝偻的吧 #include#includeusingnamespacestd;typedefpairPII;constintN=101;PIIarr[N];//存储数组;intn;doublew;intmain(){scanf("%d",&n);ints;doublea, 题解列表 2024年10月25日 0 点赞 4 评论 802 浏览 评分:9.9
Python "结构体"的多参数排序 fromfunctoolsimportcmp_to_keydefcmp(a,b):ifa[3]5:forjinrange(5):print(peoples[j][4],end="")print(peoples[j][3])else:forkinrange(n):print(peoples[k][4], 题解列表 2024年10月25日 0 点赞 0 评论 492 浏览 评分:9.9
1316: 最长不下降子序列的长度 摘要:解题思路:注意事项:参考代码:n = int(input())l = list(map(int,input().split()))memo = {}def find(i): if i in me…… 题解列表 2024年10月25日 0 点赞 0 评论 475 浏览 评分:0.0
生日蛋糕问题用c++来实现 解题思路:1:我们将蛋糕的每一层看作是一个圆柱体,并且用半径R和高度H来描述。2:通过给定的蛋糕体己N和层数M,我们需要找到一种制作方案,来使得蛋糕的外表面积最小。注意事项:1:在编写代码时,要注意变量的命名和初始化2:剪枝时要分析各种情况, 题解列表 2024年10月25日 0 点赞 3 评论 730 浏览 评分:9.0