Selecting Courses
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9363
Accepted: 4164
Description
It is well known that it is not easy to select courses ...
分类:
其他 时间:
2015-08-26 20:12:32
收藏:
0 评论:
0 赞:
0 阅读:
254
散列函数直接用key%size的形式,size为散列表的大小。
冲突处理采用平方探测法,为保证可以探测到整个散列表空间,散列表大小设置为4k+3形式的素数。
当散列表中的元素过多时会造成性能下降,这时应该倍增散列表的大小,重新计算原来散列表中每个元素在新的散列表中的位置。
散列表的实现
// HashTable.cpp : 定义控制台应用程序的入口点。
//
#inc...
分类:
其他 时间:
2015-08-26 20:12:12
收藏:
0 评论:
0 赞:
0 阅读:
240
这里以spring的配置文件为例,代码如下
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:sch...
分类:
其他 时间:
2015-08-26 20:11:32
收藏:
0 评论:
0 赞:
0 阅读:
1286
题意:判定给出的有向图是不是强连通图
Tarjan算法模板题目
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#...
分类:
其他 时间:
2015-08-26 20:11:22
收藏:
0 评论:
0 赞:
0 阅读:
192
题目链接:点击打开链接
题意描述:给定一棵树,树上每条边的有一个权值,问从任意一个点出发能走得最长路径是多少?
解题思路:树上最长路径 dp
1、任意找一个点作为根节点,将无根树转化为有根树
2、在dfs过程中更新f[i],g[i],其中f[i]记录以i为节点向下扩展最长路,g[i]为次长路,并用mark标记每个节点最长路的儿子节点
3、在dfs1的过程中更新h[i],h[i]表...
分类:
其他 时间:
2015-08-26 20:10:52
收藏:
0 评论:
0 赞:
0 阅读:
214
题目大意
一个软件有 s 个子系统,存在 n 种 bug。某人一天能找到一个 bug。问,在这个软件中找齐 n 种 bug,并且每个子系统中至少包含一个 bug 的时间的期望值(单位:天)。注意:bug
是无限多的,每个 bug 属于任何一种 bug 的概率都是 1/n;出现在每个系统是等可能的,为 1/s。
求解:
dp[i][j]表示已经找到i...
分类:
其他 时间:
2015-08-26 20:10:32
收藏:
0 评论:
0 赞:
0 阅读:
137
1.div水平居中
.className{
width:270px;
height:150px;
margin:0 auto;
}
2.div垂直居中
.className{
width:270px;
height:150px;
position:absolute;
left:50%;...
分类:
其他 时间:
2015-08-26 20:10:24
收藏:
0 评论:
0 赞:
0 阅读:
211
注:本文源码是JDK8的版本,与之前的版本有较大差异
ConcurrentHashMap是conccurrent家族中的一个类,由于它可以高效地支持并发操作,以及被广泛使用,经典的开源框架Spring的底层数据结构就是使用ConcurrentHashMap实现的。与同是线程安全的老大哥HashTable相比,它已经更胜一筹,因此它的锁更加细化....
分类:
其他 时间:
2015-08-26 20:10:12
收藏:
0 评论:
0 赞:
0 阅读:
209
这么简单一道题目,想了这么久,还wa了一次,不可饶恕啊,越来越觉得自己笨了,dfs搜索都快不会写了。。。逻
辑混乱,一定得认真想题目,认真写代码:
代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define MAX 0x7fffffff
using namespac...
分类:
其他 时间:
2015-08-26 20:09:52
收藏:
0 评论:
0 赞:
0 阅读:
258
cocos2dx 设置资源寻找路径> 问题描述: 开发一个游戏,可能有很多资源文件夹,要是每次自己添加,很麻烦?
> 解决办法: 通过调用FileUtils类方法
> 具体解决方法1: 在程序中所有资源都不能添加文件夹路径//在Appdelegate.cpp里的applicationDidFinishLaunching()函数里添加这么几行代码:
std:...
分类:
其他 时间:
2015-08-26 20:09:42
收藏:
0 评论:
0 赞:
0 阅读:
1723
Problem Description
lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier than begin.
...
分类:
其他 时间:
2015-08-26 20:09:32
收藏:
0 评论:
0 赞:
0 阅读:
293
曾几何时,你看到源代码就如同看花千骨,虐,如果你是白子画,你怎么想,用爱记 掌控内心城府的人...
分类:
其他 时间:
2015-08-26 20:09:13
收藏:
0 评论:
0 赞:
0 阅读:
220
//数据转换函数
//WORD to BYTE
void CICONV::SetWordToByte(WORD wCardData, BYTE & cbCardData)
{
BYTE cbColor = wCardData >> 8;
if (cbColor == 4)
{
cbCardData = 0x40|((wCardData & 0x000f) +...
分类:
其他 时间:
2015-08-26 20:08:52
收藏:
0 评论:
0 赞:
0 阅读:
194
1. 对于直接已知值的int,long,short,char 类型以及其unsigned版本,即 const int a=2; 这种,编译器编译程序之后,程序中所有a出现的地方,全部自动替换成2. 所以,就出现了对于 *b=3 ,在 const int a=2 ;中不会修改a,而在 const int a=c; 中则会修改 a的情况.
int main()
{
const int a = 1...
分类:
其他 时间:
2015-08-26 20:08:42
收藏:
0 评论:
0 赞:
0 阅读:
305
public class TextDrawView extends View {
private int textColor = 0xffafafaf;
private float textSize = 12;
private String textToDraw = "";
private List textLines=new ArrayList();
pr...
分类:
其他 时间:
2015-08-26 20:08:33
收藏:
0 评论:
0 赞:
0 阅读:
262
题意:
给出S个自动机,每个自动机有n个结点和m个输出结点;
每个结点有两个后继'0'和'1',将当前走过的串末尾加那个字符,然后走到下一个结点;
每次从0号点,以一个空串出发,到了输出结点时可以选择输出当前串;
如果一个自动机x可以输出的所有串另一个自动机y也都可以输出,那么y是x的升级;
求最大升级序列;
S,n,m
题解:
这道题稍微考虑一下之后,发现难以处理的地方是...
分类:
其他 时间:
2015-08-26 20:07:52
收藏:
0 评论:
0 赞:
0 阅读:
273
Cocos2dx-3.4 打包成apx
1. 要注意pro.android\jni\Android.mk添加自己不是cocos2dx自己生成的ccp\
或者修改Android.mkFILE_LIST := hellocpp/main.cpp
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp) LOCAL_SRC_FILES...
分类:
其他 时间:
2015-08-26 20:07:22
收藏:
0 评论:
0 赞:
0 阅读:
233
找新朋友
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 9387 Accepted Submission(s): 4974
Problem Description
新年快到了,“猪头帮协会”准备搞一个聚会,...
分类:
其他 时间:
2015-08-26 20:07:12
收藏:
0 评论:
0 赞:
0 阅读:
309
click here ~~ ***A. Elections***The country of Byalechinsk is running elections involving n candidates. The country consists of m cities. We know how many peop...
分类:
其他 时间:
2015-08-26 20:07:02
收藏:
0 评论:
0 赞:
0 阅读:
224
It's been a long day without you my friend 没有老友你的陪伴 日子真是漫长 And I'll tell you all about it when I see you again 与你重逢之时 我会敞开心扉倾诉所有 We've come a long way from where we began 回头凝望 我们携手走过漫长的旅程 Oh I'll...
分类:
其他 时间:
2015-08-26 20:06:52
收藏:
0 评论:
0 赞:
0 阅读:
257