二分--1043 - Triangle Partitioning】的更多相关文章

1043 - Triangle Partitioning PDF (English) Statistics Forum Time Limit: 0.5 second(s) Memory Limit: 32 MB See the picture below. You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to fi…
1043 - Triangle Partitioning   PDF (English) Statistics Forum Time Limit: 0.5 second(s) Memory Limit: 32 MB See the picture below. You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to…
题目链接:http://lightoj.com/volume_showproblem.php? problem=1043 题意:一个三角形ABC,DE//BC.已知三角形ADE和四边形BDEC的面积的比,求AD的长度. 解法:二分AD边就可以 代码: #include <stdio.h> #include <ctime> #include <math.h> #include <limits.h> #include <complex> #inclu…
提高自己的实力, 也为了证明, 开始板刷lightoj,每天题量>=1: 题目的类型会在这边说明,具体见分页博客: SUM=54; 1000 Greetings from LightOJ [简单A+B] 1001 Opposite Task  [简单题] 1002 Country Roads[搜索题] 1003 Drunk[判环] 1004 Monkey Banana Problem [基础DP] 1006 Hex-a-bonacci[记忆化搜索] 1008 Fibsieve`s Fantabu…
Triangle Partitioning Time Limit: 500MS   Memory Limit: 32768KB   64bit IO Format: %lld & %llu Submit Status Description See the picture below. You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC.…
题意 给出平面上 \(n\) 个点 \((x_i, y_i)\),问是否存在三个点构成的三角形的面积恰好为 \(S\) ,有的话,输出任意一组解即可. \(n\leq 2000\) 分析 BZOJ3707稍微改动 这种点到直线的问题可以考虑单调性. 将所有点以 \(x\) 为第一关键字, \(y\) 为第二关键字排序.然后枚举二元组 \((i,j)(i< j)\) 代表的直线,并按照极角排序. 顺次枚举直线,记录每个点当前的 \(rank\) ,表示以当前直线为 \(x\) 轴时点的 \(y\)…
极角排序后枚举每个点,计算其与原点连线的左侧的半平面内的点与其组成的三角形数(二分/尺取),这些都不是黄金三角形. 补集转化,用平面内所有三角形的个数(C(n,3))减去这些即可. 精度很宽松,几乎不用管. #include<cstdio> #include<algorithm> #include<cmath> using namespace std; typedef long long ll; typedef double db; #define N 100001 c…
题意:让你找这样的一个三角形,三条边为t,t-1,t+1,并且面积为整数,最后满足t大于等于n. n<=1e30 思路:直接推式子不会,打表找规律 f(n)=4*f(n-1)-f(n-2)(n>=3) f(1)=4 f(2)=14 队友用Java写的,再写个二分就行 import java.math.BigInteger; import java.util.Arrays; import java.util.Scanner; public class Main { public static v…
题意 给定一个三角形和一个点 \(p\),如果该点不在三角形边上直接输出 \(-1\),否则在三角形上找一点 \(q\),使得线段 \(pq\) 平分三角形面积. 思路 看完题想都没想直接二分了. 就是比赛时复制粘贴的时候改错了,贡献了三发罚时. 板子来自 kuangbin 的模板. #include <bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-8; const db inf = 1e20;…
给数组赋值:通过fill方法. 对数组排序:通过sort方法,按升序.比较数组:通过equals方法比较数组中元素值是否相等.查找数组元素:通过binarySearch方法能对排序好的数组进行二分查找法操作. 使用如下: int[] array = new int[5]; //填充数组 Arrays.fill(array, 5); System.out.println("填充数组:Arrays.fill(array, 5):"); test.output(array); //将数组的第…