http://codeforces.com/gym/101149/problem/K 题意:题目贼长,但其实是个脑筋急转弯... 题解:题目要求某图形面积.该图形只有一个自由度,就是起点与终点距离x.样例给出了x==1时的解S0,所以ans=x*x*S0 ac 代码: #include<iostream> #include<stdio.h> #include<algorithm> #include<vector> using namespace std; t…
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABPoAAANFCAIAAABtIwXVAAAgAElEQVR4nOydeVxTV/r/n9ertaJEC4…
http://codeforces.com/gym/101128 题目大意:给你一个a,b,e,p.有e个点,p条有向边,每条边为(x,y),表示x->y,每次我们都取出一个入度为0的,并且一次性取出来的个数为a(或b).当然,取出来的种类可能有很多种(即一个集合),问,这个集合中有多少个数字是相同的. 第一个输出集合长度为a的,第二个输出集合长度为b的,第三个输出无论如何都无法被取出的个数. 思路:建立正向图和反向图. 定义pair<int, int> interval[i] 表示第i…
L. Ministry of Truth Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/K Description Andrey works in the Ministry of Truth. His work is changing articles in newspapers and magazines so that they praise the Party an…
题目链接:http://codeforces.com/gym/101873/problem/K 题意: 现在给出 $n(1 \le n \le 1e4)$ 个员工,最多可以裁员 $k$ 人,名字为 $s_i$ 的员工的薪资为 $c_i(1 \le c_i \le 1e5)$. 已知必须节省下 $d(1 \le d \le 1e9)$ 元才能拯救公司,问要裁员哪些人. 题解: 薪资越高的人越要裁掉. (这么个大水题,居然没人发现,交的人不多.可能是这套题英语阅读量有点烦人吧……) AC代码: #i…
题目链接:http://codeforces.com/gym/101149/problem/K 题目大意: 给你两个点a,b.一个人在a点,一个人在b点,b点的人要追杀a的点,他的跑步速度是a的两倍.如果a点的人能在b点追击到之前回到a点这个位置,那么这个人就是安全的(b点的人追击a点的人的追击方案是:一直朝着a点的人所在的位置奔跑过去).问,这个人的安全区域是多少? 思路:几何果然不会= =,连sb题都没想到 因为是面积,所以说两点之间的距离就决定了最后的结果.因为题目给出的是单位面积.所以对…
题目链接:https://codeforces.com/gym/102361/problem/A 题意:给定二维平面上的\(n\)个点,\(q\)次询问,每次加入一个点,询问平面上有几个包含该点的直角三角形. 分析:这是一篇鸽了很久的题解,主要原因就是现场赛的时候这题惨遭卡常,锅++.现在回过头来想这题,主要问题出在现场赛时误判了\(map\)的时间复杂度,把极角排序的正确想法成功叉掉,以及现场赛时候的共线计数使用了\(gcd\),使得整体复杂度上升.(但还是有大佬拿gcd思想过了,我太菜了)现…
Problem E. Explicit Formula Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100610 Description Consider 10 Boolean variables x1, x2, x3, x4, x5, x6, x7, x8, x9, and x10. Consider all pairs and triplets of distinct variables amon…
Problem H. Hard TestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description Andrew is having a hard time preparing his 239-th contest for Petrozavodsk. This time the solution to the problem is based on Di…
Description Data-mining huge data sets can be a painful and long lasting process if we are not aware of tiny patterns existing within those data sets. One reputable company has recently discovered a tiny bug in their hardware video processing solutio…