蓝桥杯算法提高VIP-分苹果 (Java代码) 摘要:解题思路: 第n个位置的数据 = 第n-1位置的数据 + 两者数据差注意事项:参考代码: import java.util.Scanner; public class C1501 { …… 题解列表 2018年03月16日 0 点赞 0 评论 881 浏览 评分:0.0
蓝桥杯算法提高VIP-分苹果 (C++代码) 摘要:#include<iostream> #include<algorithm> using namespace std; const int maxn = 100001; int A[maxn]…… 题解列表 2019年03月05日 0 点赞 0 评论 493 浏览 评分:0.0
差分数组解分苹果问题 摘要:#include <stdio.h>int d[100005]; //d[i]表示第i个小朋友比第i-1个小朋友多的苹果int main(){ int m,n,i,Li,Ri,Ci; sc…… 题解列表 2022年02月10日 0 点赞 0 评论 174 浏览 评分:0.0
蓝桥杯算法提高VIP-分苹果 (C++代码)(线段树 lazy 练习) 摘要:解题思路: ( 反正没人看,注释不想写,写花了更难看,跑得挺慢的参考代码:#include<bits/stdc++.h> using namespace std; const i…… 题解列表 2018年08月02日 0 点赞 0 评论 782 浏览 评分:0.0
蓝桥杯算法提高VIP-分苹果 (C语言代码)(树状 + 差分) 摘要:#include <iostream> #include <stdio.h> #include <map> #include <vector> #include <algorithm> #i…… 题解列表 2018年09月04日 0 点赞 0 评论 850 浏览 评分:0.0
python-蓝桥杯算法提高VIP-分苹果 摘要:解题思路:思路参考的大佬的思路,采用了差分法。说一下自己对这个方法的理解。①建立一个数组dis[n+2],里面存储的值是每个小朋友与上一个小朋友手里的苹果的差值,初始化值为0。 每发一次苹果, …… 题解列表 2022年01月18日 0 点赞 0 评论 397 浏览 评分:0.0
蓝桥杯算法提高VIP-分苹果-题解(C语言代码) 摘要:## 解题思路: 根据题意:第i个老师会给第Li个到第Ri个,一共Ri-Li+1个小朋友每人发Ci个苹果。可以列出 ``` scanf("%d%d%d",&Li,&Ri,&Ci); …… 题解列表 2020年07月13日 0 点赞 0 评论 365 浏览 评分:2.0
蓝桥杯算法提高VIP-分苹果-题解(Python代码) 超时 评分60% 摘要:```python #超时 评分60% n,m = map(int,input().split()) student = [0] * n #student --> [0,0,0,0,0] a…… 题解列表 2020年02月09日 0 点赞 5 评论 876 浏览 评分:6.0
求大佬解答,时间超限,所以怎么能缩短一下时间(C语言) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int shu1,shu2,shu3,i,j,lao,xue; int a[100001]={0}; scanf…… 题解列表 2019年03月11日 0 点赞 0 评论 1178 浏览 评分:6.0
优质题解 WU-蓝桥杯算法提高VIP-分苹果 (C++代码)(线段树) 摘要:解题思路:这个题解是我从博客上摘抄下来的 和大家一起分享 这个题目用到了线段树的知识 因为用普通的循环 我们得到的时间复杂度为O(m*n) 肯定会超时 这个题目比较复杂 我写的也不是…… 题解列表 2017年12月15日 11 点赞 12 评论 2480 浏览 评分:8.5