Triathlon Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4733   Accepted: 1166 Description Triathlon is an athletic contest consisting of three consecutive sections that should be completed as fast as possible as a whole. The first sect…
Triathlon Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 6912   Accepted: 1790 Description Triathlon is an athletic contest consisting of three consecutive sections that should be completed as fast as possible as a whole. The first sect…
Description Triathlon is an athletic contest consisting of three consecutive sections that should be completed as fast as possible as a whole. The first section is swimming, the second section is riding bicycle and the third one is running. The speed…
http://poj.org/problem?id=1755 题意:铁人三项,每个人有自己在每一段的速度,求有没有一种3条路线长度都不为0的设计使得某个人能严格获胜? 我们枚举每个人获胜,得到不等式组:s1/v1+s2/v2+s3/v3<s1/v1'+s2/v2'+s3/v3' 是三维半平面交?接着看 我们令两边同时除以s3得到 (s1/s3)*(1/v1)+(s2/s3)*(1/v2)+(1/v3)<(s1/s3)*(1/v1')+(s2/s3)*(1/v2')+(1/v3') 这样s1/s…
Art Gallery Time Limit: 1000MS Memory Limit: 10000K Description The art galleries of the new and very futuristic building of the Center for Balkan Cooperation have the form of polygons (not necessarily convex). When a big exhibition is organized, wat…
LINK 题意:给出一个多边形,求是否存在核. 思路:比较裸的题,要注意的是求系数和交点时的x和y坐标不要搞混...判断核的顶点数是否大于1就行了 /** @Date : 2017-07-20 19:55:49 * @FileName: POJ 3335 半平面交求核.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$…
http://poj.org/problem?id=1474 解法同POJ 1279 A一送一 缺点是还是O(n^2) ...nlogn的过几天补上... /********************* Template ************************/ #include <set> #include <map> #include <list> #include <cmath> #include <ctime> #include…
http://poj.org/problem?id=1279 顺时针给你一个多边形...求能看到所有点的面积...用半平面对所有边取交即可,模版题 这里的半平面交是O(n^2)的算法...比较逗比...暴力对每条线段做半平面交...要注意的地方写在注释里了...顺序写反了卡了我好久 /********************* Template ************************/ #include <set> #include <map> #include <…
题意简述 给你\(3\)个数组\(a_i\),\(b_i\)和\(c_i\),让你维护一个数组\(x_i\),共\(m\)组询问,每次给定两个数\(s\),\(t\),使得 \[ \sum_i a_i x_i = s \qquad \sum_i b_i x_i = t \] 让你求出\(\mathrm{Maximize} \sum_i c_i x_i\). 做法 显然题目是一个线性规划的模型,用\(x\),\(y\)表示两个新变量,使用对偶转化可得 \[ \begin{split} &\math…
第一道半平面交,只会写N^2. 将每条边化作一个不等式,ax+by+c>0,所以要固定顺序,方便求解. 半平面交其实就是对一系列的不等式组进行求解可行解. 如果某点在直线右侧,说明那个点在区域内,否则出现在左边,就可能会有交点,将交点求出加入. //#pragma comment(linker, "/STACK:16777216") //for c++ Compiler #include <stdio.h> #include <iostream> #inc…