三维空间中有一些(<=2000)气球,一些光源(<=15),给定一个目标点,问你在移除不超过K个气球的前提下,目标点所能接受到的最大光照. 枚举每个光源,预处理其若要照射到光源,需要移走哪些气球,构建成一个bitset. 然后再2^15枚举光源集合,看看要让集合中所有光源照到目标点所要移走的气球是否在K以内,尝试更新答案. 需要注意的一点是,三维叉积叉出来的向量的长度的绝对值,就是原来两个向量所张成的平行四边形面积的大小. #include<cstdio> #include<…
枚举直线,对于直线的某个点在直线的左端还是右端,能够状压出一个数.用bitset记录. 然后三角形就是3个bitset&一下 #include <cstdio> #include <cstring> #include <bitset> #include <algorithm> using namespace std; typedef long long ll; const int N = 101; const int M = 1005; bitset…
题面 传送门 题解 首先可以用一个矩形去套这个多边形,那么我们只要枚举这个矩形的左下角就可以枚举完所有多边形的位置了 我们先对每一个\(x\)坐标开一个\(bitset\),表示这个\(x\)坐标里哪些\(y\)坐标处有苍蝇.然后再处理出矩形中哪些位置会被覆盖,这个同样可以枚举\(x\)坐标,然后对于所有线段,如果它穿过这个\(x\)坐标,就用一个\(stack\)存起来,然后把所有\(stack\)里的\(sort\)一下,乱搞就好了(具体可以看代码) 注意只有一条线段完全穿过\(x\)才有可…
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury of Berland regional olympiad in informatics does not trust to contest management systems, so the Berland regional programming contest is judged by th…
Problem J. Triatrip Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description The travel agency “Four Russians” is offering the new service for their clients. Unlike other agencies that only suggest one-way…
Problem J. TriatripTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description The travel agency “Four Russians” is offering the new service for their clients. Unlike other agencies that only suggest one-way…
B - Light Bulb Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3203 Description Compared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only o…
Mirror and Light Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 650    Accepted Submission(s): 316 Problem Description The light travels in a straight line and always goes in the minimal path b…
http://codeforces.com/gym/100283/problem/A 考虑到多边形是不稳定的,是可以变来变去的. 那么总是可以把每个点放到圆上. 所以只需要判断圆心角是不是小于等于360即可. #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <assert.h>…
题目链接:http://codeforces.com/gym/100553/attachments/download/2885/20142015-acmicpc-northeastern-european-regional-contest-neerc-14-en.pdf 首先bitset用法链接:https://www.cnblogs.com/magisk/p/8809922.html 题解: 题目要判断哪个文本串是符合题意的. 限制:此字符串包含的信息用二进制表示后,可以找到一个u[i]使得对…