题意:在二维坐标轴上给你一堆点,在x轴上找一个点,使得该点到其他点的最大距离最小. 题解:随便找几个点画个图,不难发现,答案具有凹凸性,有极小值,所以我们直接三分来找即可. 代码: int n; long double x[N],y[N]; long double check(long double s){ long double res=0; long double tmp; for(int i=1;i<=n;++i){ tmp=sqrt((s-x[i])*(s-x[i])+(y[i]*y[i…
Performance ReviewEmployee performance reviews are a necessary evil in any company. In a performance review, employees give written feedback about each other on the work done recently. This feedback is passed up to their managers which then decide pr…
A. Within Arm's Reach 留坑. B. Bribing Eve 枚举经过$1$号点的所有直线,统计直线右侧的点数,旋转卡壳即可. 时间复杂度$O(n\log n)$. #include<cstdio> #include<algorithm> #include<cmath> using namespace std; const int N=2000010; const double eps=1e-7; int _,n,i,x,y,at_center,X,…
A. Arranging Hat $f[i][j]$表示保证前$i$个数字有序,修改了$j$次时第$i$个数字的最小值. 时间复杂度$O(n^3m)$. #include <bits/stdc++.h> using namespace std ; typedef long long LL ; #define clr( a , x ) memset ( a , x , sizeof a ) typedef pair<int,int>pi; char ten='9'+1; int n,…
题目链接 Codefores_Gym_101164 Solved 6/11 Penalty Problem A Problem B Problem C Problem D Problem E Problem F 预处理出一个pre数组 pre[i]表示i位字母数以内用掉多少个字母 然后就可以算出要计算的位置是第多少个字母数 最后就是转成26进制了 注意是没有0有26的26进制 #include<iostream> #include<cstdio> #include<cma…
Tamref love random numbers, but he hates recurrent relations, Tamref thinks that mainstream random generators like the linear congruent generator suck. That's why he decided to invent his own random generator. As any reasonable competitive programmer…