校门外的树-题解(C语言代码) 摘要: #include int main() { int L=0,M=0; int a=0,b=0;//输入的地铁段 int i=0,nu…… 题解列表 2020年05月03日 0 点赞 1 评论 641 浏览 评分:9.3
校门外的树-题解(C++代码) 摘要:```cpp #include using namespace std; int main() { int L,M; int a,b; int num[10002]; …… 题解列表 2020年04月19日 0 点赞 0 评论 629 浏览 评分:6.5
校门外的树-题解(C++代码) 摘要:```cpp #include #include #include #include #include using namespace std; const int MAXN=1e4…… 题解列表 2020年04月05日 0 点赞 0 评论 545 浏览 评分:9.9
校门外的树-题解(C语言代码):初始化问题的猜想 摘要: #include int main() { int L,M,i; int start,final; //起点start,终点final。 scanf("%d %d",&…… 题解列表 2020年03月27日 0 点赞 0 评论 560 浏览 评分:0.0
校门外的树 (C++详细代码)思路清晰,容易懂; 摘要:###[1099:校门外的树](https://www.dotcpp.com/oj/problem1099.html "1099:校门外的树") ####题目描述 某校大门外长度为L的马路上有一排…… 题解列表 2020年03月26日 0 点赞 0 评论 2170 浏览 评分:8.9
校门外的树-题解(C语言代码) 摘要: 思路:用数组来表示L这条路,并初始化为0; 接下来对每组数据,根据两个数据所在的区间,重复把这个区间的值设为不为0的数。 最后统计剩余的0的个数。 避坑;1、由于L路的0位置也有树,…… 题解列表 2020年03月26日 0 点赞 0 评论 373 浏览 评分:0.0
校门外的树-题解(C语言代码) 摘要:```c #include #include int l,m; int main() { scanf("%d%d",&l,&m); int i,j; int s[m][2];…… 题解列表 2020年03月04日 0 点赞 0 评论 435 浏览 评分:6.0
校门外的树 (C++代码)------两种解法,复杂点的“并查集”和简单的“数组标记” 摘要: 对于这道题有鄙人这里陈述两种解法****** 第一种复杂,第二种简单,没学过并查集的同学可以看第二种。 第一种是“并查集”,这种解法有点复杂,“并查集的思想”是把相互…… 题解列表 2020年02月20日 0 点赞 1 评论 373 浏览 评分:6.0
校门外的树-题解(C语言代码)(数组模拟种树) 摘要:****题中说从数轴0开始到L都种一棵树,但是有因为建地铁把一些树拔掉,那么我们可不可以用某种方式表示我们已经种好了全部树,并且通过改变数字表示树被拔掉了。 数轴从0到L一共有L+1棵树,是不是和数…… 题解列表 2020年02月17日 0 点赞 0 评论 1063 浏览 评分:8.0
校门外的树 (Python代码) 摘要:1,这个题目如果用数组来做,及有树代表1,无树代表0,很好解题,但是我尝试了一下,提示报错“超出限制”,所有我用了另外一种方式。 2,将两个有重复的区域合并为一个区域,及最后只需要计算不包含的区域的…… 题解列表 2020年02月13日 0 点赞 0 评论 1189 浏览 评分:7.7