通俗易懂解法 摘要:解题思路:这里要注意到500,其实一共有501棵树,总数等于a+1(L+1)参考代码:#include<iostream>#include<algorithm>…… 题解列表 2025年10月08日 1 点赞 0 评论 502 浏览 评分:0.0
c++差分数组解法 解题思路:这题用数组标记法是可以做的,但可以进一步来降低时间复杂度,不难看出数组标记法中,每一步中都需要对区间内赋值为1,这一步与给区间内加上一个增量的操作等价,可以使用差分数组。这里给小白科普一下差分数组:给定数组a[],需要在某个区间[l,r]内的所有元素增加一个常量值v。 题解列表 2025年04月26日 2 点赞 0 评论 614 浏览 评分:10.0
C++:map容器简单使用方法_练习 解题思路:把每一个坐标元素都放进一个数组中间,并且进行初始化,已经区域就改变赋值,如果在最后遍历数组的时候发现初始化的赋值被改变了,就跳过,没改变就记录。注意事项:把map容器当成普通数组使用,特殊的是内存可变化,需要多少内存,拿多少//mapmp;//创立一个位置【键, 题解列表 2025年03月07日 1 点赞 0 评论 655 浏览 评分:10.0
编写题解 1099: 校门外的树C++ ```cpp#include/*文件头可以随便,我喜欢万能头,这里也可以(注意有memset函数,要用cstring库):#include#include*/usingnamespacestd;intmain(){intL[10001],a, 题解列表 2024年11月26日 7 点赞 1 评论 1218 浏览 评分:8.0
1099: 校门外的树 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int L,M; cin>>L>>M; …… 题解列表 2024年11月07日 1 点赞 0 评论 557 浏览 评分:0.0
1099校门外的树(数组解决) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int m;//马路长度 int n;//组数 cin >> m >>…… 题解列表 2024年05月31日 0 点赞 0 评论 697 浏览 评分:0.0
1099: 校门外的树 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>typedef long long ll;const int N=1e7;using namespace std;int …… 题解列表 2024年05月04日 1 点赞 0 评论 495 浏览 评分:10.0
1099: 校门外的树 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>typedef long long ll;const int N=1e7;using namespace std;int …… 题解列表 2024年04月27日 0 点赞 0 评论 399 浏览 评分:2.0
1099: 校门外的树 摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;typedef long long ll;const ll N=1e5;//太大会爆ll a…… 题解列表 2024年04月22日 0 点赞 0 评论 520 浏览 评分:0.0
题解 1099: 校门外的树 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const ll N=1e5+5;int…… 题解列表 2024年04月21日 0 点赞 0 评论 468 浏览 评分:9.9