题意:有一条上面有n个点的数轴,给定m次操作,每次覆盖(x[i],y[i]),求最后没有被覆盖过的点的数量与他们的编号

n,m<=100

思路:

 #include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef vector<int> VI;
#define fi first
#define se second
#define MP make_pair const int N=;
int a[N],n,m; int read()
{
int v=,f=;
char c=getchar();
while(c<||<c) {if(c=='-') f=-; c=getchar();}
while(<=c&&c<=) v=(v<<)+v+v+c-,c=getchar();
return v*f;
} int main()
{
//freopen("1.in","r",stdin);
//freopen("1.out","w",stdout);
scanf("%d%d",&n,&m);
for(int i=;i<=n;i++)
{
int x,y;
scanf("%d%d",&x,&y);
for(int j=x;j<=y;j++) a[j]=;
}
int ans=;
for(int i=;i<=m;i++) ans+=a[i];
printf("%d\n",m-ans);
for(int i=;i<=m;i++)
if(!a[i]) printf("%d ",i);
return ;
}

最新文章

  1. Jquery Mobile中pageinit等函数执行两次的问题【终极解决】
  2. jQuery的常用事件
  3. Linux suse x86_64 环境上部署Hadoop启动失败原因分析
  4. (转)数据库SQL优化大总结之 百万级数据库优化方案
  5. struts2_4_为Action属性注入值
  6. 震荡信号Simulink仿真
  7. javamail发邮件
  8. hdu3944
  9. 【中间件安全】IIS6安全加固规范
  10. centos 7 查询mysql 安装 运行位置
  11. 使用PsExec获取shell执行命令
  12. laravel中artisan的用法
  13. 本地项目 共享 到github仓库
  14. IIS7.5中调试.Net 4.0网站出现无厘头500错误的解决办法 (转)
  15. Apache Spark Exception in thread “main” java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
  16. TFS对签入文件忽略设置,解决pdb弹出警告
  17. Java的BIO,NIO,AIO
  18. 解决新版本webpack vue-cli生成文件没有dev.server.js问题
  19. Makefile生成器,使用C++和Boost实现
  20. Cassandra 在CQL中使用函数

热门文章

  1. inner join 和 left join 的区别
  2. 01_4_SERVLET声明周期
  3. NSOperation、NSOperationQueue
  4. LeetCode935
  5. Laravel核心解读--Console内核
  6. 有关git clone 下载速度变慢的解决方法
  7. perl-tips-1
  8. nrf开发笔记一开发软件
  9. PAT Basic 1073
  10. 像玩魔兽一样编程——谈VS2010键盘流