codeforces Summer Earnings(bieset)】的更多相关文章

Summer Earnings time limit per test 9 seconds memory limit per test 256 megabytes input standard input output standard output Many schoolchildren look for a job for the summer, and one day, when Gerald was still a schoolboy, he also decided to work i…
题目传送门 传送门I 传送门II 传送门III 题目大意 给定平面上的$n$个点,以三个不同点为圆心画圆,使得圆两两没有公共部分(相切不算),问最大的半径. 显然答案是三点间任意两点之间的距离的最小值的一半. 那么一定有一对点的距离会被算入答案. 考虑将所有边按距离从大到小排序.当加入某一条边的时候出现了三元环.那么这条边的长度的一半就是答案. 至于判断三元环就用bitset.再加上很难跑满,以及for自带二分之一常数就过了. 标算是二分答案,然后枚举一个点,保留距离和它大于等于$mid$的所有…
题目链接 Summer Earnings 类似MST_Kruskal的做法,连边后sort. 然后对于每条边,依次处理下来,当发现存在三角形时即停止.(具体细节见代码) 答案即为发现三角形时当前所在边长度的一半. #include <bits/stdc++.h> using namespace std; struct node{ int x, y, z; friend bool operator < (const node &a, const node &b){ retu…
time limit per test 9 seconds memory limit per test 256 megabytes input standard input output standard output Many schoolchildren look for a job for the summer, and one day, when Gerald was still a schoolboy, he also decided to work in the summer. Bu…
[题目分析] 找一个边长最大的三元环. 把边排序,然后依次加入.加入(i,j)时,把i和j取一个交集,看看是否存在,存在就找到了最大的三元环. 输出即可,n^3/64水过. [代码] #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <set> #include <bitset> #include <map>…
Codeforces 1107G 线段树最大子段和 + 单调栈 G. Vasya and Maximum Profit Description: Vasya got really tired of these credits (from problem F) and now wants to earn the money himself! He decided to make a contest to gain a profit. Vasya has \(n\) problems to choo…
CF333E Summer Earnings 题目 https://codeforces.com/problemset/problem/333/E 题解 思路 知识点:枚举,图论,位运算. 题目要求从给定的坐标中的选取三个点为圆心,画出 \(3\) 个不相交且半径相等的圆,并求圆半径可能的最大值. 显然,题目可以转化为,任选三个点,找到构成三角形最短边长的 \(1/2\) 中的最大值,直接枚举三个点的复杂度是 \(O(n^3)\) 是不行的. 考虑不从找点角度构成三角形,因为没有操作空间,而先预…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…