hdu 1556 Color the ball(水题)
来源:互联网 发布:mysql Delete 与drop 编辑:程序博客网 时间:2024/06/05 11:13
题目链接:hdu 1556 Color the ball
题目大意:略。
解题思路:用个数组维护即可。
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int maxn = 100000;int N, c[maxn + 5];int main () { while (scanf("%d", &N) == 1 && N) { int l, r; memset(c, 0, sizeof(c)); for (int i = 0; i < N; i++) { scanf("%d%d", &l, &r); c[l]++; c[r+1]--; } int mv = 0; for (int i = 1; i <= N; i++) { mv += c[i]; printf("%d%c", mv, i == N ? '\n' : ' '); } } return 0;}
0 0
- hdu 1556 Color the ball(水题)
- hdu 1556 color the ball
- hdu 1556Color the ball
- HDU 1556 - Color the ball
- Hdu 1556 Color the ball
- hdu 1556 Color the ball
- hdu 1556 Color the ball
- hdu 1556 Color the ball
- hdu 1556 Color the ball
- hdu 1556 Color the ball
- hdu 1556 Color the ball
- HDU 1556 Color the ball
- HDU 1556 Color the ball
- HDU 1556 Color the ball
- HDU 1556 Color the ball
- HDU 1556 Color the ball
- HDU 1556 Color the ball
- HDU 1556 Color the ball
- Mac 10.10开发工具的修复
- linux rhel 6.5(32位)下 oracle 11g R2 安装出现问题
- springMVC框架搭建流程
- Unity3D研究院之Android全自动打包生成apk
- JavaScript实现全选,伸展收缩
- hdu 1556 Color the ball(水题)
- 广告推荐系统--初探
- 内网ip
- IdCardValidateTest
- 第九周项目三:程序填充题(2)
- 深入理解计算机系统家庭作业第五章
- Unity3D研究院之IOS&Android收集Log文件
- IdCardValidate
- Eclipse连接真机测试 出现unknown daemon not running. starting it now on port 5037 ADB server didn't ACK