青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

ACM___________________________

______________白白の屋
posts - 182, comments - 102, trackbacks - 0, articles - 0
<2010年8月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234

常用鏈接

留言簿(24)

隨筆分類(332)

隨筆檔案(182)

FRIENDS

搜索

積分與排名

最新隨筆

最新評論

閱讀排行榜

評論排行榜

MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋    

 

題目地址:

    http://acm.hdu.edu.cn/showproblem.php?pid=1541 

題目描述:

Stars

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 857    Accepted Submission(s): 320


Problem Description
Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star. Astronomers want to know the distribution of the levels of the stars. 



For example, look at the map shown on the figure above. Level of the star number 5 is equal to 3 (it's formed by three stars with a numbers 1, 2 and 4). And the levels of the stars numbered by 2 and 4 are 1. At this map there are only one star of the level 0, two stars of the level 1, one star of the level 2, and one star of the level 3. 

You are to write a program that will count the amounts of the stars of each level on a given map.
 

Input
The first line of the input file contains a number of stars N (1<=N<=15000). The following N lines describe coordinates of stars (two integers X and Y per line separated by a space, 0<=X,Y<=32000). There can be only one star at one point of the plane. Stars are listed in ascending order of Y coordinate. Stars with equal Y coordinates are listed in ascending order of X coordinate.
 

Output
The output should contain N lines, one number per line. The first line contains amount of stars of the level 0, the second does amount of stars of the level 1 and so on, the last line contains amount of stars of the level N-1.
 

Sample Input
5 1 1 5 1 7 1 3 3 5 5
 

Sample Output
1 2 1 1 0
 

題目分析 :

   題目的意思就是計算 星星的左下角 ( 包括 正左, 正下 ) 有多少顆其他的星星, 左下角星星的個數就是這個星星的等級,  題目要求輸出每個等級星星的個數. 

   具體做法:   另外開個數組存儲星星的等級,比他小的數的個數作為下標,即等級,每出現一次,數組加一,com數組的大小即為它存儲數據的最大值。 

代碼如下 :

 

 /*

MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

          http://www.cnblog.com/MiYu

Author By : MiYu

Test      : 1

Program   : 1541

*/


#include <iostream>

using namespace std;

const int MAX = 32005;

#define lowbit(x) ((x)&(-x))

int com[MAX], res[MAX], N;

void modify ( int pos, int val ){

     while ( pos <= MAX ){

            com[pos] += val;

            pos += lowbit(pos);  

     } 

}

int quy ( int x ){

    int sum = 0;

    while ( x > 0 ){

           sum += com[x];

           x -= lowbit(x);

    } 

    return sum;

}

int main (int x)

{

    while ( scanf ( "%d",&N ) != EOF ){

            memset ( com,0,sizeof (com) ); memset ( res,0,sizeof (res) );

            for ( int i = 1; i <= N; ++ i ){

                  scanf ( "%d%*d", &x ); 

                  x++;

                  res[ quy(x) ] ++;  modify ( x,1 );

            }

            for ( int i = 0; i < N; ++ i )

                  printf ( "%d\n",res[i] );

    }

    return 0;

}


 

 

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲国产一区二区三区高清| 久久亚洲高清| 99re6这里只有精品| 欧美欧美在线| 亚洲在线观看| 欧美一区二区视频在线观看2020| 韩国在线视频一区| 91久久久久| 国产精品久久亚洲7777| 久久亚洲风情| 欧美日韩精品一区二区三区| 午夜精品亚洲| 久久综合九色九九| 亚洲一区二区三区免费视频| 久久福利毛片| aaa亚洲精品一二三区| 亚洲男女自偷自拍| 亚洲电影免费在线| 一区二区久久久久| 亚洲高清在线观看| 一区二区三区免费网站| 亚洲成人在线| 亚洲欧美清纯在线制服| 亚洲激情婷婷| 午夜精品一区二区三区四区| 亚洲精品乱码久久久久久久久| 中文精品视频一区二区在线观看| 极品少妇一区二区三区精品视频| 99re热这里只有精品免费视频| 精品成人在线| 亚洲性夜色噜噜噜7777| 亚洲欧洲一级| 久久久精彩视频| 亚洲欧美日韩国产一区| 欧美国产精品日韩| 麻豆成人av| 国产欧美一区二区精品忘忧草| 91久久精品日日躁夜夜躁欧美 | 亚洲精品日韩在线观看| 一区二区在线看| 欧美一区高清| 午夜免费电影一区在线观看| 欧美激情无毛| 亚洲国产福利在线| 亚洲高清中文字幕| 久久久久久亚洲精品杨幂换脸| 欧美在线3区| 国产精品一香蕉国产线看观看| 亚洲精品无人区| 亚洲精品一二三| 欧美mv日韩mv国产网站| 欧美成人午夜激情在线| 在线免费观看一区二区三区| 久久精品国产2020观看福利| 久久精品日韩欧美| 国产一区二区三区在线播放免费观看 | 欧美视频在线观看视频极品 | 亚洲欧美日韩在线不卡| 欧美日韩亚洲综合| 一本色道88久久加勒比精品 | 午夜激情综合网| 国产精品美女久久久浪潮软件 | 亚洲欧美国产日韩天堂区| 亚洲欧美国产毛片在线| 国产精品久久99| 亚洲综合首页| 久久青青草综合| 亚洲电影下载| 欧美久久久久久久久久| 日韩视频三区| 羞羞漫画18久久大片| 国产欧美韩日| 久久久噜噜噜久久中文字幕色伊伊| 久久久久久国产精品mv| 激情综合网址| 欧美人交a欧美精品| 中文一区二区在线观看| 久久精品91久久久久久再现| 在线看国产日韩| 欧美国产欧美亚洲国产日韩mv天天看完整 | 久久亚洲私人国产精品va媚药 | 欧美性开放视频| 欧美一区二区三区男人的天堂| 美女精品在线观看| 亚洲久久成人| 国产精品视频yy9299一区| 久久国产主播| 亚洲精品一区二区三区不| 亚洲欧美国产高清| 亚洲国产mv| 欧美在线在线| 亚洲精品一区二区三区四区高清 | 一区二区三区福利| 国产欧美日本| 欧美裸体一区二区三区| 亚洲自拍偷拍色片视频| 欧美福利精品| 欧美一区二区三区视频| 91久久久一线二线三线品牌| 国产精品日韩在线一区| 欧美黄色免费网站| 西西人体一区二区| 亚洲精选91| 久久网站热最新地址| 一区二区三区**美女毛片 | 国产精品久久久爽爽爽麻豆色哟哟| 欧美有码在线观看视频| 日韩视频一区二区三区在线播放| 久久婷婷影院| 久久国产视频网| 一本色道久久综合亚洲精品小说| 国产一区二区三区四区在线观看| 欧美日韩成人在线视频| 美国三级日本三级久久99| 亚洲一区二区久久| 亚洲精品视频在线播放| 美女在线一区二区| 久久久久.com| 欧美亚洲免费电影| 亚洲一区二区精品在线观看| 亚洲另类视频| 亚洲黄色在线视频| 在线国产欧美| 一区二区视频欧美| 亚洲国产一区在线观看| 免费不卡亚洲欧美| 久久久精品日韩欧美| 欧美一区二区啪啪| 亚洲在线免费观看| 亚洲在线视频网站| 亚洲一区在线直播| 亚洲欧美国产高清va在线播| 国产精品99久久久久久久久| 99国产精品国产精品久久| 亚洲精美视频| 日韩亚洲欧美一区二区三区| 亚洲三级电影全部在线观看高清| 亚洲福利视频免费观看| 亚洲二区在线观看| 亚洲人线精品午夜| 亚洲精品中文字幕女同| 99国产精品久久久久久久成人热 | 夜夜嗨av一区二区三区四季av| 亚洲精品一区二区三区不| 日韩视频在线播放| 亚洲网在线观看| 亚洲视频欧美在线| 欧美亚洲在线视频| 久久久另类综合| 欧美成年视频| 日韩天堂在线观看| 亚洲影音一区| 久久久久国色av免费看影院| 麻豆精品一区二区综合av| 模特精品在线| 欧美午夜在线观看| 国产视频欧美| 亚洲日本在线观看| 亚洲免费综合| 乱中年女人伦av一区二区| 亚洲第一福利视频| 中文欧美日韩| 久久久蜜臀国产一区二区| 欧美成人日韩| 国产精品高潮呻吟久久av无限| 国产日韩欧美另类| 亚洲另类黄色| 久久精品国产亚洲一区二区| 欧美激情a∨在线视频播放| 99riav久久精品riav| 欧美一区二区精品| 欧美激情综合网| 国产日产欧美一区| 亚洲老司机av| 久久深夜福利免费观看| 亚洲青色在线| 欧美在线观看网址综合| 欧美剧在线免费观看网站| 国产一区清纯| 亚洲天堂av图片| 欧美jizz19hd性欧美| 亚洲专区欧美专区| 欧美激情在线免费观看| 韩国av一区二区三区四区| 亚洲伊人观看| 欧美激情1区| 欧美在线啊v一区| 欧美无砖砖区免费| 亚洲欧洲一区二区三区在线观看| 亚洲欧美日韩一区二区| 亚洲欧洲一区二区在线播放| 久久精品国产亚洲精品| 欧美视频福利| 日韩一区二区免费高清| 欧美ed2k| 久久夜色精品国产亚洲aⅴ | 国产一区二区三区成人欧美日韩在线观看 | 免费观看日韩av| 欧美一区二区网站| 国产乱子伦一区二区三区国色天香|