EOJ 1076 纯粹好玩 输入各种重定向
来源:互联网 发布:安卓上玩的编程游戏 编辑:程序博客网 时间:2024/06/02 03:01
#include<string.h>#include<iostream>#include<stdio.h>using namespace std;template<class T> inline T& RD(T &x){ char c; for (c = getchar(); c < '0'; c = getchar()); x = c - '0'; for (c = getchar(); '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0'; return x;}int q[100003]={0};int main(){std::ios::sync_with_stdio(false);int n,m;int a,b,i,k;while (RD(n)&&n){m=n;memset(q,0,sizeof(q));RD(a),RD(b);++q[a];--q[b+1];while (--n){RD(a),RD(b);++q[a];--q[b+1];}cout<<q[1];k=0;k+=q[1];for (i=2;i<=m;++i){k+=q[i];cout<<' '<<k;}cout<<endl;}return 0;}