【CodeforcesRound#283(Div.2)--B.SecretCombination_html/css_WEB-ITnose】教程文章相关的互联网学习教程文章

CodeforcesRound#280(Div.2)A_html/css_WEB-ITnose

题目: A. Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of the pyramid must consist...

CodeforcesRound#280(Div.2)B_html/css_WEB-ITnose

题目: B. Vanya and Lanterns time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the street corresponding to the poi...

CodeforcesRound#278(Div.1)解题报告_html/css_WEB-ITnose

A题:Fight the Monster 枚举+二分 因为每个元素的数据范围只有100,所以可以用枚举,对于血量用二分,然后判断结果是否可行。 代码如下: #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define LL __int64const int INF=0x3f3f3f3f;int hy, ay, dy, hm, am, dm;int bin_search(int a, int d){ if(d>=am) return hy; int low=0,...

CodeforcesRound#280(Div.2)-A.VanyaandCubes_html/css_WEB-ITnose

Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of the pyramid must consist of 1 cube, the second level must consist o...

CodeforcesRound#220(Div.2)D树状数组&&二分_html/css_WEB-ITnose

/*题目*/ 题意:给了n,m,然后一个包含m个数的数组nnum,数组默认从小到大排序,然后是 n个操作,输入一个数x,若x为0,把0加到这个字符串的末尾,若x为1,把1加到这个字符串的末尾,若x为-1,那么把字符串里的 下标 与 nnum数组里的元素相等的 给删除,字符串一开始是空的,问你最后字符串里有什么,若为空 就输出 POOR STACK 这题目看这操作一般都很容易联想到线段树,树状数组,一开始我建了个树状数组,但是超时了,毕竟操...

CodeforcesRound#280(Div.2)-B.VanyaandLanterns_html/css_WEB-ITnose

Vanya and Lanterns time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the street corresponding to the point 0, and its en...

CodeforcesRound#280(Div.2)-C.VanyaandExams(贪心)_html/css_WEB-ITnose

Vanya and Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya ...

CodeforcesRound#280(Div.2)C_html/css_WEB-ITnose

题目: C. Vanya and Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot e...

CodeforcesRound#280(Div.2)D_html/css_WEB-ITnose

题目: D. Vanya and Computer Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level. Vanyas character performs attack with frequency x hits per sec...

CodeforcesRound#281(Div.2)(A、B、C、D题)_html/css_WEB-ITnose

昨天这场CF打的还挺爽的,不过就是没咋涨Rating,没把握好涨Rating的机会。。 本来可以过四题的,,但是很失败,重评后跪了两道。。唉:-( A. Vasya and Football 思路:给每个人计数,黄牌+1,红牌+2。 当数字第一次超过2时输出。 题目链接:A. Vasya and Football AC代码: #include #include #include #include #include #include using namespace std;struct node { char name[25]; int a[105];}home, a...

CodeforcesRound#250(Div.1)B(排序+并查集)_html/css_WEB-ITnose

B. The Child and Zoo time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains ai animals in it. Also there are m roads in ...

CodeforcesRound#281(Div.2)_html/css_WEB-ITnose

这场题也不难。 不过自己一直犯逗。 不是题目看错就是数组开小。 A,B,C,D都还挺水的,E其实也挺简单,只不过我当时没想明白。。 C的话, 枚举所有可能的d即可,复杂度是排序的nlogn D的话, 对于奇数来说,黑方只需要跟白方对称走就一定能赢 偶数的话, 白方往1,2走一步就变成了奇数的情况,然后黑方咋走,白方就对称走就行。所以最后白方一定能赢 E 对于给出的t, a, b 我们先把特判的搞定, 无非是t = 1,...

CodeforcesRound#280(Div.2)解题报告A.B.C.D.E._html/css_WEB-ITnose

不知道到底是我的水平提高了还是CF的题目变水了。。。。。。 A - Vanya and Cubes 水题。。暴力枚举就可以。。 代码如下: #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define LL __int64const int INF=0x3f3f3f3f;int s[100], sum[100];int main(){ int n, i; s[1]=1; sum[i]=1; scanf("%d",&n); for(...

CodeforcesRound#280(Div.2)_html/css_WEB-ITnose

这场题简单的令人吃惊 ABC几乎都是签到题 D的话 把两个人的射击时间转化成整数 求个gcd,除一下。 假设两人的射击频率分别是1秒x,1秒y x,y的gcd为g 转化一下就相当于 第一个人 y/g 秒射一发, 第二个人x/g秒射一发 然后两个人在 x/g*y/g 秒时会同时射击 那么每个x/g*y/g秒就是一个周期了 假设怪物的血有a,那么a%(x+y)就是最后一个周期要射击的血量 在这个时候我已经懒得继续思考了, 直接去二分某个人射击的次...

CodeforcesRound#280(Div.2A,B,C,D,E)_html/css_WEB-ITnose

改了时区之后打cf更辛苦了啊。。。昨天没做,今天补了一下啊。 A. Vanya and Cubes 每次加的数规律性很明显就是:(i+1)*i/2。暴力枚举i就可以得到答案。 #include #include #include #include #include #include #include #include #include #include #include #include #define eps 1e-8#define M 1000100#define LL long long//#define LL long long#define INF 0x3f3f3f#define PI 3.1415926535898#define mod 1000000007#d...