题意:在二维坐标轴上给你一堆点,在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. Cakey McCakeFace 按题意模拟即可. #include<stdio.h> #include<iostream> #include<string.h> #include<string> #include<ctype.h> #include<math.h> #include<set> #include<map> #include<vector> #include<queue&g…
地址:http://codeforces.com/gym/101174/attachments 题目:pdf,略 思路: 把每个人的(x1,x2)抽象成点(xi,yi). 当1号比i号排名高时有==>a(x1-xi)+b(y1-yi)>=0 把(x1-xi,y1-yi)看着向量,(a,b)看做向量.则和(a,b)夹角在90度内的向量个数就是不如1号点优的个数. 所以要使1号得到最高排名就是使和(a,b)夹角在90度内(包括90度)的向量个数最大. 所以要使1号得到最低排名就是使和(a,b)夹角…
题目链接:点这里 题意: 1~N标号的球 现在A有C个,B有C个 每次可以随机得到D个不同的球(1~N);问你A或B中的C个球都出现一次的 期望次数 题解: dp[i][j][k]表示 随机出现了i个仅仅属于A的球的个数,仅仅属于B的球的个数,同时属于A,B的球的个数 #include<bits/stdc++.h> using namespace std; #pragma comment(linker, "/STACK:102400000,102400000") #defi…
题目链接:点这里 题意: 让你构造一个长度范围在[A,B]之间 字符串(大小写字母,数字),问你有多少种方案 需要满足条件一下: 1:构成串中至少包含一个数字,一个大写字母,一个小写字母:   2:不能包含给定的N个病毒串 3:遵循一堆映射规则 题解: 将病毒串建立AC自动机 设定dp[i][j] [0/1][0/1][0/1]:表示构造长度为i,在自动机上面的状态是j,分别是否含有数字,大写字母,小写字母的情况 你能转移的点就是 加上一个数字或者大小写字母,暴力转移DP就好了,方程复杂度:20…
2017-2018 ACM-ICPC Southeastern European Regional Programming Contest (SEERC 2017) 全靠 wxh的博客 补完这套.wxhtxdy! [A - Concerts] $f[i][k]$ 表示在第 $i$ 个位置刚好匹配了 $k$ 个字符.转移方程 $$ f[i][k] = \sum_{i - j > h[s[k - 1]]} f[j][k - 1] $$ 前缀和优化加滚动就行了. 好像可以直接用 $f[i][k]$ 表…
layout: post title: 2018-2019 ACM-ICPC Southeastern European Regional Programming Contest (SEERC 2018) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces B.Broken Watch 题解 先不考虑长度 长度不会影响会不会过中心. 如果长度相同 \(C_{n}^{3}\) 再减去不符合的再同一侧的.…
2018-2019 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2018)-E. Explosion Exploit-概率+状压dp [Problem Description] 我方有\(n\)个人,对方有\(m\)个人,每个人都有一个健康值\(h_i\),有\(d\)次攻击,每次随机从所有人中选\(1\)个人,减少其\(1\)健康值.问将对方所有人都消灭的概率是多少? [Solution] 方法\(1\): ​ 将所有人的健康值作为…