原题链接 题意简介: 已知分别处在 \((-\infty,-1]\) H.\((-1,0)\) .\((0,1)\) .\([1,\infty)\) 的实数的数量(下记为集合 \(A,B,C,D\) ),试问:把这些数乘起来后,答案的可能出现在那个范围中? 题解: 首先,我们不难发现,如果负数的个数为奇数,那么答案必然在 \(A\) 和 \(B\) 中,否则,将出现在 \(C\) 和 \(D\) 中. 确定了这一点后,我们将符号全部视为正,试着探索答案能否出现在 \(C\) 或 \(D\) 中.…
http://poj.org/problem?id=2318 题目大意:给一个大矩形,分成n+1份,求落在每一份的点的数量. —————————————————— 首先叉积可以判断一个点在边界的左边还是右边(不写公式了) 然后边界题中给定按顺序读入,显然是可以二分的,于是二分之. 然后切了. #include<cstdio> #include<queue> #include<cctype> #include<cstring> #include<vect…
题目链接:https://www.luogu.org/problemnew/show/UVA12657 分析: 此题使用手写链表+模拟即可.(其实可以用list,而且更简便,但是会大大的超时) 肯定是不能直接用数组模拟了,因为n,m的大小会达到100000. 然后, 1.可以编写一些辅助函数来设置链接关系. 2.注意 op==3的时候,要对xy相邻的情况进行特判,因为有这种情况 2 1 (头节点) 3 1 2 (尾节点) 3.我们会发现如果反转两次,就相当于没有翻转.如果翻转一次,op=1变为o…
题意:给一个如图坐标系,每个方形都放在下面两个中间,已知一个木块湿了那么他下面所有的都会湿,显然,不能湿两次.问,每次给出一个坐标,把他弄湿,有几个木块从干变成湿了. 思路:我们把坐标系拉直,就变成了如图,显然我们弄湿 a(0,5),那么红色部分变湿,看一眼应该已经找到计算面积的方法了.所以我们每次得到一个坐标,我们就能直接算出面积.然后我们判断,是否已经有顶点所产生的面积包含了我的顶点,是的话我湿的面积为0.没有的话我就遍历一遍所有顶点,删掉所有的已经湿了的面积,剩下的就是新湿的面积了. 然后…
Distributing Ballot Boxes http://acm.hdu.edu.cn/showproblem.php?pid=4190 Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2109    Accepted Submission(s): 1119 Problem Description Today, besides…
Distributing Ballot Boxes Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 756    Accepted Submission(s): 372 Problem Description Today, besides SWERC'11, another important event is taking plac…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4190 Distributing Ballot Boxes Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1065    Accepted Submission(s): 536 Problem Description Today, bes…
                                                      3136: Ubiquitous Religions 时间限制(普通/Java):2000MS/6000MS     内存限制:65536KByte总提交: 274            测试通过:149 描述 There are so many different religions in the world today that it is difficult to keep trac…
A Bug's Life Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 28211   Accepted: 9177 Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders…
Matrix Swapping II Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1543    Accepted Submission(s): 1036 Problem Description Given an N * M matrix with each entry equal to 0 or 1. We can find so…