当前位置: 首页 > news >正文

辽宁城乡建设集团官方网站怎样免费建设个人网站

辽宁城乡建设集团官方网站,怎样免费建设个人网站,wordpress 文章id 链接,中国铁建门户登录Hard challenge 思路 通过极角排序#xff0c;这里通过修改后#xff0c;所有点的角度在[0,2π)[0, 2 \pi)[0,2π)之间#xff0c; 然后O(n)O(n)O(n)扫一趟#xff0c;对当前在的级角加上π\piπ就是我们要找的角度了#xff0c;这里通过二分来实现查找。 接下来就只要…Hard challenge 思路 通过极角排序这里通过修改后所有点的角度在[0,2π)[0, 2 \pi)[0,2π)之间 然后O(n)O(n)O(n)扫一趟对当前在的级角加上π\piπ就是我们要找的角度了这里通过二分来实现查找。 接下来就只要通过前缀和思想来得到这个最大值了。 假设我们当前所在的是iii因为角度在[0,2π)[0, 2\pi)[0,2π)所以我们查找的jjj的下标可能会有两种情况 1j i这个时候有连续的一段区间[l, j]是属于一个集合。 2j i这个时候有连续的一段区间[j 1, i - 1]是属于一个集合 所以我们只要特判这两种情况即可。 代码 /*Author : lifehappy */ #include cstdio #include cmath #include cstring #include algorithm #include vector #include iostreamusing namespace std;typedef long long ll;const double pi acos(-1.0); const double eps 1e-5; const double inf 1e100;int Sgn(double x) {return x -eps ? -1 : x eps; }struct Vector {double x, y, angle;int w;bool operator (Vector a) const {return x a.x;}void print() {printf(%f %f\n, x, y);}void read() {scanf(%lf %lf, x, y);}Vector(double _x 0, double _y 0) : x(_x), y(_y) {}double mod() {return sqrt(x * x y * y);}double mod2() {return x * x y * y;}Vector operator (const Vector a) {return Vector(x a.x, y a.y);}Vector operator - (const Vector a) {return Vector(x - a.x, y - a.y);}double operator * (const Vector a) {return x * a.x y * a.y;}double operator ^ (const Vector a) {return x * a.y - y * a.x;}Vector Rotate(double angle) {return Vector(x * cos(angle) - y * sin(angle), x * sin(angle) y * cos(angle));}Vector operator (const double a) {return Vector(x * a, y * a);}Vector operator (const double a) {return Vector(x / a, y / a);} };typedef Vector Point;double Dis_pp(Point a, Point b) {return sqrt((a - b) * (a - b)); }double Angle(Vector a, Vector b) {double ans atan2(a ^ b, a * b);if(ans 0) ans 2 * pi;return ans;// return atan2(a ^ b, a * b); }double To_lefttest(Point a, Point b, Point c) {return (b - a) ^(c - a); }int Toleft_test(Point a, Point b, Point c) {return Sgn((b - a) ^ (c - a)); }struct Line {Point st, ed;Line(Point _st Point(0, 0), Point _ed Point(0, 0)) : st(_st), ed(_ed) {}bool operator (const Line t) {return st.x t.st.x;}void read() {scanf(%lf %lf %lf %lf, st.x, st.y, ed.x, ed.y);} };bool Parallel(Line a, Line b) {return Sgn((a.st - a.ed) ^ (b.st - b.ed)) 0; }bool Is_cross(Line a, Line b) {return Toleft_test(a.st, a.ed, b.st) * Toleft_test(a.st, a.ed, b.ed) 0 Toleft_test(b.st, b.ed, a.st) * Toleft_test(b.st, b.ed, a.ed) 0; }Point Cross_point(Line a, Line b) {if(!Is_cross(a, b)) {return Point(inf, inf);}else {double a1 fabs(To_lefttest(a.st, a.ed, b.st)), a2 fabs(To_lefttest(a.st, a.ed, b.ed));return ((b.st a2) (b.ed a1)) (a1 a2);} }Point Shadow(Line a, Point b) {Point dir a.ed - a.st;return a.st (dir (((b - a.st) * dir) / dir.mod2())); }Point Reflect(Line a, Point b) {return (Shadow(a, b) 2) - b; }bool inmid(double a, double b, double x) {if(a b) swap(a, b);return Sgn(x - a) 0 Sgn(b - x) 0; }bool Point_in_line(Line a, Point b) {if(Toleft_test(a.st, a.ed, b) ! 0) return false;return inmid(a.st.x, a.ed.x, b.x) inmid(a.st.y, a.ed.y, b.y); }double Dis_lp(Line a, Point b) {Point h Shadow(a, b);if(Point_in_line(a, h)) {return Dis_pp(h, b);}return min(Dis_pp(a.st, b), Dis_pp(a.ed, b)); }double Dis_ll(Line a, Line b) {if(Is_cross(a, b)) return 0;return min({Dis_lp(a, b.st), Dis_lp(a, b.ed), Dis_lp(b, a.st), Dis_lp(b, a.ed)}); }double Area(vectorPoint p) {int n p.size();double ans 0;for(int i 0; i n; i) {ans p[i] ^ p[(i 1) % n];}return 0.5 * ans; }bool cmp(Point a, Point b) {return a.angle b.angle; }const int N 5e4 10;Point a[N];ll value[N];int main() {// freopen(in.txt, r, stdin);// freopen(out.txt, w, stdout);// ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);int T;scanf(%d, T);while(T--) {int n;scanf(%d, n);for(int i 1; i n; i) {a[i].read();scanf(%d, a[i].w);a[i].angle Angle(Point(1, 0), Point(a[i].x, a[i].y));}ll sum 0, ans 0;sort(a 1, a 1 n, cmp);for(int i 1; i n; i) {value[i] value[i - 1] a[i].w;sum a[i].w;}for(int i 1; i n; i) {double now a[i].angle, need now pi;if(need 2 * pi) need - 2 * pi;int l 1, r n;while(l r) {int mid l r 1 1;if(a[mid].angle need) r mid - 1;else l mid;}if(a[l].angle need) l;l--;if(l i) {ans max(ans, (sum - value[l] value[i - 1]) * (value[l] - value[i - 1]));}else {ans max(ans, (sum - value[i - 1] value[l]) * (value[i - 1] - value[l]));}}printf(%lld\n, ans);}return 0; }
http://www.zqtcl.cn/news/487764/

相关文章:

  • 淮安做网站的公司有哪些公司目前上海有几个区
  • 怎么做自动跳转网站建站之星 discuz
  • 网站建设开发合同范本页面设计有哪几种风格
  • 重庆做网站重庆做网站做公司网站建设价格
  • 住房建设部官方网站公示公告国内卖到国外的电商平台
  • 安徽省建设厅网站巅川建设有限公司宁波城乡建设网站
  • 做财务还是网站运营wordpress主题 微博
  • 为什么要用CGI做网站网站建设 自学 电子版 pdf下载
  • 建设网站的规则营销型网站建设jm3q
  • 深圳建网站价格防水堵漏公司做网站效果怎样
  • 网站建设东莞老铁博客外国炫酷网站网址
  • 笔杆子写作网站牡丹江信息网0453免费发布信息
  • 网站建设介绍推广用语解释seo网站推广
  • 加盟企业网站建设目的速卖通下载app
  • 阳江北京网站建设网页设计与网站建设pdf
  • 做考试平台的网站网站之前没备案
  • 网站维护要多久时间北京网站优化哪家好
  • 单页推广网站模版网站建设一个购买链接
  • 湖南门户网站设计公司免费自媒体网站
  • 美食网站建设项目预算域名解析站长工具
  • 网站如何备案工信局学网站开发首先学哪些基础
  • 什么网站利于优化河北省建设局网站材料备案
  • 自学装修设计从哪里入手沈阳百度seo
  • 做jsp网站用哪些软件下载如何利用网站赚钱
  • 注册网站域名需要什么湘潭公司做网站
  • 一个网站如何优化企业资质查询平台
  • 模板网站为什么做不了优化山西网络网站建设销售公司
  • 建设什么网站可以赚钱设计本网站是用什么做的
  • 荆州市网站建设策划师
  • 苏州中国建设银行招聘信息网站中国企业登记网