随笔分类 -  ?_?

摘要:题意:在矩阵中,找一条路从 (1,1)->(n,m),使方差最小 思路: T = (N+M−1)∑N+M−1i=1(Ai−Aavg)2 将N + M - 1乘进去,即求1 ~ N+M-1,(N + M - 1)*A[i] - (A[i] + ..... + A[N]) 的和由于 假设Aavg可以是任 阅读全文
posted @ 2015-09-28 21:41 Przz 阅读(263) 评论(0) 推荐(0)
摘要:题意:给你n,a,b. 希望得到比n大,二进制1的个数在 a ,b之间的最小的数 思路:①满足条件,输出 ②num < a 从右找到是0的最小位,变成1 ③num > b从右到左找是1的最小位,加上一,即 n + 2 ^ i ps.我们需要的就是不停找借口让自己坚持下去 阅读全文
posted @ 2015-09-28 20:03 Przz 阅读(195) 评论(0) 推荐(0)
摘要:Sample Input 2 3 2 33 3 33 2 33 10 5 467 6 378 7 309 8 499 5 320 3 480 2 444 8 391 5 333 100 499 2 3 2 33 3 33 2 33 10 5 467 6 378 7 309 8 499 5 320 3 阅读全文
posted @ 2015-09-28 18:32 Przz 阅读(158) 评论(0) 推荐(0)
摘要:The sequence is generated by the following scheme. 1. First, write down 1, 2 on a paper. 2. The 2nd number is 2, write down 2 2’s (including the one o 阅读全文
posted @ 2015-09-21 17:27 Przz 阅读(199) 评论(0) 推荐(0)
摘要:题意:建树,给你几个点,要求输出走到各个点的路径(左为E,右为W,树的遍历) 二叉树的模拟题,但是GG了两次。 主要是没注意到直接模拟会爆掉- -,进行下处理就好了 阅读全文
posted @ 2015-09-13 23:04 Przz 阅读(274) 评论(0) 推荐(0)
摘要:题意:邀请k个朋友,每个朋友带有礼物价值不一,m次开门,每次开门让一定人数p(如果门外人数少于p,全都进去)进来,当所有人到时会再开一次,每次都是礼物价值高的人先进。 /*小伙伴最开始gg了,结果发现是开门没排序 1.如果价值相等,先到的进; 2.开门的时间要进行排序; Sample Input 1 阅读全文
posted @ 2015-09-13 22:53 Przz 阅读(149) 评论(0) 推荐(0)
摘要:题意:给你n+1个数(0->n),让你为这n+1个数在0->n中分别找一个数与其异或,求最后的最大值 思路:假设一个数5 (二进制1 0 1),则找的另一个数在5的0位上最好是1 , 1位上最好为0,使其异或后为1. 阅读全文
posted @ 2015-09-09 16:18 Przz 阅读(128) 评论(0) 推荐(0)
摘要:CRB has a tree, whose vertices are labeled by 1, 2, …, N. They are connected by N – 1 edges. Each edge has a weight. For any two vertices u and v(poss 阅读全文
posted @ 2015-08-31 03:26 Przz 阅读(159) 评论(0) 推荐(0)
摘要:For each test case, in the first line, you should print the maximum sum. In the next line you should print a string consisting of "L","R","U" and "D", 阅读全文
posted @ 2015-08-19 10:15 Przz 阅读(139) 评论(0) 推荐(0)
摘要:Sample Input 5 2 -2 0 2 0 -2 0 5 2 3 2 3 3 3 3 5 2 -2 0 2 0 -2 0 5 2 3 2 3 3 3 3 Sample Output 12 5 12 5 求最多多少序列满足,前半部分满足d(j+1) = d(j)+d1,后半部分d(j+1)= 阅读全文
posted @ 2015-08-19 09:31 Przz 阅读(163) 评论(0) 推荐(0)
摘要:Sample Input 1 3 5 2 2 1 2 3 3 2 1 3 3 3 3 3 3 3 3 3 3 H 2 3 L 2 2 H 3 3 H 1 3 L 2 3 1 3 5 2 2 1 2 3 3 2 1 3 3 3 3 3 3 3 3 3 3 H 2 3 L 2 2 H 3 3 H 1 3 阅读全文
posted @ 2015-08-13 22:02 Przz 阅读(135) 评论(0) 推荐(0)
摘要:Problem Description In this problem, we should solve an interesting game. At first, we have an integer n, then we begin to make some funny change. We 阅读全文
posted @ 2015-08-12 10:10 Przz 阅读(161) 评论(0) 推荐(0)
摘要:Sample Input 4 8 4 1 3 2 2 1 0 3 5 3 6 4 2 1 7 6 8 3 3 2 0 5 0 3 6 4 5 2 7 7 6 7 6 8 2 2 3 3 3 0 0 2 7 4 3 6 3 2 2 5 8 5 6 5 3 3 1 2 4 6 7 7 6 5 4 3 5 阅读全文
posted @ 2015-08-07 10:56 Przz 阅读(149) 评论(0) 推荐(0)
摘要:Each soda has some candies in their hand. And they want to make the number of candies the same by doing some taking and giving operations. More specif 阅读全文
posted @ 2015-08-06 19:42 Przz 阅读(175) 评论(0) 推荐(0)
摘要:Problem Description A simple problem Problem Description You have a multiple set,and now there are three kinds of operations: 1 x : add number x to se 阅读全文
posted @ 2015-08-04 20:04 Przz 阅读(187) 评论(0) 推荐(0)
摘要:Problem Description MZL loves xor very much.Now he gets an array A.The length of A is n.He wants to know the xor of all (Ai+Aj)(1≤i,j≤n) The xor of an 阅读全文
posted @ 2015-08-04 20:00 Przz 阅读(213) 评论(0) 推荐(0)
摘要:Problem Description There is an integer a and n integers b1,…,bn. After selecting some numbers from b1,…,bn in any order, say c1,…,cr, we want to make 阅读全文
posted @ 2015-08-04 16:13 Przz 阅读(173) 评论(0) 推荐(0)
摘要:Virtual Participation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 237 Accepted Submission(s) 阅读全文
posted @ 2015-08-01 18:38 Przz 阅读(206) 评论(0) 推荐(0)
摘要:Walk Out Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2001 Accepted Submission(s): 376 Proble 阅读全文
posted @ 2015-07-31 17:28 Przz 阅读(151) 评论(0) 推荐(0)
摘要:Connect the Graph Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 108 Accepted Submission(s): 36 阅读全文
posted @ 2015-07-30 21:58 Przz 阅读(218) 评论(0) 推荐(0)