POJ 2665 Trees(水题)
来源:互联网 发布:vs2010写c语言 编辑:程序博客网 时间:2024/05/29 12:16
【题意简述】:就是有一段路上有和长度加一的值相等的数目,现在要在这条路上修路,所以要砍掉一些树,问剩下了多少树。
【分析】:很简单,注意一的处理就好。
//216K 79Ms#include<iostream>using namespace std;int main(){int len,n,s,e;while(cin>>len>>n){int sum = 0;if(len == 0&&n == 0)break;for(int i = 0;i<n;i++){cin>>s>>e;sum+=e-s+1;//注意+1 }cout<<len+1 - sum<<endl;}return 0;}
0 0
- POJ 2665 Trees(水题)
- POJ 2665 Trees(水~)
- POJ 2665 Trees
- POJ 2665 Trees
- poj 2665 Trees
- POJ 2665 Trees 水
- POJ 2665 Trees G++
- 2665 Trees 水题
- POJ 2665 Trees(我的水题之路——移树,POJ100题啦!)
- POJ 1610 Quad Trees
- 【POJ 1105 S-Trees】
- POJ 2029 Get Many Persimmon Trees (二维树状数组)
- POJ 1095 Trees Made to Order(计数问题)
- POJ 2029 Get Many Persimmon Trees(二维BIT)
- POJ 题目1105 S-Trees(二叉树模拟)
- POJ-2029 Get Many Persimmon Trees(动态规划)
- POJ 2029 Get Many Persimmon Trees(二维树状数组)
- 【POJ 2029】 Get Many Persimmon Trees(DP)
- 重写equals和 toString方法
- nginx支持HLS 起始篇
- [Swift] 快速预览及解释 (二 简单值类型)
- C++_引用
- 3D游戏引擎一 win32编程
- POJ 2665 Trees(水题)
- 【实用方法】CentOS Linux 升级内核
- JavaScript 中2个等号与3个等号的区别
- @RenderBody()和@RenderSection()
- CSS基础
- Android之内存泄漏调试学习与总结
- 内存的划分
- SuSE linux NFS挂载失败案例处理:mount.nfs: access denied
- 环境: osgEarth 依赖库下载地址(gdal, geos, SQLite, zip, zlib, proj4)