九度 1088剩下的树
来源:互联网 发布:简单特效制作软件 编辑:程序博客网 时间:2024/04/27 13:22
题目
标记法
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int tree[10010]; int main(){ int n,m,s,a,b; while(~scanf("%d%d",&n,&m)){ memset(tree,0,sizeof(tree)); for(int i=0;i<m;i++){ scanf("%d%d",&a,&b); for(int j=a;j<=b;j++){ tree[j]=1; } } s=0; for(int i=0;i<=n;i++){ if(tree[i]) s++; } printf("%d\n",n+1-s); } return 0;}
0 0
- 九度OJ 1088: 剩下的树
- 九度题目1088:剩下的树
- 九度题目1088:剩下的树
- 九度oj 1088剩下的树
- 九度OJ 1088 剩下的树
- 九度1088:剩下的树
- 九度 1088剩下的树
- 九度oj-1088-剩下的树
- 九度-题目1088:剩下的树
- 九度1088 剩下的树
- 九度OJ-1088剩下的树
- 九度OJ-1088:剩下的树
- 九度OJ 1088:剩下的树 (线段树)
- 九度OJ—题目1088:剩下的树
- 九度OJ 题目1088:剩下的树
- 九度OJ 题目1088:剩下的树
- 九度1088——剩下的树
- 九度oj题目1088:剩下的树解题报告
- HDU_1421DP
- service基础
- 大整数的乘法
- Go语言怎样生成Controller
- 【BZOJ2668】【cqoi2012】交换棋子 费用流
- 九度 1088剩下的树
- C语言动态内存分配
- 【Tools.Eclipse】 64位系统下同时使用64位和32位的eclipse
- JAVA学习笔记(三十八)- 创建实现Runnable接口的线程
- Android Matrix
- poj1131 高精度
- hihocoder#1128之非有序数组二分查找
- vim的命令
- Java NIO与IO的详细区别(通俗篇)