上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4880模拟题吧~~一开始把题意理解错了,以为不知道都是0,然后就看不懂第一组样例,后来才明白那些是未知的,多少都可以。英文啊~~~伤~~~当n为0,1,2,3的时候一定可以达到最大;当n等于4的时候单独考虑;当n等于5的时候也单独考虑;代码写的很不文艺,,,View Code 1 #include <iostream> 2 #include <algorithm> 3 #include <math.h> 4 #include <cst 阅读全文
posted @ 2012-10-20 15:13 _sunshine 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 长春赛的K题~~~自己简直弱爆了~~这道题和网络赛的一道数论题方法一样,都是枚举一个变量,二分查找另外一个变量,然后根据题意求就好了。比赛的时候也是这么做的,可是有两个地方错了,WA了五个小时,呵呵(真无奈),真的弱爆了。第一个错误:二分上下界弄错了,正确的是(1,开n的r次方),结果弄成了(开n的r次方,n)第二个错误:“And it's optional to place at most one candle at the center of the cake.”其中是at most one,也就是可以是0或者是1,可是我理解成了必须有1个。题目连接:http://acm.zju. 阅读全文
posted @ 2012-10-16 21:22 _sunshine 阅读(447) 评论(0) 推荐(0) 编辑
摘要: Silver Cow PartyTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 9111Accepted: 4097DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way 阅读全文
posted @ 2012-10-12 18:53 _sunshine 阅读(834) 评论(0) 推荐(0) 编辑
摘要: http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1552超过半数的数字Time Limit: 2500 MSMemory Limit: 7000 KTotal Submit: 267(14 users)Total Accepted: 107(10 users)Special Judge: NoDescription给定一个n元素的序列,其中存放的都是整数类型的数据。现在保证给出的序列中有一个数,这个数的个数超过整个序列元素总个数的一半,请你找出这个数是多少。Input输入数据第一行 阅读全文
posted @ 2012-10-12 18:09 _sunshine 阅读(501) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1981题意:给定N个点,用一个半径1的圆去覆盖,最多能覆盖多少个点?思路:如果只有一个点,那么输出1 O(N^3)暴力!!4700+ 一个覆盖最多点的圆,必然至少有两个点在圆上。 枚举两个点,求过这两个点的单位圆,判断有多少个点在圆中,枚举N^2,判断NView Code 1 #include <stdio.h> 2 #include <string.h> 3 #include <math.h> 4 #include <iostream> 5 using namespace std; 6 #d 阅读全文
posted @ 2012-10-11 14:07 _sunshine 阅读(2732) 评论(4) 推荐(0) 编辑
摘要: ConvexTime Limit: 10000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1386 Accepted Submission(s): 421 Problem DescriptionYour task is very simple. You will get the coordinates of n points in a plane. It is guaranteed that there are no three points on a straigh 阅读全文
posted @ 2012-10-06 21:18 _sunshine 阅读(733) 评论(0) 推荐(0) 编辑
摘要: Going from u to v or from v to u?Time Limit: 2000MSMemory Limit: 65536KTotal Submissions: 11440Accepted: 2929DescriptionIn order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x an 阅读全文
posted @ 2012-10-04 00:33 _sunshine 阅读(771) 评论(0) 推荐(0) 编辑
摘要: SPFTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 3876Accepted: 1771DescriptionConsider the two networks shown below. Assuming that data moves around these networks only between directly connected nodes on a peer-to-peer basis, a failure of a single node, 3, in the network on the left woul 阅读全文
posted @ 2012-09-28 20:28 _sunshine 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 【转】JAVA String.format 方法使用介绍1.对整数进行格式化:%[index$][标识][最小宽度]转换方式 我们可以看到,格式化字符串由4部分组成,其中%[index$]的含义我们上面已经讲过,[最小宽度]的含义也很好理解,就是最终该整数转化的字符串最少包含多少位数字。我们来看看剩下2个部分的含义吧: 标识: '-' 在最小宽度内左对齐,不可以与“用0填充”同时使用 '#' 只适用于8进制和16进制,8进制时在结果前面增加一个0,16进制时在结果前面增加0x '+' 结果总是包括一个符号(一般情况下只适用于10进制,若对象为Bi 阅读全文
posted @ 2012-09-22 00:54 _sunshine 阅读(12129) 评论(0) 推荐(0) 编辑
摘要: BuildingsTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 439 Accepted Submission(s): 218 Problem Description Have you ever heard the story of Blue.Mary, the great civil engineer? Unlike Mr. Wolowitz, Dr. Blue.Mary has accomplished many great pro. 阅读全文
posted @ 2012-09-17 16:38 _sunshine 阅读(1251) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页