题解 1099: 校门外的树

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

校门外的树 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include "stdio.h"int main(int argc, char* argv[]){ int a[100][2],b[10000],L,M,i,j,k,……

校门外的树 (C语言代码)

摘要:解题思路:删去所以车段的交集,每个车段需要“砍树”为:(末-起+1),原本可以植树总共为 :(l+1),结果是:(总-砍)注意事项:参考代码:#include<stdio.h>#define M 10……

校门外的树 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>                      int main()                             {      …

校门外的树 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int L,M; cin>>L>>M; int qishi[100],……

校门外的树 (C语言代码)

摘要:解题思路:我们只需要用数组模拟一下即可。参考代码:#include <stdio.h> #include <string.h> int main() {     int l, m;     ……

校门外的树 (C语言代码)

摘要:解题思路:定义数组表示树,初始化为0,若被挖去,则赋值为1,最后统计数组中1的个数。注意事项:参考代码:#include<stdio.h>int main(){    int *a;    int l……

校门外的树 (C语言代码)

摘要:解题思路:设一个长度为L+1的数组,将每个元素赋值为1,将要毁掉的区域(对应数组的区域)赋值为0,然后统计还剩下几个1即可注意事项:参考代码:#include <stdlib.h>#include <……

校门外的树 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int L,M,i,a,b,s[10001],count=0; scanf("%d %d",&L,&M); fo……

校门外的树 (C语言代码)

摘要:解题思路:要注意输入M组区间时是分步进行M次操作(移出)的。注意事项:参考代码:#include<stdio.h>int main(){     int i,j,L,M,s,e,count=0;   ……

NINA-题解1099:校门外的树 (C语言代码)

摘要:解题思路:建立数组tree,全部赋值为0,表示有树;接下来每输入一组始末点,则将这范围内的tree置为1,表示没有树;完成后统计数组tree中为0的值的个数。注意事项:题目要求1<=L<=10000;……