P1047
2024-10-01 07:57:55
题目不难。。。但坑得是数据大小。。N 的大小越大越好。。。
#include <bits/stdc++.h>
#include <cstdio>
#include <cmath>
#define rep(i, a, b) for(int i = a; i <= b; i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
int gcd(int a, int b){return b == 0 ? a : gcd(a%b, a);}
const int N = 10011;
int main()
{
int L, M, a, b, c[N];
scanf("%d %d", &L, &M);
rep(i, 0, L) c[i] = 1;
while(M--)
{
scanf("%d %d", &a, &b);
rep(i, a, b) c[i] = 0;
}
c[10010] = 0;
rep(i, 0, L) c[10010] += c[i];
printf("%d\n", c[10010]);
return 0;
}
最新文章
- jquery.min.map 404 (Not Found)出错的原因及解决办法
- javascript事件监听与事件委托
- Gym 100851K
- Golang tips ----- 函数
- 【转】pageX、clientX、screenX、offsetX、layerX、x
- easyVS
- asp动态生成google的sitemap地图的代码
- 《RESTful Web Services》第一章 使用统一接口
- VM虚拟机上 实现CentOS 6.X下部署LVS(NAT)+keepalived实现高性能高可用负载均衡
- BZOJ 2661 连连看
- python2与python3
- EF OrderBy(string propertyname), OrderByDescending(string propertyname) 按属性排序,扩展方法
- java 使用对象
- About the diffrence of wait timed_wait and block in java
- 蓝桥杯-算法训练--ALGO-8 操作格子
- js的call和apply拾遗
- BZOJ4870: [Shoi2017]组合数问题
- URL中包含url参数,(文件路径作为参数)
- 【1】JDK8 HashMap扩容优化
- pronaunciation