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            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2018-01-21 18:40:00
                            
                                67阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            题目: 题目网址:2352 -- Stars (poj.org) 思路: 定义星星的等级为左下角星星的个数,给定以y坐标升序的星星输出各级别星星的个数; 因为按照Y坐标升序输入,所以放入一个点后,不会影响到等级比他大的点的个数,所以和它同等级的点的个数应该加一; 代码实现: #include<ios ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-08-06 14:25:00
                            
                                59阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            Problem DescriptionAstronomers 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 t            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-11-30 09:58:08
                            
                                86阅读
                            
                                                                             
                 
                
                                
                     
                                    
                             
         
            
            
            
            StarsTimeLimit: 1000MS            Memory Limit:65536KTotalSubmissions: 25392             Accepted:11            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-09-26 14:35:49
                            
                                33阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            https://uva.onlinejudge.org/index.phpoption=com_onlinejudge&Itemid=8&category=279&page=show_problem&problem=3937 题目:http://acm.bnu.edu.cn/v3/external/            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-06-27 20:58:00
                            
                                85阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            Mocha and Stars 题意 给定 \(n,m\) ,问符合下定条件的数列有多少个: 对于$a_i(1\le i\le n)$,\(a_i\in [l_i,r_i]\cap \mathbb{Z}\) \(\sum_{i=1}^ma_i\le m\) \(\gcd(a_1,a_2,...a_n ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-08-21 14:50:00
                            
                                64阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            终于开始了我的POJ之旅,这是一题树状数组的基本题DescriptionAstronomers of            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2023-04-24 07:26:44
                            
                                106阅读
                            
                                                                             
                 
                
                                
                     
                                    
                             
         
            
            
            
            Counting Stars https://acm.hdu.edu.cn/showproblem.php?pid=7059 题意:  给定n个数,分别为ai,题目要求支持三种操作:1、区间求和 2、区间减去lowbit(ai) 3、区间加2k,(2k<=ai<2^(k+1)); 思路:  假设 ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-08-13 10:38:00
                            
                                247阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
             
                                    
                             
         
            
            
            
            Sample Input 3 4 5 18 36 360 2147483647 Sample Output 1 1 2 3 6 48 1073741823 题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-07-11 19:08:00
                            
                                74阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1541题意:给出n个坐标,先按纵坐标升序,纵坐标相同再按横坐标升序排序,在这个点左下角的个数记做这个数的level值(不严格,纵坐标和横坐标可以相同),求0到n-1的level数是多少思路:update单点更新,query区间求值AC代码:#include #include #inc            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-08-04 09:22:56
                            
                                40阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            二维偏序:第一维排序,第二维树状数组或线段树。            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2016-05-20 17:55:00
                            
                                79阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            Stars Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 42707 Accepted: 18587 Description Astronomers often examine star maps where stars are            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2016-09-08 21:39:00
                            
                                59阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            http://poj.org/problem?id=2352 题意: 给出每个星星的x、y坐标,计算每颗星星左方和正下方的星星个数。 思路:由于星星是根据y坐标递增的基础上再根据x坐标递增的顺序给出,所以我们只需要考虑横坐标上的星星情况,至于正下方的星星个数,我们只需要记录一下最后加上即可。            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-05-07 19:24:00
                            
                                54阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            /* * This is a application which print diamond stars. * OS: Windows XP * Compiler: Visual C++ 6.0 */#include <stdio.h>int main(void){     int i, j, k, n;&            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2009-12-08 20:06:09
                            
                                289阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            树状数组:注意,这种大数据的题,千万别作死用cin我已经光荣的被T了一次了= =#include#include#includeusing namespace std;const int maxn=32005;int c[maxn],level[maxn],n;int lowbit(int x){ ...            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2021-07-16 14:59:09
                            
                                85阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            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 s            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2021-07-29 16:17:12
                            
                                105阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            【题目链接】 http://poj.org/problem?id=2352 【算法】 树状数组 注意x坐标为0的情况 【代码】            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2018-07-13 16:23:00
                            
                                116阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            POJ_2352
    由于我们在读入数据的时候已知了前面星星的个数,实际上再减去当前星星右边的星星的数量即可,因此我们可以用一个线段树存储横坐标区间里的星星个数,每读入一个星星就修改并查询一次,并记录level即可。
#include<stdio.h>#include<string.h>#define MAXD 32010#define MAXN 15010int M            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2011-11-01 18:58:00
                            
                                73阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            StarsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 27342Accepted: 11961Description 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            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-09-05 17:49:00
                            
                                75阅读
                            
                                                                                    
                                2评论