• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 16,comments - 0,trackbacks - 0
            ?1?#?include?<cstdio>
            ?2?#?include?<cstring>
            ?3?#?include?<algorithm>
            ?4?using?namespace?std;
            ?5?
            ?6?#?define?B?100005
            ?7?#?define?N?100005
            ?8?
            ?9?struct?Intv?{int?s,?e;};
            10?
            11?Intv?c[N];
            12?int?n,?a[B],?r[N],?le[N];
            13?
            14?bool?cmp(const?int?x,?const?int?y)
            15?{
            16?????????????????if?(c[x].s?==?c[y].s)?return?c[x].e?>?c[y].e;
            17?????????????????return?c[x].s?<?c[y].s;
            18?}
            19?/**************************************************/
            20?int?getsum(int?x)
            21?{
            22?????????????????int?ret?=?0;
            23?????????????????while?(x?>?0)?ret?+=?a[x],?x?-=?x&(-x);
            24?????????????????return?ret;
            25?}
            26?void?inc(int?x)
            27?{
            28?????????????????while?(x?<=?B)?++a[x],?x?+=?x&(-x);
            29?}
            30?/**************************************************/
            31?int?main()
            32?{
            33?????????????????int?i,?n,?x;
            34?
            35?????????????????while?(scanf("%d",?&n),?n)
            36?????????????????{
            37?????????????????????????????????memset(a,?0,?sizeof(a));
            38?????????????????????????????????for?(i?=?0;?i?<?n;?++i)
            39?????????????????????????????????????????????????r[i]?=?i,?scanf("%d%d",?&c[i].s,?&c[i].e);
            40?????????????????????????????????sort(r,?r+n,?cmp);
            41?????????????????????????????????for?(i?=?0;?i?<?n;?++i)
            42?????????????????????????????????{
            43?????????????????????????????????????????????????x?=?c[r[i]].e?+?1,?inc(x);
            44?????????????????????????????????????????????????if?(i?&&?c[r[i]].e==c[r[i-1]].e?&&?c[r[i]].s==c[r[i-1]].s)
            45?????????????????????????????????????????????????????????????????le[r[i]]?=?le[r[i-1]];
            46?????????????????????????????????????????????????else
            47?????????????????????????????????????????????????????????????????le[r[i]]?=?i-getsum(x-1);
            48?????????????????????????????????}
            49?????????????????????????????????for?(i?=?0;?i?<?n;?++i)
            50?????????????????????????????????{
            51?????????????????????????????????????????????????if?(i)?putchar('?');
            52?????????????????????????????????????????????????printf("%d",?le[i]);
            53?????????????????????????????????}
            54?????????????????????????????????putchar('\n');
            55?????????????????}
            56?
            57?????????????????return?0;
            58?}
            59?
            posted on 2012-09-02 11:51 yajunw 閱讀(129) 評論(0)  編輯 收藏 引用
            国产成人精品综合久久久| 91久久国产视频| 国产精品久久新婚兰兰| 亚洲国产欧洲综合997久久| 久久综合给合久久国产免费| 国产91色综合久久免费分享| 久久亚洲高清综合| 国产精品免费福利久久| 亚洲欧美一级久久精品| 久久久久久人妻无码| 香蕉久久永久视频| 91久久精品电影| 久久人爽人人爽人人片AV| 国产精品伦理久久久久久| 久久香综合精品久久伊人| 欧美久久综合九色综合| 999久久久无码国产精品| 精品国产乱码久久久久久人妻| 精品久久久久中文字幕日本| 理论片午午伦夜理片久久| 久久久精品免费国产四虎| 欧美日韩精品久久免费| 欧美久久一级内射wwwwww.| 996久久国产精品线观看| 中文字幕无码免费久久| 亚洲精品99久久久久中文字幕| 国产成人无码精品久久久久免费 | 伊人久久成人成综合网222| 曰曰摸天天摸人人看久久久| 久久精品国产亚洲av日韩| 日韩中文久久| 亚洲国产二区三区久久| 久久国产精品成人片免费| 亚洲伊人久久大香线蕉综合图片| 性做久久久久久久久| 日本精品久久久久久久久免费| 欧美国产成人久久精品| 看全色黄大色大片免费久久久 | 亚洲午夜精品久久久久久人妖| 久久婷婷五月综合色高清| 久久99精品久久久久久动态图 |