摘要: #include using namespace std; #define LL long long #define Max(a,b) ((a)>(b)?(a):(b)) #define Min(a,b) ((a) q; mem(d,0); q.push(s); d[s]=1; while(!q.empty()){ x=q.front();q.po... 阅读全文
posted @ 2019-11-02 15:35 勿忘安己 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 注:本文章参考自:https://blog.csdn.net/wang_heng199/article/details/74477738 问题描述基本问题为O(n)求凸n角形的对踵点,而由该问题可以引申出许多的难题,他们包括: 计算距离 凸多边形直径凸多边形宽凸多边形间最大距离凸多边形间最小距离外接 阅读全文
posted @ 2019-10-04 22:33 勿忘安己 阅读(328) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; const long double eps=1e-8; const double pi=acos(-1.0); int sgn(double x) { if(fabs(x)<eps) return 0; re 阅读全文
posted @ 2019-09-27 20:55 勿忘安己 阅读(398) 评论(0) 推荐(0) 编辑
摘要: Two organizations International Community for Preservation of Constructions (ICPC) and Japanese Archaeologist Group (JAG) engage in ruins preservation 阅读全文
posted @ 2019-09-13 23:11 勿忘安己 阅读(317) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; #define rep(i,a,n) for(int i=a;i<n;i++) #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef l 阅读全文
posted @ 2019-08-02 19:11 勿忘安己 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Bob想要和Carrol玩游戏。但Carrol觉得玩游戏太无聊,就和Tuesday去写歌了。于是现在Bob来找你玩游戏。 这个游戏是这样的:给定一棵n个节点的树, 1号点为根节点,设v的父亲是f(v) 。其中每个节点有一个颜色,要么是黑色,要么是白色。不妨记第i个节点的初始颜色是ci。ci =0或1 阅读全文
posted @ 2019-07-11 21:48 勿忘安己 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 写出一个程序,接受一个以N/D的形式输入的分数,其中N为分子,D为分母,输出它的小数形式。如果它的小数形式存在循环节,要将其用括号括起来。例如:1/3=.33333…表示为.(3),又如41/333=.123123… 表示为.(123)。 一些转化的例子: 1/3=.(3) 22/5=4.4 1/7 阅读全文
posted @ 2019-06-10 16:16 勿忘安己 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 题目描述 在一条环形公路旁均匀地分布着N座仓库,编号为1~N,编号为 i 的仓库与编号为 j 的仓库之间的距离定义为 dist(i,j)=min⁡(|i-j|,N-|i-j|),也就是逆时针或顺时针从 i 到 j 中较近的一种。每座仓库都存有货物,其中编号为 i 的仓库库存量为 Ai。在 i 和 j 阅读全文
posted @ 2019-05-02 20:52 勿忘安己 阅读(269) 评论(0) 推荐(0) 编辑
摘要: When you were five years old, you watched in horror as a spiked devil murdered your parents. You would have died too, except you were saved by Rose, a 阅读全文
posted @ 2019-04-10 19:26 勿忘安己 阅读(617) 评论(0) 推荐(0) 编辑
摘要: Two integer sequences existed initially, one of them was strictly increasing, and another one — strictly decreasing. Two integer sequences existed ini 阅读全文
posted @ 2019-04-01 21:24 勿忘安己 阅读(233) 评论(0) 推荐(0) 编辑