Fire station
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1308 Accepted Submission(s): 434
Problem Description
A city's map can ...
分类:
其他好文 时间:
2014-07-22 23:01:35
阅读次数:
287
本题还是有一定难度的。
注意点:
1 要使用逆向思维,不是要计算melt掉多少sculptures, 而是要计算需要剩下多少个sculptures
2 所有情况都需要考虑到,最大间隔melt掉的sculptures是n/3个
3 要判断这样间隔melt掉sculptures之后,剩下的sculptures是否能组成多边形
要很仔细想清楚才能做出来。
It is never too careful to scrutinize a problem!
It is never too careful to desi...
分类:
其他好文 时间:
2014-07-22 23:00:13
阅读次数:
279
小明系列问题——小明序列
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 1567 Accepted Submission(s): 463
Problem Description
大家都知道小明最喜欢研究...
分类:
其他好文 时间:
2014-05-03 00:40:15
阅读次数:
348
Excuses, Excuses!
Judge Ito is having a problem with people subpoenaed for jury duty giving rather lame excuses in order to avoid serving. In order to reduce the amount of time requi...
分类:
其他好文 时间:
2014-05-02 23:54:43
阅读次数:
474
16、Power digit sum215= 32768 and the sum of its
digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number
21000?题目大意:215= 32768 并且其...
分类:
其他好文 时间:
2014-05-02 13:17:49
阅读次数:
1223
接下来要讲的是我自己曾经做的一个项目中的一个小内容。对于数学表达式的括号检查。比如数学表达式(3+2)*sin(30+((2+1)))+sum[1,(cos(2)),3]是一个正确的表达式,其中一部分是对其表达式中括号的检查。现在给你一个字符串s,如何判断它的括号是否匹配。我们采用压栈的处理方式。遍...
分类:
其他好文 时间:
2014-05-02 13:06:57
阅读次数:
328
这道题,采用动态规划算法。from top to
down,把到每个节点的最小路径和都求出来。下面是AC代码: 1 /** 2 * Given a triangle, find the minimum path
sum from top to bottom. 3 * Each ...
分类:
其他好文 时间:
2014-05-02 12:19:23
阅读次数:
382
题目大意:先给定n个数字,现在要求算出这n个数字的两两之和保存到sum数组,然后在给定m个数,要求找到和每一个数最接近的sum[i];
挨个计算每个属于其他数之间的sum,然后排序;
查找时有两种方法:二分查找&&双向查找;当然二分查找的效率比后者高了很多,但是都能AC。
提供一条新思路,并不一定非要用二分。
双向查找:
#include
#include
#include
using ...
分类:
其他好文 时间:
2014-05-01 18:43:34
阅读次数:
256
链接:http://acm.hdu.edu.cn/showproblem.php?pid=3415
题意:给出一个数环,要找出其中9长度小于等于K的和最大的子段。
思路:不能采用最暴力的枚举,题目的数据量是10^5,O(N^2)的枚举回去超时,本题采用的很巧妙的DP做法,是用单调队列优化的DP。
运用的是STL的deque,从i:1~a找到以其中以i为尾的符合条件的子段,并将i本身放入双向队...
分类:
其他好文 时间:
2014-05-01 08:32:53
阅读次数:
324
--跟踪文件读入到表中分析
SELECT * INTO ZGSJY
FROM fn_trace_gettable('E:\wxxcdbprofiler.trc', default);
--某时间内,最耗时SQL
select TOP 100 SUBSTRING(Textdata,1,660) as '名称',
count(*) as '数量', sum(duration/1000) as '总执行...
分类:
数据库 时间:
2014-04-30 22:37:39
阅读次数:
327