HDU 5372 Segment Game】的更多相关文章

/** 多校联合2015-muti7-1004 <a target=_blank href="http://acm.hdu.edu.cn/showproblem.php?pid=5372">HDU 5372 Segment Game <span style="font-family: Arial, Helvetica, sans-serif;"></span><span style="font-family: Ar…
http://acm.hdu.edu.cn/showproblem.php? pid=5372 Segment Game Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1284    Accepted Submission(s): 375 Problem Description Lillian is a clever girl so…
Segment Game Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 446    Accepted Submission(s): 95 Problem Description Lillian is a clever girl so that she has lots of fans and often receives gifts…
题意是指第i此插入操作,插入一条长度为i的线段,左端点在b[i],删除某一条线段,问每次插入操作时,被当前线段完全覆盖的线段的条数. 题解:对于新插入的线段,查询有多少个线段左端点大于等于该线段的左端点. 再查询有多少个线段的右端点大于该线段右端点, 两者之差就是答案.用两个树状数组搞定.时间复杂度nlogn 由于坐标范围很大,需要离散. #pragma comment(linker, "/STACK:1677721600") #include <map> #include…
给出一些操作, 0是将第i次增加的线段放在b位置,第i次放的线段的长度为i 1是将第b次增加操作放的线段删除 每次增加操作完之后,询问这条线段上面的完整的线段的条数 每次询问统计比这条线段左端点大的线段的条数 L,比这条线段右端点大的线段的条数 R,两个相减就是完整的线段的条数 另外因为给的b很大,所以需要离散化一下,而且b可能会相同,所以相同大小的应该占据一个编号 然后就像求逆序对那样的算 #include<iostream> #include<cstdio> #include&…
Segment set Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description A segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in i…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1558 解题报告:首先如果两条线段有交点的话,这两条线段在一个集合内,如果a跟b在一个集合内,b跟c在一个集合内,那么a跟c在一个集合内.在一个平面上,有两种操作: P:在这个平面上添加一条线段 Q k:询问添加的第k条线段所在的那个集合有多少条线段 用并查集,然后就是要判断一下线段有没有交点.还有就是题目要求两个test之间要有空行,为此我还PE了一次. #include<cstdio> #inc…
Segment set Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4484    Accepted Submission(s): 1677 Problem Description A segment and all segments which are connected with it compose a segment set…
Segment Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Description     Silen August does not like to talk with others.She like to find some interesting problems. Today she finds an interesting problem.She…
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5666 bc(中文):http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=688&pid=1002 题解: 首先可以统计出三角形内所有的点数,(q-2)+(q-3)+...+1=(q-1)*(q-2)/2 其次只要减去被线段割到的点,对于线段xi+yi=q,割到的点有gcd(xi,yi)-1=gcd(xi,q…