题目链接 \(Description\) \(q\)次操作,每次给定点的坐标\((x,y)\),表示加入一个点\((x,y)\),或删除一个点\((x,y)\),或询问:至少需要在平面中加入多少个点,才能使得当前所有点关于\((0,0)-(x,y)\)这条直线对称. \(q\leq2\times10^5,\ 1\leq x,y\leq 112904\). \(Solution\) 两个点关于\((0,0)-(x,y)\)对称,则它们到原点的距离是一样的,即位于同一个圆上. 可以猜到的一个结论是,…
Hidden Code 题目连接: http://codeforces.com/gym/100015/attachments Description It's time to put your hacking skills to the test! You've been called upon to help crack enemy codes in the current war on... something or another. Anyway, the point is that yo…
A. ArielTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/A Description King Triton really likes watching sport competitions on TV. But much more Triton likes watching live competitions. So Triton decides to set up…
G. #TheDress Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100637/problem/G Description After landing on planet i1c5l people noticed that blue and black clothes are quite popular among the locals. Each aboriginal has at least…
Couple Cover Time Limit: 3000MS   Memory Limit: 524288KB   64bit IO Format: %I64d & %I64u Description 方宝宝有n个篮球,每个篮球上写有一个值ai.他第一次从n个篮球中取出1个,不放回.第二次再在剩余的篮球中取出一个. (每个球被取概率相同).如果这两个球上的值的乘积大于等于p,他会变得高兴,然后请大家吃饭.否则方宝宝会不高兴, 然后暴食暴饮变得更胖. 当然为了方宝宝的健康(被请吃饭),我想取一个…
D. Jerry's Protest time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Andrew and Jerry are playing a game with Harry as the scorekeeper. The game consists of three rounds. In each round, Andr…
题目链接: http://codeforces.com/contest/651/problem/D D. Image Preview time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya's telephone contains n photos. Photo number 1 is currently opened on…
原题链接:http://codeforces.com/gym/100203/attachments/download/1702/statements.pdf 题解 考虑暴力的复杂度是O(n^3),所以我们需要记录所有的ai+aj,如果当前考虑到了ak,那么就去前面寻找ai,使得ak-ai是我们记录过的和.整个算法的复杂度O(n^2). 代码 #include<iostream> #include<cstring> #include<cstdio> #include<…
Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready for the attack of the White Walkers. He has created a m…
原题链接:http://codeforces.com/problemset/problem/850/A 题意:有n个五维空间内的点,如果其中三个点A,B,C,向量AB,AC的夹角不大于90°,则点A是“bad”的否则是“good”.题目让我们输出good的点. 思路:从2,3维空间超过5,7个点时不存在“good”的点,可以简单推知五维空间内,超过11个点时不存在“good”的点,那么点数小于11时暴力,大于11时输出0. 其实由于数据量小,直接暴力也是可行的. AC代码: #include<i…