Color the ball [HDU 1556]
2013-05-06 19:43
309 查看
http://acm.hdu.edu.cn/showproblem.php?pid=1556
View Code
View Code
//区间标记, 当然对于任意修改都能做 const int MM = 111111; #define debug puts("wrong") const double lep=1e-10; int N,num[MM]; void solve() { int i,j,k,x,y; memset(num,0,sizeof(num)); for(i=0;i<N;i++) { scanf("%d%d",&x,&y); num[x]++, num[y+1]--; } int ans=num[1]; printf("%d",ans); for(i=2;i<=N;i++) { ans+=num[i]; printf(" %d",ans); } printf("\n"); } int main() { while(scanf("%d",&N),N) solve(); return 0; }
相关文章推荐
- 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(树状数组)
- hdu 1556 Color the ball
- HDU 1556 Color the ball
- HDU - 1556 Color the ball(树状数组 or 线段树)
- hdu 1556 Color the ball (树状数组)
- hdu 1556 Color the ball(非线段树做法)