sicily--1145. 校门外的树
来源:互联网 发布:js的面向对象 编辑:程序博客网 时间:2024/05/22 23:13
一开始没看到起点是0就 WA 了2次,其余没什么了
#include<iostream>#include<cstring>using namespace std;int main(){int tree[10001];//奢侈点,哈哈memset(tree, 0, sizeof(tree));//1表示种有树int length, num;cin >> length >> num;for(int i = 0; i <= length;i++){tree[i] = 1;}for(int j = 0; j < num; j++){int start, end;cin >> start >> end;for(int k = start; k <= end; k++){tree[k] = 0;}}int sum = 0;//表示最终剩余的树for(int j = 0; j <= length; j++)sum = sum + tree[j];cout << sum << endl;return 0;}
- sicily--1145. 校门外的树
- Sicily 1145. 校门外的树
- sicily 1145.校门外的树
- Sicily 1145. 校门外的树
- [sicily]1145. 校门外的树
- sicily 1145. 校门外的树
- sicily可供练习题-1145. 校门外的树
- Sicily 1145 校门外的树
- Sicily 1145 校门外的树
- Sicily 1145 校门外的树
- Sicily 1145 校门外的树
- 1145. 校门外的树
- 1145. 校门外的树
- 校门外的树
- 校门外的树
- 校门外的树
- 校门外的树
- 校门外的树
- Git patch
- C#中在内容页获取其模板页中的变量,或者值
- 测试flash之小工具
- Linux C substring 子字符串
- poj 3414 Pots
- sicily--1145. 校门外的树
- 查看sql语句执行效率
- log4j和slf4j
- android 调用系统相机拍照 获取原图
- 值得思考的事(Linux)
- HTML5移动Web开发指南
- android adb 命令
- snprintf函数
- CSS中 ID和CLASS的区别