随笔分类 - 题
摘要:题解告诉我: 大意:在一个矩形区域内,有n条线段,线段的端点是在矩形边上的,有一个特殊点,问从这个点到矩形边的最少经过的线段条数最少的书目,穿越只能在中点穿越 思路:需要巧妙的转换一下这个问题,因为从一个点到终点不可能“绕过”围墙,只能穿过去,所以门是否开在中点是无所谓的,只要求四周线段中点到终点的
阅读全文
摘要:他说:O(n^3)是过不了滴 一搜…… 6 代码和题解没有实质区别: #include<cstdio> #include<ctime> #include<cstdlib> using namespace std; int a[505][505],b[505][505],c[505][505]; in
阅读全文
摘要:第一次做扫描线 挺好的 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct ppx { int l,r; double left,right; double len; int cover
阅读全文
摘要:先把蜂巢快递柜画出来: __ __ __ __ __/ \__/ \__/ \__/ \__ __/ \__/ \__/53\__/ \__/ \__ / \__/ \__/52\__/54\__/ \__/ \ \__/ \__/51\__/31\__/55\__/ \__/ / \__/50\_
阅读全文
摘要:原来是二分 谁对平均分贡献大选谁 界限<0.001,100次足矣 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int maxn=1010; i
阅读全文
摘要:概率题。 1:爆枚 本蒟蒻不会概率dp,于是手搓枚举。 大抵是这么枚的: 如果区间里有它,好办,只能它赢 没他呢?就只能分类讨论。 中道崩殂的代码: #include<iostream> #include<vector> #include<string.h> using namespace std;
阅读全文
摘要:Gcd 板子。 注意“同一直线”,除2即可 #include<iostream> using namespace std; int Gcd(int a,int b){ int c; while(a){ c=b%a; b=a; a=c; } return b; } int main(){ int n,
阅读全文

浙公网安备 33010602011771号